action_box_generator 0.0.30 copy "action_box_generator: ^0.0.30" to clipboard
action_box_generator: ^0.0.30 copied to clipboard

Generate boilerplate code for using action_box package.

example/action_box_generator_example.dart

import 'package:action_box/action_box.dart';
//add
import 'action_box_generator_example.a.b.dart';

@ActionBoxConfig(
    // actionBoxType: 'ActionBox', //default value
    // actionRootType: 'ActionRoot',  //default value
    generateSourceDir: ['lib', 'example'])
final actionBox = ActionBox.shared();

//How to use
void main() {
  var bag = DisposeBag();
  actionBox((d) => d.ui.common.etc.e);
  actionBox((d) => d.ui.common.e);
  actionBox((d) => d.gateway.common.e);
  actionBox((d) => d.gateway.common.etc.c);
  //request data
  actionBox((root) => root.valueConverter.getStringInStringOutValue)
      .go(param: 'test', channel: (c) => c.exCh1);

  //subscribe result
  actionBox((d) => d.valueConverter.getStringInStringOutValue)
      .map(channel: (c) => c.exCh1 | c.exCh2)
      .listen((result) {
    print(result);
  }).disposedBy(bag);

  //call dispose method when completed
  //bag.dispose();
}
1
likes
125
points
100
downloads

Publisher

unverified uploader

Weekly Downloads

Generate boilerplate code for using action_box package.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

action_box, analyzer, build, code_builder, dart_style, glob, source_gen

More

Packages that depend on action_box_generator