flutter-provider Questions

2

Solved

I'm new to flutter and I'm trying to create an app with provider. I wrapped MaterialApp widget with the ChangeNotifierProvider and the app works and I can use the provider as it intended to do. I n...
Sol asked 28/8, 2019 at 11:37

4

Solved

I can't wrap my head around using multiple consumers for a single widget with provider? Suppose my widget is CurvedNavigationBar and I have 4 items in that widget. I also have 4 different classes t...
Torgerson asked 23/1, 2020 at 17:26

8

Solved

In Flutter, for importing libraries within our own package's lib directory, should we use relative imports import 'foo.dart' or package import? import 'package:my_app/lib/src/foo.dart' Dart ...
Heeled asked 11/1, 2020 at 9:34

7

Solved

I am refactoring my Flutter application code by adding Provider as a state management. Desired behavior: When Home screen opens, app should check if users email verified, if it's not then should ...

9

Solved

I have a problem using Flutter Provider... My flow is like this: After login user id is passed to new widget -> from there it preforms save to db and then it redirects to new widget (Dashboard). A...
Nikitanikki asked 20/7, 2019 at 11:25

9

Solved

I'm still wrapping my head around state-management techniques in flutter and am a bit confused about when and why to use Provider.of<X> vs. Consumer<X>. I understand (I think) from the ...
Downing asked 8/11, 2019 at 22:2

3

Solved

I'm getting this error message: Unhandled Exception: A ModeManager was used after being disposed. I'm using ChangeNotifier (class ModeManager) together with ChangeNotifierProvider. Build method, w...
Bromleigh asked 14/9, 2020 at 12:46

2

Solved

After I added the dependency of ProfileLogic to LocationLogic I get the following error when the app starts: I/flutter (14674): A LocationLogic was used after being disposed. I/flutter (14674): On...
Lamelliform asked 17/11, 2019 at 1:5

4

Solved

I am using Provider. I have got two classes: class TenderApiData {} it's stand alone class (not widget). How I can write accesstoken to AppState? class AppState extends ChangeNotifier // putted to...
Gentry asked 8/8, 2019 at 15:3

3

Solved

This week I've began developing in flutter and i'm not able to solve this problem. I'm building a login page that calls an API to login and after redirects to an homepage. This is the exception ge...
Architect asked 20/9, 2019 at 14:30

5

So I’m a little confused about how to port an application using setstate to provider. Let’s say I have a person model which extends provider. Now I also want to have multiple person reports. Each r...
Yvonneyvonner asked 28/5, 2021 at 17:53

5

Solved

Searching for Dependency Injection solutions for Flutter, I found two awesome libraries: provider and get_it. As far as I can see, provider has more boilerplate, but it fits really nicely with Flut...

2

Solved

Sometimes I think I'm getting the logic of providers and then I get stumped for hours trying to do something like below. I need to get a List of connection id's from a firestore collectionsstream. ...

2

I'm using socket_io_client v0.9.12 in my flutter app (still not using null safety). I am creating a socket connection with my back-end server when the app starts and allow child widgets to access i...
Anglice asked 1/7, 2021 at 18:25

4

I need pass provider (Model2) from homepage to Page2 so when user go back to homepage (onWillPop) I can make API call from provider (Model2) and update homepage. But when I call _onPaidBackPress(c...
Makings asked 21/8, 2019 at 19:22

4

I have implemented Provider for state management in my app. Now, I need to add some data in the class once the screen is loaded. How I can achieve this? stepInfo.addToList = new VaccStep(); // Ne...
Elohist asked 10/6, 2019 at 14:30

10

Solved

I have a FloatingActionButton inside a widget tree which has a BlocProvider from flutter_bloc. Something like this: BlocProvider( builder: (context) { SomeBloc someBloc = SomeBloc(); someBloc.d...
Chintzy asked 18/8, 2019 at 19:36

3

Solved

So, I'm using the auto_route package for navigation in my app and flutter_bloc for state management. When I was using the old Navigator, I could just wrap a route with a BlocProvider. For example: ...
Knudson asked 14/6, 2021 at 13:26

4

I use Provider to manage state in my Flutter demo. I want to animate my widget but it seems that AnimateController needs a sync parameter that comes from the state of a stateful widget. As far as...
Donnell asked 3/11, 2019 at 7:49

3

Solved

I want to load a list of events and display a loading indicator while fetching data. I'm trying Provider pattern (actually refactoring an existing application). So the event list display is condi...
Pug asked 17/12, 2019 at 16:22

4

Solved

I have a widget that makes a request to an api which returns a map. What I would like to do is not make the same request every time the widget is loaded and save the list to appState.myList. But. w...
Teletypewriter asked 29/5, 2019 at 11:2

4

I am extract some logic from Stateful Widget to Provider with ChangeNotifier: class Model extends ChangeNotifier {...} In my Stateful Widget I have: if (mounted) { setState(() {}); } How I can ch...
Eirene asked 26/10, 2019 at 10:54

2

Solved

I just updated my flutter_bloc library to 6.1.1 in which states: bloc' is deprecated and shouldn't be used. Use context.read or context.watch instead. Will be removed in v7.0.0. Try replacing the ...
Rummer asked 13/11, 2020 at 11:38

6

Solved

I'm trying to implement Provider and it seems it works fine but I get this message: This _DefaultInheritedProviderScope widget cannot be marked as needing to build because the framework is alre...
Inexertion asked 25/3, 2020 at 16:19

2

Solved

Maybe I don't understand the purpose of BloC or Provider but I'm confused as to why we would ever want to use them instead of using Flutter's built-in state management using the Stateful widget. I'...
Choochoo asked 13/10, 2022 at 0:33

© 2022 - 2024 — McMap. All rights reserved.