powerflutter_code_generation 0.1.1

powerflutter_code_generation #

Powerflutter Code Generation Library

Getting Started #

  1. Add powerflutter_code_generation to your dev_dependencies.
  2. Run flutter packages pub run build_runner watch in the terminal of the project
  3. Add Annotations to your code like @powermodel and the part 'filename.g.dart'; to the top of the file

Annotations #

@powermodel: Used on a private (start it with underscore _ ) model class a public class will be generated that inherits the private class and overrides every field with a setter and getter needed for Powerflutter databinding.

@ModelName("test") Used on a field of a @powermodel class sets the Name used in serialization etc. for this field

Example #

In the Powerflutter Examples we use the following simple model class:

import 'package:powerflutter/powerflutter.dart';

part 'counter.g.dart';

class _CounterModel with PowerModel {
  int counter = 0;

This will generate a CounterModel Class that has the Getters and Setters needed for Poweflutter.


inital release


Getting Started #

Examples and gettings Started Guides can be found in the Powerflutter Examples Repo.

Use this package as a library

1. Depend on it

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

  powerflutter_code_generation: ^0.1.1

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:

import 'package:powerflutter_code_generation/powerflutter_code_generation.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Feb 25, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5
  • Flutter: 1.12.13+hotfix.7

Health suggestions

Fix lib/codegeneration/builder.dart. (-1.99 points)

Analysis of lib/codegeneration/builder.dart reported 4 hints:

line 17 col 47: 'displayName' is deprecated and shouldn't be used. Use getDisplayString instead.

line 17 col 110: 'displayName' is deprecated and shouldn't be used. Use getDisplayString instead.

line 21 col 91: 'name' is deprecated and shouldn't be used. Check element, or use getDisplayString().

line 24 col 24: 'name' is deprecated and shouldn't be used. Check element, or use getDisplayString().

Maintenance issues and suggestions

No valid SDK. (-20 points)

The analysis could not detect a valid SDK that can use this package.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
powerflutter ^0.1.0 0.1.1+1
source_gen ^0.9.0 0.9.5
Transitive dependencies
_fe_analyzer_shared 1.0.3
analyzer 0.39.4
args 1.5.2
async 2.4.0
build 1.2.2
charcode 1.1.3
collection 1.14.11 1.14.12
convert 2.1.1
crypto 2.1.4
csslib 0.16.1
dart_style 1.3.3
flutter_web_plugins 0.0.0
glob 1.2.0
html 0.14.0+3
js 0.6.1+1
logging 0.11.4
meta 1.1.8
node_interop 1.0.3
node_io 1.0.1+2
package_config 1.1.0
path 1.6.4
pedantic 1.9.0
pub_semver 1.4.3
shared_preferences 0.5.6+2
shared_preferences_macos 0.0.1+6
shared_preferences_platform_interface 1.0.3
shared_preferences_web 0.1.2+4
sky_engine 0.0.99
source_span 1.6.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
uuid 2.0.4
vector_math 2.0.8
watcher 0.9.7+13
yaml 2.2.0
Dev dependencies
build_runner ^1.0.0