zubairehman / flutter_boilerplate_project

A boilerplate project created in flutter using MobX and Provider.
http://zubairehman.surge.sh/
MIT License
2.26k stars 905 forks source link

feature/mvi branch PostStore #127

Open dyardy opened 2 years ago

dyardy commented 2 years ago

There is no reason to using PostStore with Provider

i.e. i do not see any reason for the following within my_app.dart

Provider<PostStore>(create: (_) => _postStore),

PostStore is used within home.dart, where you can remove reference to Provider.of and just use a reference to the PostStore (mobx class) and reference it via getIt (that you registered in service_locator.dart)

  // _postStore = Provider.of<PostStore>(context);
  _postStore = getIt<PostStore>();