powerflutter_code_generation 0.1.1

Code Generation for Powerflutter for Models, Assets and more use as dev_dependency and add annotations to your code

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';

@powermodel
class _CounterModel with PowerModel {
  int counter = 0;
}

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

0
likes
70
pub points
0%
popularity

Code Generation for Powerflutter for Models, Assets and more use as dev_dependency and add annotations to your code

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

liongadev@googlemail.com

License

MIT (LICENSE)

Dependencies

flutter, powerflutter, source_gen

More

Packages that depend on powerflutter_code_generation