Skip to content

[flutter_svg] Proposal to add SvgPicture.precompiled constructor #177068

@nilsreichardt

Description

@nilsreichardt

flutter_svg allows precompiled SVG files, see Precompiling and Optimizing SVGs.

However, as a developer, you have to add three things to your code:

  1. Add vector_graphics as a direct dependency
  2. Add import 'package:vector_graphics/vector_graphics.dart'; import
  3. Use additionally the AssetBytesLoader class.

With SvgPicture.precompiled(String assetName, [...]) (open for better names) a developer of the package could use precompiled SVG files without the three steps above.

I'm happy to open a PR for that if the Flutter team is open for that.

Metadata

Metadata

Assignees

Labels

c: new featureNothing broken; request for a new capabilityc: new widgetMust also have "c: new feature". Request for a new widget.c: proposalA detailed proposal for a change to Flutterp: flutter_svgThe Flutter SVG drawing packagespackageflutter/packages repository. See also p: labels.team-engineOwned by Engine team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions