Questions tagged [flutter-state]

369 questions
2
votes
1 answer

Flutter Bottom Navigation Bar not switching screens

I am new to flutter and this is my first time implementing bottom navigation bar in one of my projects but I'm so confused why it doesn't let me switch screens. Somehow I can tap the icon but it doesn't switch the page while tapping. I got this code…
2
votes
1 answer

The following assertion was thrown while dispatching notifications for CV: setState() or markNeedsBuild() called during build

I used the Provider to take the value from the Text Form Field and store it via the Provider but I am getting an error that I could not solve at all. And this code Code of text_field import 'dart:ffi'; import 'dart:ui'; import…
2
votes
1 answer

Flutter: Radio and Switch buttons isn't updating inside a listview.builder, but it works outside

I'm using a form to create multiples vehicle entries. every time I click on the floating button it adds a vehicleform to the page one on top of the other. "A List type that receives widgets" If I try to select the "leased radio option", the form…
2
votes
1 answer

Data is showing only after hot reload

I'm new to flutter and amplify. I'm trying to do an app using flutter and amplify as backend. I want to retrieve data from three datastore table at once and put them in to a List>. I can read data from the List but the data…
giselle99
  • 21
  • 1
2
votes
1 answer

Flutter - Getx update screen only after hot reload

There are 3 buttons and I want to change the color of the clicked button when I click it. I manage the _currentFilter variable using obx and change the _currentFilter value using the changeFilter() function every time I click the button. And the UI…
nkhcode
  • 87
  • 1
  • 8
2
votes
0 answers

Couldn't find the correct provider

I am doing an experiment, where I want to make two similar apps with single source code. I am trying to make an "adaptive" State on top of the widget tree, and this state (ChangeNotifier) depends on the application (isApp1() determines which app is…
tareq albeesh
  • 1,701
  • 2
  • 10
  • 13
2
votes
3 answers

Flutter centralized/common loading screen for entire Application

I am working in Riverpod Auth flow boilerplate application. I want to use common loading screen for all async function even login and logout. Currently I have AppState provider if Appstate loading i show loading screen. it's working fine for login…
yathavan
  • 2,051
  • 2
  • 18
  • 25
2
votes
1 answer

Flutter: How to check if home button and power button are pressed in device

How to check if the home button or the power button are pressed in an android/ios device in Flutter App. There is a package - https://pub.dev/packages/hardware_buttons Now it is not compatible with Flutter 2.10. Error - "The plugin…
2
votes
1 answer

How to keep widget state while switching between widgets?

I'm developing a web app, where I'm trying to add a chat screen. I'm trying to use the floatingActionButton parameter and witching between FloatingActionButton and the ChatRoom and the user presses the FloatingActionButton. The flow of the…
ASAD HAMEED
  • 2,296
  • 1
  • 20
  • 36
2
votes
0 answers

Propagate state between different pages

I've three different MaterialPage. So I use Navigator.push to go from 1 -> 2 -> 3. Now, page 1 make an HTTP request to GET a model that is then used in page 1, 2 and 3. At the end of the process an action on page 3 triggers some modification of the…
Jumpa
  • 4,319
  • 11
  • 52
  • 100
2
votes
1 answer

Preserving state between different pages

I've 2 different pages: page1 -> page2 I'm navigating from page 1 to 2, using a button and Navigator.push. In both pages I simply show the value of a property called name. In the first page I instantiate a ChangeNotifier model defined like…
Jumpa
  • 4,319
  • 11
  • 52
  • 100
2
votes
1 answer

Riverpod - fetch data in ConsumerWidget when accessing it

I have a StateNotifier whose state I want to use in a widget. As far as I know, if you watch a StateNotifierProvider with ref.watch in a build, the widget gets rebuilt every time the state changes. Now, In the StateNotifier I have a DatabaseService…
Ghost
  • 401
  • 3
  • 15
2
votes
2 answers

Azure DevOps CI / CD not installing latest flutter version

My Azure DevOps configuration ask CI / CD to install latest version of flutter as you can see in the snapshot: But Flutter old stable version "2.2.1-stable" is getting install It seems google has changed their flutter download url so Azure…
2
votes
0 answers

ReorderableListView and sqflite, best way to update database when reorder is called?

I want to save the state of my reordered list of items in the database so that when I reload or comeback to the list it will show the reordered one not the old state that is saved in the database.
satoru_02
  • 63
  • 4
2
votes
1 answer

why moving the slider changes weight and age to initial values

If I change the value of the height by moving the slider, the values of the weight and age change back to their initial values. it should not be so, what am I doing wrong? Initially, I thought the codes to the slider value and the weight and age…