From ee0fdae63112904830bbe1e6f97ea463696c4193 Mon Sep 17 00:00:00 2001 From: SuicaLondon <66697085+SuicaLondon@users.noreply.github.com> Date: Wed, 28 Aug 2024 09:38:06 +0100 Subject: [PATCH] Add comment document to fontFamily in the IconData (#154150) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I’ve added a comment document for the `fontFamily` property of `IconData`. The purpose of this is to provide developers with a hint when importing a custom icon. It only includes the change made in the comment. The original issue was: [154144](https://github.com/flutter/flutter/issues/154144) It was marked as closed so I created a new issues for proposal: Fixes #154149 *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].* --- packages/flutter/lib/src/widgets/icon_data.dart | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/flutter/lib/src/widgets/icon_data.dart b/packages/flutter/lib/src/widgets/icon_data.dart index d7b1718282cb5..ca118126d1a5f 100644 --- a/packages/flutter/lib/src/widgets/icon_data.dart +++ b/packages/flutter/lib/src/widgets/icon_data.dart @@ -26,6 +26,17 @@ class IconData { /// Rarely used directly. Instead, consider using one of the predefined icons /// like the [Icons] collection. /// + /// The [fontFamily] argument is normally required when using custom icons. + /// + /// e.g. When using a [codePoint] from a `CustomIcons` font + /// ```yaml + /// fonts: + /// - family: CustomIcons + /// fonts: + /// - asset: assets/fonts/CustomIcons.ttf + /// ``` + /// `IconData` usages should specify `fontFamily: 'CustomIcons'`. + /// /// The [fontPackage] argument must be non-null when using a font family that /// is included in a package. This is used when selecting the font. ///