r_flutter 0.1.0

  • README.md
  • Installing
  • Versions
  • 47

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.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  r_flutter: ^0.1.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

Version Uploaded Documentation Archive
0.1.0 Jan 29, 2019 Go to the documentation of r_flutter 0.1.0 Download r_flutter 0.1.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
3
Health:
Code health derived from static analysis. [more]
98
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
47
Learn more about scoring.

We analyzed this package on Apr 12, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.2.0
  • pana: 0.12.14

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in libraries.

Health suggestions

Fix lib/src/generator/assets_generator.dart. (-1 points)

Analysis of lib/src/generator/assets_generator.dart reported 2 hints:

line 15 col 7: Use isEmpty instead of length

line 28 col 7: Use isEmpty instead of length

Fix bin/generate.dart. (-0.50 points)

Analysis of bin/generate.dart reported 1 hint:

line 2 col 8: Unused import: 'dart:convert'.

Fix lib/src/generator/fonts_generator.dart. (-0.50 points)

Analysis of lib/src/generator/fonts_generator.dart reported 1 hint:

line 5 col 7: Use isEmpty instead of length

Fix lib/src/parser/assets_parser.dart. (-0.50 points)

Analysis of lib/src/parser/assets_parser.dart reported 1 hint:

line 100 col 11: The value of the local variable 'first' isn't used.

Format lib/src/arguments.dart.

Run dartfmt to format lib/src/arguments.dart.

Maintenance issues and suggestions

Provide a file named CHANGELOG.md. (-20 points)

Changelog entries help developers follow the progress of your package. See the example generated by stagehand.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.33.0 <3.0.0
analyzer >=0.33.0-alpha.0 <0.34.0 0.33.6+1 0.36.0
args >=0.12.1 <2.0.0 1.5.1
dart_style ^1.0.0 1.2.0 1.2.7
path >=0.9.0 <2.0.0 1.6.2
recase ^2.0.1 2.0.1
yaml ^2.1.15 2.1.15
Transitive dependencies
async 2.2.0
charcode 1.1.2
collection 1.14.11
convert 2.1.1
crypto 2.0.6
csslib 0.15.0
front_end 0.1.6+9 0.1.15
glob 1.1.7
html 0.14.0+1
kernel 0.3.6+9 0.3.15
logging 0.11.3+2
meta 1.1.7
package_config 1.0.5
plugin 0.2.0+3
pub_semver 1.4.2
source_span 1.5.5
string_scanner 1.0.4
term_glyph 1.1.0
typed_data 1.1.6
watcher 0.9.7+10
Dev dependencies
test ^1.2.0