A Flutter library that allow you to easily pass a data Model from a parent Widget down to its descendants. In addition, it also rebuilds all of the children that use the model when the model is updated.
Questions tagged [scoped-model]
47 questions
1
vote
1 answer
How to route to page, without removing BottomNavigationBar in flutter?
I'm creating my first app in flutter, and i'm having issues with state management. I have a MainPage.dart with BottomNavigationBar, and body: with tabPages[MainTab, ...]. In the MainTab i have a ListView, and when i click ListView item, it should…

Данияр
- 91
- 1
- 10
1
vote
1 answer
Flutter / Dart using Scoped Model with descendants and Navigator
I've been struggling with this one since yesterday - I'm creating new ScopedModel obj in tab controller (ScreenTabs), and then passing it to multiple tabs in BottomNavigationBar (1st level descendants, for example: ScreenBook) by wrapping each tab…

Matt
- 665
- 6
- 16
1
vote
1 answer
Flutter restarts state of TextField when keyboard is shown and then gone
So I'm working on a TextField with scoped_model. I moved the controller to the Model class, and I'm trying to change the state of a Text with the text the user inputs on said TextField. But when I close the keyboard, the state changes and the…

herrmartell
- 3,057
- 4
- 18
- 27
1
vote
0 answers
How to use scoped_model with Navigator?
I am use scoped_model for manage app state.
I have AuthModel for auth state. When user log in I change screen in AuthModel:
Widget screen = LoadScreen();
if (loggedIn == true) {
screen = HomeScreen;
} else if (loggedIn == false) {
…

FlutterFirebase
- 2,163
- 6
- 28
- 60
1
vote
1 answer
How to get access scoped-model models
I am trying to get access to my models at _buildProductCard widget:
Widget build(BuildContext context) {
return ScopedModelDescendant(
builder:
(BuildContext context, Widget child, ConnectedProductModel…

Michael
- 583
- 4
- 13
1
vote
1 answer
Scoped Model initialized when Key Board is popped up for TextField
I have two tabs with a Default Tab bar. I have used Scoped-model for passing data between two tabs. When I insert data in one tab and press text Field again so that keyboard pops up but whole model gets reinitialized.
I have tried…

Yunus
- 405
- 5
- 18
1
vote
0 answers
Sqflite in Scoped Models
I use Scoped models plugin in my project and I don't know how to save and get if table is not empty from db Sqflite. please help me.
Here is some code in databse
addUser(UserModel user) async{
final db = await database;
var table = await…

Azamat Ahunjanov
- 356
- 2
- 15
1
vote
1 answer
Flutter Scoped Model - Passing multiple Models
I've been playing with Scoped Model recently and was wondering if there's a better way to push multiple models onto the tree for use by children.
Suppose I have a 'AppModel' that's a composition of all the Models I need
class AppModel extends…

user6635665
- 337
- 3
- 15
1
vote
0 answers
Master-detail using Flutter scoped model
I am developing an app which has one screen showing a list of items, and when the user taps on one item another screen opens up which displays the details of the tapped item.
I'm using the Scoped Model architecture, so the screens are…

Magnus
- 17,157
- 19
- 104
- 189
1
vote
1 answer
Flutter - Running animation from scoped model
My app contains a couple of pages. In the appbar I have a selfmade stateful widget with a badge that shows the number of new messages. When I swipe to refresh data the badge will run a small animation if the badge value is changed.
The problem is…

user1295782
- 61
- 4
1
vote
1 answer
Flutter scoped model with multiple classes
I am new to flutter and I wanted to manage a login screen page that has one text field and when the user click next I save the value and change the hint text to the next step hint on the same text field using scoped model state management.
first…

Mahmoud Mabrouk
- 703
- 2
- 13
- 31
1
vote
1 answer
Dart Flutter : How to run animation from a scoped-model?
How to run animation in a widget which is a ScopedModeldescendant, from the scoped-model. I have a red button here which when clicked shows a square. The square is made to disappear after 3 seconds, which happens to quickly. What I want to do is…

Ant D
- 2,481
- 6
- 18
- 34
0
votes
1 answer
OpenContainer with Scoped Model not working?
Since scoped model has its own scope, it seems it breaks the usage of OpenContainer with the default provided code. It gets a cannot find scope error when this is there:
OpenContainer(
transitionType:…

Jiehfeng
- 753
- 7
- 16
0
votes
1 answer
Mockito and ScopedModel
I'm trying to fix a test since I have implemented ScopedModelDescendant to get data to fill up my page with information for the user.
The issue I'm facing is that it seems I can not mock ScopedModel with mockito. Somehow is asking me to specify some…

Matias
- 708
- 10
- 24
0
votes
2 answers
Flutter: scoped model access in StatefulWidget
I have scoped model lib/scoped_models/main.dart:
import 'package:scoped_model/scoped_model.dart';
class MainModel extends Model {
int _count = 0;
int get count {
return _count;
}
void incrementCount() {
_count += 1;
…

mr.boris
- 3,667
- 8
- 37
- 70