Questions tagged [flutter-state]

369 questions
0
votes
0 answers

Flutter - Inserting a new widget into the middle of a list of widgets steals the state

This is a bit difficult for me to explain Idk if this is a bug but I have this list of stateful widgets which are a bunch of large input forms, a new form can be created and inserted into the list using a button that exists on each individual form…
Ahmed
  • 43
  • 7
0
votes
0 answers

TypeAheadFormField with AutoValidateMode OnUserInteraction

I'm trying to use the AutovalidateMode with the TypeAheadFormField (pub.dev > flutter_typeahead). I tried to change line 34 on typeahead_form_field.dart to AutovalidateMode autovalidateMode = AutovalidateMode.onUserInteraction, it did not work. Then…
0
votes
1 answer

How to fetch value from a state and use it in a function in flutter bloc?

How can i fetch value from a state and use it in a function in bloc? I have this events on((getUserEmail)); // gets value from textfield on onchanged on((getUserPassWord)); // gets value from textfield on…
Febin Johnson
  • 277
  • 1
  • 6
  • 21
0
votes
2 answers

State is reassociated after disposed() rather than create a new one

I have app with a simple login system based in named routes and Navigator. When login is successful, the loggin route si pop from stack and the first route (home) is pushed, using Navigator.popAndPushNamed,'/first'). When the user is logged the…
0
votes
1 answer

how can I create an animated button that changes its child widget when I click on it by animating?

I want to make an animated button that changes its child widget by animating. I did make the animation and I did change the widget by animating but my problem is that it does not update the widget on time, you should call it once again to show the…
0
votes
1 answer

Flutter Getx. Listening to the list in Obx error. How to fix it?

I updated the list in listview with Provider in Flutter. Now I'm trying to do the same with Getx. I am getting an error. I will show the code example below. I couldn't find anything on the Internet about this. I would be very happy if you help. In…
Kerimoff
  • 25
  • 7
0
votes
2 answers

What is the alternative to notifylistners() in flutter_bloc?

I am new to flutter_bloc and need some clarity. I am developing an app similar to TikTok, that has a PageView with VideoPlayers. I want to toggle Like, Save, and Follow buttons on the screen. The parent widget is wrapped in FeedBloc BlocBuilder…
Prerak
  • 55
  • 1
  • 1
  • 6
0
votes
1 answer

Passing dynamic initial value to riverpod provider

I have a usecase as follow: a screen with initial filter object, this screen is used multiple times with different filter configuration, what I need to achieve is to pass an initial different filter object for each instance from this screen to…
Amr
  • 148
  • 7
0
votes
2 answers

How does dirty property of the Flutter state work?

Could you please explain to me at what point during the build the property of dirty changes its value? Now I will explain what I mean: When we call setState() during the build, we will not see any effect - setState() will not work. If we fall into…
0
votes
2 answers

Flutter TextField\TextFormField initialization value with flutter_bloc

I do not know English well, so I will hope for a translator) P.S I am new to the world of flutter and dart, I am a .net and angular developer. In my application, I refuse to use StatefullWidget in favor of Flutter_Bloc, so if I need to change the…
0
votes
1 answer

clear state of provider when logout

I'm using provider to fetch current user's data from firebase. in the UI I have 2 types of users and the UI should change based on that value. the problem is when I login with a type 1 user. then logout and login with a type 2 user I get the UI…
0
votes
2 answers

Keeping state between pages in flutter

I need help managing state between pages.. In the first page I update my map to change a value. When I print this value it works but in my other page the value is still the first value I gave.. How can I do to keep this value even in my second…
Coca95
  • 31
  • 5
0
votes
1 answer

Why is my Provider not updating my index? in my second widget?

I'm using Riverpod to try and update the index in two different widget, it works fine in the first one but nothing happen in the second one, can someone explain me why? It looks like the second widget doesn't not change/receive the info of the index…
0
votes
3 answers

FormKey makes error 'Null check operator used on a null value'

This is a block of flutter code to generate qr code using textformfield and a elevatedbutton, validation keeps failing and gives error 'Null check operator used on a null value'. I'm using a formKey to check whether it's valid to submit or not. How…
0
votes
1 answer

How can I build a list of elements from a provider that fetches the data from somewhere and refereshes when the provider changes?

Hello I'm having a lot of trouble understanding how to use providers when fetching data. Lets say I have an http service that fetches the data and updates a list: my_provider.dart: class InventoryProvider extends ChangeNotifier { List _items…
nck
  • 1,673
  • 16
  • 40