From a8a2f70b9a31d45b07ed1bb4aaa6040a3810dad0 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 16 Nov 2026 19:32:29 +0000 Subject: [PATCH] feat(ui_oauth)!: compile provider icons with vector_graphics_compiler ## Description The OAuth provider buttons (Google, Apple, Facebook, Twitter) store their icons as inline SVG strings and render them with `flutter_svg` (`SvgPicture.string`). That means every app parses SVG at runtime and ships `flutter_svg` plus the SVG parser it pulls in, even though the icons are known at build time. This PR moves the icons to SVG assets that are compiled into the `vector_graphics` binary format by the `vector_graphics_compiler` asset transformer when the app is built, and renders them with `VectorGraphic`. Compiling at app build time (rather than committing precompiled `.vec` files) keeps the binary output in sync with the `vector_graphics` / codec version resolved by the consuming app. ### Changes - **firebase_ui_oauth** - Replace the `flutter_svg` dependency with `vector_graphics`. - Add `OAuthProviderIcon`, which loads `iconSrc` from `assetsPackage` via `AssetBytesLoader`. It is used by the button and by `ThemedOAuthProviderButtonStyle.iconWidget`. The `assetsPackage` getter, which was previously unused, now drives icon loading. - Document how custom styles should declare their icon assets. - **firebase_ui_oauth_{google,apple,facebook,twitter}** - Move the inline SVG strings to `assets/icons/*.svg`, declared with the `vector_graphics_compiler` transformer, and point `iconSrc` at them. - Add `vector_graphics_compiler` as a regular dependency. Flutter runs the transformer with `dart run` from the consuming app's directory, so it must be resolvable from the app; as a `dev_dependency` the app build fails with "Could not find package `vector_graphics_compiler`". The compiler is not imported by any Dart code, so it is not compiled into apps. - Google: the unused `assets/google_icon.svg` is moved to `assets/icons/google.svg`. - **Tests**: the `firebase_ui_oauth` widget tests now serve icon bytes produced by `encodeSvg` and look for `VectorGraphic` instead of `SvgPicture`. ### Verification - `melos run analyze` reports no issues in any workspace package. - `melos run test:unit:all` passes: `flutter test` and `flutter test --platform=chrome` in all 7 packages with tests. - A standalone web app (outside the workspace) depending on `firebase_ui_oauth_google` builds with `flutter build web --release` without depending on the compiler itself, and the bundled `google.svg` asset is the compiled binary (828 bytes). - All four providers' icons render correctly in light and dark themes. Note: after switching branches, `flutter test` may reuse stale assets from `build/unit_test_assets`; delete that directory if icons render blank. ## Related Issues Fixes https://github.com/firebase/FirebaseUI-Flutter/issues/247 ## Checklist - [ ] I read the Contributor Guide and followed the process outlined there for submitting PRs. - [x] My PR includes unit or integration tests for _all_ changed/updated/fixed behaviors. - [x] All existing and new tests are passing. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] The analyzer (`melos run analyze`) does not report any problems on my PR. - [x] All unit tests pass (`melos run test:unit:all` doesn't fail). - [ ] I read and followed the Flutter Style Guide. - [ ] I signed the CLA. - [ ] I am willing to follow-up on review comments in a timely manner. ## Breaking Change - [x] Yes, this is a breaking change. - [ ] No, this is _not_ a breaking change. BREAKING CHANGE: `ThemedIconSrc` values returned by `ThemedOAuthProviderButtonStyle.iconSrc` are now asset paths (relative to `assetsPackage`) of SVG assets declared with the `vector_graphics_compiler` asset transformer, instead of raw SVG strings. Custom OAuth provider styles must move their SVGs to assets, declare them with the transformer, and add `vector_graphics_compiler` as a dependency of the package that declares them. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01N9vW6UAypN8gghMxWzymfC --- .../lib/src/oauth_provider_button_base.dart | 8 ++- .../lib/src/oauth_provider_button_style.dart | 57 ++++++++++++++++++- packages/firebase_ui_oauth/pubspec.yaml | 3 +- .../test/flutterfire_ui_oauth_test.dart | 33 ++++------- .../assets/icons/apple_dark.svg | 8 +++ .../assets/icons/apple_light.svg | 8 +++ .../lib/src/theme.dart | 27 ++------- packages/firebase_ui_oauth_apple/pubspec.yaml | 41 ++++--------- .../assets/icons/facebook.svg | 7 +++ .../lib/src/theme.dart | 12 +--- .../firebase_ui_oauth_facebook/pubspec.yaml | 38 +++---------- .../{google_icon.svg => icons/google.svg} | 1 - .../lib/src/theme.dart | 20 +------ .../firebase_ui_oauth_google/pubspec.yaml | 7 +++ .../assets/icons/twitter.svg | 8 +++ .../lib/src/theme.dart | 13 +---- .../firebase_ui_oauth_twitter/pubspec.yaml | 38 +++---------- 17 files changed, 146 insertions(+), 183 deletions(-) create mode 100644 packages/firebase_ui_oauth_apple/assets/icons/apple_dark.svg create mode 100644 packages/firebase_ui_oauth_apple/assets/icons/apple_light.svg create mode 100644 packages/firebase_ui_oauth_facebook/assets/icons/facebook.svg rename packages/firebase_ui_oauth_google/assets/{google_icon.svg => icons/google.svg} (99%) create mode 100644 packages/firebase_ui_oauth_twitter/assets/icons/twitter.svg diff --git a/packages/firebase_ui_oauth/lib/src/oauth_provider_button_base.dart b/packages/firebase_ui_oauth/lib/src/oauth_provider_button_base.dart index d6fa7460..d78e4301 100644 --- a/packages/firebase_ui_oauth/lib/src/oauth_provider_button_base.dart +++ b/packages/firebase_ui_oauth/lib/src/oauth_provider_button_base.dart @@ -5,7 +5,6 @@ import 'package:firebase_auth/firebase_auth.dart' as fba; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_svg/flutter_svg.dart'; import 'package:firebase_ui_auth/firebase_ui_auth.dart'; import 'package:firebase_ui_oauth/firebase_ui_oauth.dart'; @@ -392,7 +391,12 @@ class _ButtonContent extends StatelessWidget { Widget build(BuildContext context) { final icon = Padding( padding: EdgeInsets.all(iconPadding), - child: SvgPicture.string(iconSrc, width: height, height: height), + child: OAuthProviderIcon( + src: iconSrc, + package: assetsPackage, + width: height, + height: height, + ), ); if (label.isEmpty) { diff --git a/packages/firebase_ui_oauth/lib/src/oauth_provider_button_style.dart b/packages/firebase_ui_oauth/lib/src/oauth_provider_button_style.dart index 5ad02f16..3395d1fc 100644 --- a/packages/firebase_ui_oauth/lib/src/oauth_provider_button_style.dart +++ b/packages/firebase_ui_oauth/lib/src/oauth_provider_button_style.dart @@ -4,18 +4,36 @@ import 'package:flutter/material.dart'; import 'package:firebase_ui_shared/firebase_ui_shared.dart'; -import 'package:flutter_svg/svg.dart'; +import 'package:vector_graphics/vector_graphics.dart'; /// {@template ui.oauth.themed_oauth_provider_button_style} /// An object that is being used to resolve a style of the button. /// {@endtemplate} abstract class ThemedOAuthProviderButtonStyle { + /// Asset paths (relative to [assetsPackage]) of the light and dark icons. + /// + /// Icons must be compiled into the `vector_graphics` binary format. Declare + /// the SVG assets with the `vector_graphics_compiler` asset transformer: + /// + /// ```yaml + /// flutter: + /// assets: + /// - path: assets/icon.svg + /// transformers: + /// - package: vector_graphics_compiler + /// ``` + /// + /// The package declaring the assets must list `vector_graphics_compiler` + /// under `dependencies` (not `dev_dependencies`) so that the transformer + /// can be resolved when building the consuming app. ThemedIconSrc get iconSrc; ThemedColor get backgroundColor; ThemedColor get color; ThemedColor get iconBackgroundColor => backgroundColor; ThemedColor get borderColor => backgroundColor; double get iconPadding => 0; + + /// The name of the package that contains the [iconSrc] assets. String get assetsPackage; /// A custom label string. @@ -27,9 +45,9 @@ abstract class ThemedOAuthProviderButtonStyle { /// Profile Screen. ThemedValue get iconWidget => ThemedValue( // Display the light icon on a dark background. - SvgPicture.string(iconSrc.light), + OAuthProviderIcon(src: iconSrc.light, package: assetsPackage), // Display the dark icon on a light background. - SvgPicture.string(iconSrc.dark), + OAuthProviderIcon(src: iconSrc.dark, package: assetsPackage), ); /// {@macro ui.oauth.themed_oauth_provider_button_style} @@ -67,3 +85,36 @@ class OAuthProviderButtonStyle { required this.iconBackgroundColor, }); } + +/// {@template ui.oauth.oauth_provider_icon} +/// Renders an SVG icon asset compiled by the `vector_graphics_compiler` +/// asset transformer. +/// {@endtemplate} +class OAuthProviderIcon extends StatelessWidget { + /// The asset path of the precompiled icon. + final String src; + + /// The package that contains the [src] asset. + final String? package; + + final double? width; + final double? height; + + /// {@macro ui.oauth.oauth_provider_icon} + const OAuthProviderIcon({ + super.key, + required this.src, + this.package, + this.width, + this.height, + }); + + @override + Widget build(BuildContext context) { + return VectorGraphic( + loader: AssetBytesLoader(src, packageName: package), + width: width, + height: height, + ); + } +} diff --git a/packages/firebase_ui_oauth/pubspec.yaml b/packages/firebase_ui_oauth/pubspec.yaml index cccd0c93..b3af3b9d 100644 --- a/packages/firebase_ui_oauth/pubspec.yaml +++ b/packages/firebase_ui_oauth/pubspec.yaml @@ -13,9 +13,9 @@ dependencies: firebase_auth: ^7.0.0 firebase_ui_auth: ^4.0.0 firebase_ui_shared: ^1.5.0 - flutter_svg: ^2.0.9 flutter_web_auth_2: ^5.1.0 http: ^1.6.0 + vector_graphics: ^1.1.19 flutter: sdk: flutter @@ -23,6 +23,7 @@ dev_dependencies: flutter_test: sdk: flutter flutter_lints: ^6.0.0 + vector_graphics_compiler: ^1.1.19 false_secrets: - "/example/**/google-services.json" diff --git a/packages/firebase_ui_oauth/test/flutterfire_ui_oauth_test.dart b/packages/firebase_ui_oauth/test/flutterfire_ui_oauth_test.dart index 55ec8d78..cdf51d07 100644 --- a/packages/firebase_ui_oauth/test/flutterfire_ui_oauth_test.dart +++ b/packages/firebase_ui_oauth/test/flutterfire_ui_oauth_test.dart @@ -6,14 +6,20 @@ import 'package:firebase_auth/firebase_auth.dart' as fba; import 'package:firebase_ui_auth/firebase_ui_auth.dart'; import 'package:firebase_ui_oauth/firebase_ui_oauth.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_svg/flutter_svg.dart'; +import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:vector_graphics/vector_graphics.dart'; +import 'package:vector_graphics_compiler/vector_graphics_compiler.dart' + show encodeSvg; class FakeAssetBundle extends Fake implements AssetBundle { final String svgStr = ''''''; @override - Future loadString(String key, {bool cache = true}) async => svgStr; + Future load(String key) async { + final bytes = encodeSvg(xml: svgStr, debugName: key); + return bytes.buffer.asByteData(); + } } // Duplicated from packages/firebase_ui_oauth_google/lib/src/theme.dart @@ -26,24 +32,9 @@ const _backgroundColor = ThemedColor(_googleBlue, _googleWhite); const _color = ThemedColor(_googleWhite, _googleDark); const _iconBackgroundColor = ThemedColor(_googleWhite, _googleWhite); -const _iconSvg = ''' - - - - - - - - - - - - - - -'''; - -const _iconSrc = ThemedIconSrc(_iconSvg, _iconSvg); +const _iconAsset = 'assets/icons/google.svg'; + +const _iconSrc = ThemedIconSrc(_iconAsset, _iconAsset); class GoogleProviderButtonStyle extends ThemedOAuthProviderButtonStyle { const GoogleProviderButtonStyle(); @@ -193,7 +184,7 @@ void main() { await tester.pumpWidget(renderMaterialButton()); final iconFinder = find.byWidgetPredicate( - (widget) => widget is SvgPicture, + (widget) => widget is VectorGraphic, ); expect(iconFinder, findsOneWidget); diff --git a/packages/firebase_ui_oauth_apple/assets/icons/apple_dark.svg b/packages/firebase_ui_oauth_apple/assets/icons/apple_dark.svg new file mode 100644 index 00000000..dc70c8d1 --- /dev/null +++ b/packages/firebase_ui_oauth_apple/assets/icons/apple_dark.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/packages/firebase_ui_oauth_apple/assets/icons/apple_light.svg b/packages/firebase_ui_oauth_apple/assets/icons/apple_light.svg new file mode 100644 index 00000000..5083c7f4 --- /dev/null +++ b/packages/firebase_ui_oauth_apple/assets/icons/apple_light.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/packages/firebase_ui_oauth_apple/lib/src/theme.dart b/packages/firebase_ui_oauth_apple/lib/src/theme.dart index 3fcd9f2f..55219478 100644 --- a/packages/firebase_ui_oauth_apple/lib/src/theme.dart +++ b/packages/firebase_ui_oauth_apple/lib/src/theme.dart @@ -11,29 +11,10 @@ const _appleWhite = Color(0xffffffff); const _backgroundColor = ThemedColor(_appleWhite, _appleBlack); const _color = ThemedColor(_appleBlack, _appleWhite); -const _iconSvgLight = ''' - - - - - - - - -'''; - -const _iconSvgDark = ''' - - - - - - - - -'''; - -const _iconSrc = ThemedIconSrc(_iconSvgLight, _iconSvgDark); +const _iconSrc = ThemedIconSrc( + 'assets/icons/apple_light.svg', + 'assets/icons/apple_dark.svg', +); class AppleProviderButtonStyle extends ThemedOAuthProviderButtonStyle { const AppleProviderButtonStyle(); diff --git a/packages/firebase_ui_oauth_apple/pubspec.yaml b/packages/firebase_ui_oauth_apple/pubspec.yaml index f69ecf1d..96dc2fd3 100644 --- a/packages/firebase_ui_oauth_apple/pubspec.yaml +++ b/packages/firebase_ui_oauth_apple/pubspec.yaml @@ -11,6 +11,7 @@ environment: dependencies: firebase_auth: ^7.0.0 firebase_ui_oauth: ^3.0.0 + vector_graphics_compiler: ^1.1.19 flutter: sdk: flutter @@ -29,34 +30,12 @@ false_secrets: # The following section is specific to Flutter packages. flutter: - - # To add assets to your package, add an assets section, like this: - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg - # - # For details regarding assets in packages, see - # https://flutter.dev/assets-and-images/#from-packages - # - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/assets-and-images/#resolution-aware - - # To add custom fonts to your package, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # - # For details regarding fonts in packages, see - # https://flutter.dev/custom-fonts/#from-packages + # SVG icons are compiled to the vector_graphics binary format at build + # time, so the output always matches the app's resolved codec version. + assets: + - path: assets/icons/apple_light.svg + transformers: + - package: vector_graphics_compiler + - path: assets/icons/apple_dark.svg + transformers: + - package: vector_graphics_compiler diff --git a/packages/firebase_ui_oauth_facebook/assets/icons/facebook.svg b/packages/firebase_ui_oauth_facebook/assets/icons/facebook.svg new file mode 100644 index 00000000..2faee6f3 --- /dev/null +++ b/packages/firebase_ui_oauth_facebook/assets/icons/facebook.svg @@ -0,0 +1,7 @@ + + + f_logo_RGB-White_1024 + + + + diff --git a/packages/firebase_ui_oauth_facebook/lib/src/theme.dart b/packages/firebase_ui_oauth_facebook/lib/src/theme.dart index a7106c63..4381a82d 100644 --- a/packages/firebase_ui_oauth_facebook/lib/src/theme.dart +++ b/packages/firebase_ui_oauth_facebook/lib/src/theme.dart @@ -11,16 +11,8 @@ const _facebookWhite = Color(0xffffffff); const _backgroundColor = ThemedColor(_facebookBlue, _facebookBlue); const _color = ThemedColor(_facebookWhite, _facebookWhite); -const _iconSvg = ''' - - f_logo_RGB-White_1024 - - - - -'''; - -const _iconSrc = ThemedIconSrc(_iconSvg, _iconSvg); +const _iconAsset = 'assets/icons/facebook.svg'; +const _iconSrc = ThemedIconSrc(_iconAsset, _iconAsset); class FacebookProviderButtonStyle extends ThemedOAuthProviderButtonStyle { const FacebookProviderButtonStyle(); diff --git a/packages/firebase_ui_oauth_facebook/pubspec.yaml b/packages/firebase_ui_oauth_facebook/pubspec.yaml index 04f8dc87..6daa870d 100644 --- a/packages/firebase_ui_oauth_facebook/pubspec.yaml +++ b/packages/firebase_ui_oauth_facebook/pubspec.yaml @@ -11,6 +11,7 @@ environment: dependencies: firebase_auth: ^7.0.0 firebase_ui_oauth: ^3.0.0 + vector_graphics_compiler: ^1.1.19 flutter: sdk: flutter flutter_facebook_auth: ^7.1.2 @@ -32,34 +33,9 @@ false_secrets: # The following section is specific to Flutter packages. flutter: - - # To add assets to your package, add an assets section, like this: - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg - # - # For details regarding assets in packages, see - # https://flutter.dev/assets-and-images/#from-packages - # - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/assets-and-images/#resolution-aware - - # To add custom fonts to your package, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # - # For details regarding fonts in packages, see - # https://flutter.dev/custom-fonts/#from-packages + # SVG icons are compiled to the vector_graphics binary format at build + # time, so the output always matches the app's resolved codec version. + assets: + - path: assets/icons/facebook.svg + transformers: + - package: vector_graphics_compiler diff --git a/packages/firebase_ui_oauth_google/assets/google_icon.svg b/packages/firebase_ui_oauth_google/assets/icons/google.svg similarity index 99% rename from packages/firebase_ui_oauth_google/assets/google_icon.svg rename to packages/firebase_ui_oauth_google/assets/icons/google.svg index 50d9b896..1033f528 100644 --- a/packages/firebase_ui_oauth_google/assets/google_icon.svg +++ b/packages/firebase_ui_oauth_google/assets/icons/google.svg @@ -1,4 +1,3 @@ - diff --git a/packages/firebase_ui_oauth_google/lib/src/theme.dart b/packages/firebase_ui_oauth_google/lib/src/theme.dart index 70be751f..31e7ffe5 100644 --- a/packages/firebase_ui_oauth_google/lib/src/theme.dart +++ b/packages/firebase_ui_oauth_google/lib/src/theme.dart @@ -13,24 +13,8 @@ const _backgroundColor = ThemedColor(_googleBlue, _googleWhite); const _color = ThemedColor(_googleWhite, _googleDark); const _iconBackgroundColor = ThemedColor(_googleWhite, _googleWhite); -const _iconSvg = ''' - - - - - - - - - - - - - - -'''; - -const _iconSrc = ThemedIconSrc(_iconSvg, _iconSvg); +const _iconAsset = 'assets/icons/google.svg'; +const _iconSrc = ThemedIconSrc(_iconAsset, _iconAsset); class GoogleProviderButtonStyle extends ThemedOAuthProviderButtonStyle { const GoogleProviderButtonStyle(); diff --git a/packages/firebase_ui_oauth_google/pubspec.yaml b/packages/firebase_ui_oauth_google/pubspec.yaml index 015a2bba..f52b1ece 100644 --- a/packages/firebase_ui_oauth_google/pubspec.yaml +++ b/packages/firebase_ui_oauth_google/pubspec.yaml @@ -11,6 +11,7 @@ environment: dependencies: firebase_auth: ^7.0.0 firebase_ui_oauth: ^3.0.0 + vector_graphics_compiler: ^1.1.19 flutter: sdk: flutter google_sign_in: ^7.1.0 @@ -26,3 +27,9 @@ false_secrets: - "/example/**/GoogleService-Info.plist" flutter: + # SVG icons are compiled to the vector_graphics binary format at build + # time, so the output always matches the app's resolved codec version. + assets: + - path: assets/icons/google.svg + transformers: + - package: vector_graphics_compiler diff --git a/packages/firebase_ui_oauth_twitter/assets/icons/twitter.svg b/packages/firebase_ui_oauth_twitter/assets/icons/twitter.svg new file mode 100644 index 00000000..72d0f680 --- /dev/null +++ b/packages/firebase_ui_oauth_twitter/assets/icons/twitter.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/packages/firebase_ui_oauth_twitter/lib/src/theme.dart b/packages/firebase_ui_oauth_twitter/lib/src/theme.dart index 08c42879..cb686148 100644 --- a/packages/firebase_ui_oauth_twitter/lib/src/theme.dart +++ b/packages/firebase_ui_oauth_twitter/lib/src/theme.dart @@ -11,17 +11,8 @@ const _twitterWhite = Color(0xffffffff); const _backgroundColor = ThemedColor(_twitterBlue, _twitterBlue); const _color = ThemedColor(_twitterWhite, _twitterWhite); -const _iconSvg = ''' - - - - - - - -'''; - -const _iconSrc = ThemedIconSrc(_iconSvg, _iconSvg); +const _iconAsset = 'assets/icons/twitter.svg'; +const _iconSrc = ThemedIconSrc(_iconAsset, _iconAsset); class TwitterProviderButtonStyle extends ThemedOAuthProviderButtonStyle { const TwitterProviderButtonStyle(); diff --git a/packages/firebase_ui_oauth_twitter/pubspec.yaml b/packages/firebase_ui_oauth_twitter/pubspec.yaml index d4d93ce7..bf9dca07 100644 --- a/packages/firebase_ui_oauth_twitter/pubspec.yaml +++ b/packages/firebase_ui_oauth_twitter/pubspec.yaml @@ -13,6 +13,7 @@ dependencies: sdk: flutter firebase_auth: ^7.0.0 firebase_ui_oauth: ^3.0.0 + vector_graphics_compiler: ^1.1.19 dev_dependencies: flutter_test: @@ -29,34 +30,9 @@ false_secrets: # The following section is specific to Flutter packages. flutter: - - # To add assets to your package, add an assets section, like this: - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg - # - # For details regarding assets in packages, see - # https://flutter.dev/assets-and-images/#from-packages - # - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/assets-and-images/#resolution-aware - - # To add custom fonts to your package, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # - # For details regarding fonts in packages, see - # https://flutter.dev/custom-fonts/#from-packages + # SVG icons are compiled to the vector_graphics binary format at build + # time, so the output always matches the app's resolved codec version. + assets: + - path: assets/icons/twitter.svg + transformers: + - package: vector_graphics_compiler