scoped-model

Flutter Error: Could not find the correct ScopedModel

落花浮王杯 提交于 2020-01-03 15:34:06
问题 I am trying to create a scopedmodel in my flutter project and I can't seem to figure out why I get the error. What is wrong in this scopedmodel implementation? I have a home page with bottom navigator. Inside the profile tab, I fetch the list of followers which I need in a widget deep in the tree so I am trying to use scopedmodel. The model code is class RelationshipsModel extends Model { List<Relationship> relations; RelationshipsModel(this.relations); void add(String name) { relations.add

Flutter Using Multiple Models with Scoped Model

♀尐吖头ヾ 提交于 2019-12-11 02:47:57
问题 I'm trying to build an Expense tracker App in Flutter and has decided to use Scoped Model for state management. The App has a User who can have many Accounts and each account can have many Transactions. How do I model these to be used with Scoped Model, I am stuck on selecting a good Architecture. If I create a UserModel that has a list of Accounts where each Account is an AccountModel then triggering and update from inside AccountModel would not trigger the ones accessing the UserModel class

Flutter - Application Wide Notifications

我与影子孤独终老i 提交于 2019-12-08 03:40:01
问题 Is there a correct way to listen to a stream / scoped model from a 'root' page or location in a Flutter app and upon receiving some data display an appropriate notification (e.g. Snackbar) on any currently open page (may not be the home page)? I'd like to be able to display certain notifications across the entire application and not just on a page by page basis. Here I have a home page that's my apps initial page, it starts listening to a stream from a scoped_model retrieved from context and