spider 0.1.0
spider: ^0.1.0 copied to clipboard
A small dart library to generate Assets dart code from assets folder. It generates dart class with static const variables in it which can be used to reference the assets safely anywhere in the flutter app.
example/EXAMPLE.md
Example #
Just use following command:
spider
Before
Widget build(BuildContext context) {
return Image(image: AssetImage('assets/background.png'));
}
After
Widget build(BuildContext context) {
return Image(image: AssetImage(Assets.background));
}
Generated Assets Class
class Assets {
static const String background = 'assets/background.png';
}