Flutter Homebrew



  1. Flutter Homebrew Software
  2. Flutter Homebrew Download
  3. Flutter Homebrew
  4. Flutter Homebrew Free
  5. Flutter Homebrew Tutorial

The Flutter code generator for your assets, fonts, colors, … — Get rid of all String-based APIs.

Inspired by SwiftGen.

  1. Homebrew’s package index. Name: Flutter SDK UI toolkit for building applications for mobile, web and desktop.
  2. The official way to install the flutter and its dependencies is a mishmash of brew install, binary downloads alongside relying on system installed versions of ruby. I became particularly frustrated when trying to setup flutter on macOS Mojave and macOS Catalina.

For iOS you need to use homebrew to install some additional libraries. I’m personally in favor of the idea of installing Flutter via homebrew in a single command; there is an issue opened for this.

Motivation #

Using asset path string directly is not safe.

Bad
What would happen if you made a typo?

⭕️ Good
We want to use it safely.

Installation #

Homebrew #

Works with MacOS and Linux.

Pub Global #

Works with MacOS, Linux and Windows.

You might need to set up your path.

As a part of build_runner #

  1. Add build_runner and FlutterGen to your package's pubspec.yaml file:
  1. Install FlutterGen
  1. Use FlutterGen

Usage #

Run fluttergen after the configuration pubspec.yaml.

Configuration file #

FlutterGen generates dart files based on the key flutter and flutter_gen of pubspec.yaml.
Default configuration can be found here.

Available Parsers #

Assets #

Just follow the doc Adding assets and images#Specifying assets to specify assets, then FlutterGen will generate related dart files.
No other specific configuration is required.
Ignore duplicated.

These configurations will generate assets.gen.dart under the lib/gen/ directory by default.

Usage Example

FlutterGen generates Image class if the asset is Flutter supported image format.

Example results of assets/images/chip.jpg:

  • Assets.images.chip is an implementation of AssetImage class.
  • Assets.images.chip.image(...) returns Image class.
  • Assets.images.chip.path just returns the path string.

If you are using SVG images with flutter_svg you can use the integration feature.

Flutter homebrew game

Available Integrations

Flutter Homebrew

Flutter Homebrew Software

PackagesFile extensionSettingUsage
flutter_svg.svgflutter_svg: trueAssets.images.icons.paint.svg()
flare_flutter.flrflare_flutter: trueAssets.flare.penguin.flare()

<br/>

In other cases, the asset is generated as String class.

FlutterGen also support generating other style of Assets class:

The root directory will be omitted if it is either assets or asset.

Flutter Homebrew Download

Example of code generated by FlutterGen

Fonts #

Just follow the doc Use a custom font to specify fonts, then FlutterGen will generate related dart files.
No other specific configuration is required.
Ignore duplicated.

These configurations will generate fonts.gen.dart under the lib/gen/ directory by default.

Homebrew

Usage Example

Example of code generated by FlutterGen

Colors #

FlutterGen supports generating colors from XML format files.
Ignore duplicated.

FlutterGen can generate a Color class based on the name attribute and the color hex value.If the element has the attribute type, then a specially color will be generated.

Currently supported special color types:

Noticed that there is no official material color generation algorithm. The implementation is based on the mcg project.

These configurations will generate colors.gen.dart under the lib/gen/ directory by default.

Usage Example

Example of code generated by FlutterGen

Default Configuration #

The following are the default settings.The options you set in pubspec.yaml will override the corresponding default options.

Homebrew

Flutter Homebrew

Credits #

The material color generation implementation is based on mcg and TinyColor.

Flutter Homebrew Free

Issues #

Please file FlutterGen specific issues, bugs, or feature requests in our issue tracker.

Plugin issues that are not specific to FlutterGen can be filed in the Flutter issue tracker.

Contributing #

We are looking for co-developers.

Flutter Homebrew Tutorial

If you wish to contribute a change to any of the existing plugins in this repo,please review our contribution guideand open a pull request.