Skip to content

Banner

Spider

A small dart command-line tool 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.

Build spider

Breaking Changes since v4.0.0:

  • --info flag command is now --about command.
  • --check-updates flag command is now --check-for-updates.

What it does?

Spider generates references for the local assets used in your project by creating dart referece classes which are safe and easy to use anywhere.

Example

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';
}

Why Spider?

  • Lightening fast code generation.
  • Safe access to assets. No more typos!
  • IDE auto-complete support.
  • No dependecy on the project.
  • Easy to configure.
  • Way more customizable.
  • Supports tests generation.
  • Less VCS noise.
  • Import friendly (exportable as library).
  • Well documented.

Sounds interesting?

Head over to Getting Started guide and try out the power of Spider.

Liked spider?

Show some love and support by starring the repository.

Or You can

Buy Me A Coffee

License

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.