r_flutter 0.1.0 copy "r_flutter: ^0.1.0" to clipboard
r_flutter: ^0.1.0 copied to clipboard

outdated

Generate constants for resources which require using them as a String like fonts and assets.

R.Flutter #

Generate constants for resources which require using them as a String like fonts and assets.

Images

Instead of writing:

Image(image: AssetImage("assets/path/to/image.png"))

you can write:

Image(image: Images.image)
Fonts

Instead of writing:

TextStyle(
    fontFamily: "Roboto",
)

you can write:

TextStyle(
    fontFamily: Fonts.roboto,
)
Fonts

Instead of writing:

await rootBundle.loadString("assets/path/to/data.json")

you can write:

await rootBundle.loadString(Assets.data)

Generate code #

flutter packages pub run r_flutter:generate

Optional Parameters:

pubspec-file (pubspec.yaml)

Specify the pubspec file of the project

ignore-assets

Specify asset folder which should be ignored for generating constants. Seperated by ","

intl-file

Specify intl arb file to generate bindings for.

output-file (lib/r.g.dart)

Specify the output file.

20
likes
0
pub points
66%
popularity

Publisher

unverified uploader

Generate constants for resources which require using them as a String like fonts and assets.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

analyzer, args, dart_style, path, recase, yaml

More

Packages that depend on r_flutter