app_module.dart 697 B

1234567891011121314151617181920212223
  1. import 'package:mvvm_flutter/model/remote.dart';
  2. import 'package:mvvm_flutter/model/repository.dart';
  3. import 'package:mvvm_flutter/viewmodel/home_provide.dart';
  4. import 'dartin.dart';
  5. final viewModelModule = Module([
  6. factory<HomeProvide>(({params}) => HomeProvide(params.get(0), get<GithubRepo>())),
  7. ])
  8. ..addOthers(DartInScope('test'), [
  9. ///other scope
  10. // factory<HomeProvide>(({params}) => HomeProvide(params.get(0), get<GithubRepo>())),
  11. ]);
  12. final repoModule = Module([
  13. lazy<GithubRepo>(({params}) => GithubRepo(get<GithubService>())),
  14. ]);
  15. final remoteModule = Module([
  16. single<GithubService>(GithubService()),
  17. ]);
  18. final appModule = [viewModelModule, repoModule, remoteModule];