-
Notifications
You must be signed in to change notification settings - Fork 20
Home
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.
Instead of declaring
package
name separately for each group, spider now takespackage
key-value pair as a global configuration.
Widget build(BuildContext context) {
return Image(image: AssetImage('assets/background.png'));
}
Widget build(BuildContext context) {
return Image(image: AssetImage(Assets.background));
}
class Assets {
static const String background = 'assets/background.png';
}
This method allows no error scope for string typos. Also, it provides auto-complete in the IDE which comes very handy when you have large amount of assets.
This is package is an independent library that is not linked to your project. So there's no need to add it to your flutter project as it works as a global command line tool for all of your projects.
pub global activate spider
Run following command to see help:
spider --help
See Basic Usage page for more information on how to use.
Show some love and support by starring the repository.
Or You can
Copyright © 2020 Birju Vachhani
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.