Skip to content

Commit cfb07cb

Browse files
SuicaLondonpull[bot]
authored andcommitted
Add comment document to fontFamily in the IconData (flutter#154150)
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](flutter#154144) It was marked as closed so I created a new issues for proposal: Fixes flutter#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].*
1 parent 3bf3981 commit cfb07cb

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

packages/flutter/lib/src/widgets/icon_data.dart

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,17 @@ class IconData {
2626
/// Rarely used directly. Instead, consider using one of the predefined icons
2727
/// like the [Icons] collection.
2828
///
29+
/// The [fontFamily] argument is normally required when using custom icons.
30+
///
31+
/// e.g. When using a [codePoint] from a `CustomIcons` font
32+
/// ```yaml
33+
/// fonts:
34+
/// - family: CustomIcons
35+
/// fonts:
36+
/// - asset: assets/fonts/CustomIcons.ttf
37+
/// ```
38+
/// `IconData` usages should specify `fontFamily: 'CustomIcons'`.
39+
///
2940
/// The [fontPackage] argument must be non-null when using a font family that
3041
/// is included in a package. This is used when selecting the font.
3142
///

0 commit comments

Comments
 (0)