mobx_codegen 0.0.4 copy "mobx_codegen: ^0.0.4" to clipboard
mobx_codegen: ^0.0.4 copied to clipboard

outdated

Code generator for MobX that adds support for annotating your code with @observable, @computed, @action and also creating Store classes.

mobx_codegen #

pub package Build Status

MobX Code Generation library

Adds support for annotating your MobX code with @observable, @computed, @action, making it super simple to use MobX.

Note that these annotations only work inside store-classes.

store-classes are abstract and implement the Store interface. When you run the build_runner, it will automatically generate the *.g.dart file that must be imported in your file.

$> cd $YOUR_PROJECT_DIR
$> flutter packages pub run build_runner build

Example #

import 'package:mobx/mobx.dart';

// Include generated file
part 'todos.g.dart';

// This is the class used by rest of your codebase
class Todo = TodoBase with _$Todo;

// The store-class
abstract class TodoBase implements Store {
  TodoBase(this.description);

  @observable
  String description = '';

  @observable
  bool done = false;
}
282
likes
0
pub points
97%
popularity

Publisher

verified publisherdart.pixelingene.com

Code generator for MobX that adds support for annotating your code with @observable, @computed, @action and also creating Store classes.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

analyzer, build, mobx, path, source_gen

More

Packages that depend on mobx_codegen