mobx_codegen 0.0.8

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • new80

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

1.0.0 #

  • Initial version, created by Stagehand

example/README.md

MobX CodeGen examples #

Shows an example of using the MobX code generator. Note that you do need to run the build_runner command at the root of your flutter project.

pub run build_runner build

If you want to keep it running in the background as you make changes, use:

pub run build_runner watch

Use this package as a library

1. Depend on it

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


dependencies:
  mobx_codegen: ^0.0.8

2. Install it

You can install packages from the command line:

with pub:


$ pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:mobx_codegen/mobx_codegen.dart';
  
Version Uploaded Documentation Archive
0.0.8 Feb 12, 2019 Go to the documentation of mobx_codegen 0.0.8 Download mobx_codegen 0.0.8 archive
0.0.7 Feb 10, 2019 Go to the documentation of mobx_codegen 0.0.7 Download mobx_codegen 0.0.7 archive
0.0.6 Feb 7, 2019 Go to the documentation of mobx_codegen 0.0.6 Download mobx_codegen 0.0.6 archive
0.0.4 Jan 29, 2019 Go to the documentation of mobx_codegen 0.0.4 Download mobx_codegen 0.0.4 archive
0.0.3 Jan 27, 2019 Go to the documentation of mobx_codegen 0.0.3 Download mobx_codegen 0.0.3 archive
0.0.2 Jan 27, 2019 Go to the documentation of mobx_codegen 0.0.2 Download mobx_codegen 0.0.2 archive
0.0.1 Jan 27, 2019 Go to the documentation of mobx_codegen 0.0.1 Download mobx_codegen 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
64
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
80
Learn more about scoring.

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

  • Dart: 2.1.0
  • pana: 0.12.13

Platforms

Detected platforms: other

Primary library: package:mobx_codegen/mobx_codegen.dart with components: io, build, mirrors.

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0-dev <3.0.0
analyzer ^0.35.0 0.35.1
build ^1.1.0 1.1.1
mobx ^0.0.35 0.0.37
path ^1.4.1 1.6.2
source_gen ^0.9.4 0.9.4+1
Transitive dependencies
args 1.5.1
async 2.0.8
charcode 1.1.2
collection 1.14.11
convert 2.1.1
crypto 2.0.6
csslib 0.14.6
dart_style 1.2.3
front_end 0.1.11
glob 1.1.7
html 0.13.3+3
kernel 0.3.11
meta 1.1.7
package_config 1.0.5
plugin 0.2.0+3
pub_semver 1.4.2
source_span 1.5.4
string_scanner 1.0.4
term_glyph 1.1.0
typed_data 1.1.6
utf 0.9.0+5
watcher 0.9.7+10
yaml 2.1.15
Dev dependencies
build_runner ^1.2.5
build_test ^0.10.5
logging ^0.11.3 0.11.3+2
mockito ^4.0.0
test ^1.0.0
test_coverage ^0.2.0