Questions tagged [flutter-state]

369 questions
0
votes
1 answer

Flutter: Showdialog not able to access the provider from context

How to pass the context to the show dialog in flutter. I am trying to get hold of the provider in the dialog. It's giving me following error. Works fine on the line outside of the dialog body. Error: The following ProviderNotFoundException was…
RV.
  • 2,781
  • 3
  • 29
  • 46
0
votes
1 answer

flutter change setStateicon of that particular box which I click

I want to change icon of that specific box in a loop that I click. I have two icons that have onTap functionality. and on click user add to fav list and when the response id success and add to fav then the box fav icon changed. but in my case after…
0
votes
1 answer

Flutter test finder doesn't find my stateful widget

I am following this tutorial https://docs.flutter.dev/development/ui/interactive#the-parent-widget-manages-the-widgets-state and I have the following in main.dart: void main() => runApp(const MyApp()); class MyApp extends StatelessWidget { const…
0
votes
2 answers

when a user logout and login old date in provider stay and not get update

when a user signout the app and then signup as a new/different user then in the category screen old records are stored on the screen, it is cleared automatically when the app is restarted, however. is there any solution for that? here is the…
0
votes
1 answer

setState not updating the value in the screen using Flutter desktop

So I'm trying to update the value of the drop down list using the setState, but when I select a value from the list, the value on the screen won't be able to change import 'package:demo_app_admin/Custom/custom_Font.dart'; import…
0
votes
2 answers

Flutter - change locale and persisting with Provider

I am really out of options here. I am currently trying to have an option in my settings that enable the user to change language on a Button tap with Provider. Changing the language currently works just fine, but it is not persisted, because I am…
0
votes
1 answer

Dynamically added widget state is null in Flutter

I am developing a feature where users can press a button to add a new group of text fields to the screen. Each group of text fields is stored in its own stateful widget. The abridged code to add the new widget is shown below: List
0
votes
0 answers

Share a value of variable in flutter web app between two browser

I develop a web app with flutter. I want to share variable between two browser at the same system. I mean when I run project on chrome (i.e. http://localhost:58284) and I increment a counter value, then i open (http://localhost:58284/#/) in firefox…
Reza M
  • 544
  • 3
  • 10
0
votes
2 answers

How to send the fetched data everytime to some other widget in Flutter

Wanted to pass the updated values of fetchedEntriesInApp to PasswdList widget everytime it loads. Below is my code. main.dart Future fetchEntries() async { var fetchedEntries = []; var db = FirebaseFirestore.instance; final res = await…
tr1via
  • 51
  • 2
  • 7
0
votes
1 answer

dispose() is called when using AutomaticKeepAliveClientMixin

I am under the impression that using AutomaticKeepAliveClientMixin would prevent the states dispose() callback from being called when the Widget isn't visible anymore. However, I have a situation where dispose() and initState() get called every time…
Magnus
  • 17,157
  • 19
  • 104
  • 189
0
votes
1 answer

A document path must be a non-empty string, Flutter - Firebase error?

I have some mistakes with flutter and firebase, if someone can help would be great here is my auth controller class AuthController extends GetxController { final FirebaseAuth auth = FirebaseAuth.instance; final Rxn _firebaseUser =…
0
votes
1 answer

my list in flutter is not updating the problem in my code

hello I'm trying to update a list from another file and I imported it with its function but for some reason, it's not correct I'll show you the code import 'package:flutter/material.dart'; class Data { List list = [ '0', '1','3', …
0
votes
1 answer

Pushing a value to a StreamProvider?

I have a Stream object that is a listener of a signed in user from a database reference (Firestore). I'm using it in a StreamProvider so that my app can listen to signals for users signing in or out. There's a specific event that (email verified)…
user6118986
  • 341
  • 2
  • 15
0
votes
1 answer

Conditional widget is not working or changing after data load in Flutter

I am just writing a simple application using flutter. I came across a situation where I need to display widgets conditionally. I am fetching data using app script API from Google Sheets. I want to show the "Loading..." text during loading and want…
M B Parvez
  • 808
  • 6
  • 16
0
votes
1 answer

Flutter - Getx Value updates only after hot reload

Consider the following code class HomeScreen extends StatelessWidget { const HomeScreen({Key? key}) : super(key: key); @override Widget build(BuildContext context) { return GetBuilder( init: HomeController(), …
Febin Johnson
  • 277
  • 1
  • 6
  • 21