do2Init

A library for Dart developers.

Usage

A simple usage example:

import 'dart:async';
import 'package:do2init/do2init.dart';

class Module implements Do2Loader {

  String name;

  bool get isLoadWait => true;
  bool get isUnloadWait => true;

  Module(String this.name);

  void loading(Completer completer) {
    completer.complete('loading modul: $name');
  }

  void unloading(Completer completer) {
    completer.complete('unloading modul: $name');
  }

}
main() {
  Module mod1 = new Module('First');
  Module mod2 = new Module('Second');
  
  Future complete = Do2Init.loading([mod1, mod2], progress: (int value, int max, dynamic result) {
    print('Load:${value.toString()} max:${max.toString()} result:${result.toString()}');
  });
  
  complete.then((value) => print('load completed! result: ${value.toString()}'));
  complete.then((value) => Do2Init.unloading([mod1, mod2, mod3], progress: (int value, int max, dynamic result) {
    print('Load:${value.toString()} max:${max.toString()} result:${result.toString()}');
  }).then((value) => print('Unload completed! result: ${value.toString()}')));
}

Features and bugs

Please file feature requests and bugs at the issue tracker.

Libraries

do2init