diff --git a/lib/theme/icons.dart b/lib/theme/icons.dart index 667be39d0..abf9008b0 100644 --- a/lib/theme/icons.dart +++ b/lib/theme/icons.dart @@ -36,7 +36,8 @@ class AIcons { // as of Flutter v3.16.3, // `label_important_outlined` matches text direction but is filled // `label_important_outline` is outlined but does not match text direction - static final important = Icons.label_important_outline.copyWith(matchTextDirection: true); + static const important = IconData(labelImportantOutlineCodePoint, fontFamily: materialIconsFontFamily, matchTextDirection: true); + static const language = Icons.translate_outlined; static const location = Icons.place_outlined; static const locationUnlocated = Icons.location_off_outlined; @@ -184,18 +185,9 @@ class AIcons { static final github = MdiIcons.github; static final legal = MdiIcons.scaleBalance; -} -extension ExtraIconData on IconData { - IconData copyWith({ - bool? matchTextDirection, - }) { - return IconData( - codePoint, - fontFamily: fontFamily, - fontPackage: fontPackage, - matchTextDirection: matchTextDirection ?? this.matchTextDirection, - fontFamilyFallback: fontFamilyFallback, - ); - } + // Material Icons references to make constant instances of `IconData` + // as non-constant instances of `IconData` prevent icon font tree shaking + static const labelImportantOutlineCodePoint = 0xe362; + static const materialIconsFontFamily = 'MaterialIcons'; }