powerflutter_code_generation 0.1.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 50

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 Flutter:

$ flutter pub get

Alternatively, your editor might support 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 Dec 11, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.6

Health suggestions

Format lib/codegeneration/builder.dart.

Run flutter format to format lib/codegeneration/builder.dart.


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.4+6
Transitive dependencies
_fe_analyzer_shared 1.0.1
analyzer 0.39.2+1
args 1.5.2
async 2.4.0
build 1.2.2
charcode 1.1.2
collection 1.14.11 1.14.12
convert 2.1.1
crypto 2.1.4
csslib 0.16.1
dart_style 1.3.3
glob 1.2.0
html 0.14.0+3
js 0.6.1+1
logging 0.11.3+2
meta 1.1.7 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.2
shared_preferences 0.5.4+8 0.5.6
shared_preferences_platform_interface 1.0.1
sky_engine 0.0.99
source_span 1.5.5
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