Questions tagged [statefulwidget]
339 questions
0
votes
1 answer
I wants to reload and update the widget in flutter when clicked on action button of snack bar
This is my code where I am showing list of pending invoices.But when i accept the it should reload the pending invoice widget after clicking on snack bar action button.When user clicks on accept button its showing snack bar and when pressed accept…

Minal Suryawanshi
- 81
- 8
0
votes
3 answers
How to use a method in a Stateful Widget from another Widget
So i have this toggle() method in the Stateful SideBar class
class SideBar extends StatefulWidget {
const SideBar({super.key});
@override
State createState() => _SideBarState();
}
class _SideBarState extends State with…

Pulina Hansana
- 21
- 5
0
votes
2 answers
How to pass a list from second screen to first screen in flutter?
I have a stateful widget in my first and second screen.
I have a list in my second screen and want to pass it to my first screen.
How to do it ?
I know how to pass a single data between screens but it didn't work for a list.

Ini
- 25
- 9
0
votes
1 answer
What does the "State" class constructor look like in Flutter?
What does super.didChangeDependencies(); do in the following code?
void didChangeDependencies() {
if (_isInit) {
setState(() {
_isLoading = true;
});
Provider.of(context).fetchAndSetContests().then((_) {
…

best_of_man
- 643
- 2
- 15
0
votes
1 answer
Flutter showModalBottomSheet update parent without Navigator.pop()
In my app I would like to show a bottom sheet with showModalBottomSheet to let the user pick a font. When a new font is selected I would like to reflect the changes immediately in the parent view that is presenting the sheet without closing the…

Jonas Ester
- 535
- 4
- 19
0
votes
1 answer
Making a Phone Dialer App. How to link a FloatingActionButton such that it opens a textfield where I can enter a Number
I have tried making a function that returns a TextField and then putting the function name in the onPressed argument. However when I do press the button nothing happens even in the terminal other than acknowledging that the button has been…
0
votes
1 answer
How do I preserve generic type information when accessing a Stateful Flutter Widget property from the Widget State?
I've got a simplified example below. In practice, I'm passing a list of data objects to a StatefulWidget. I want the Widget to copy the provided list into its state object which will then be filtered through future interactions. The filters use a…

Jeff Neet
- 734
- 1
- 8
- 22
0
votes
0 answers
My Flutter app UI is not rebuilding when i request new data from firebase
I have a dropdown button consisting of names of the days of a week. When i click on any day from the dropdown then the data corresponding to that day is fetched without any problem. But when i try to change the option like if i select monday first…

Hexated
- 3
- 4
0
votes
1 answer
Flutter Range Slider in showModalBottomSheet not updating UI
So I have this showModalBottomSheet() and in it I have a couple widgets that require state, so I wrapped with StatefulBuilder(). Even though the other widgets are updating their data and UI as expected but the RangeSlider() does not update the…

Davis
- 1,219
- 2
- 8
- 17
0
votes
1 answer
Flutter error [ZeroHung]zrhung_get_config: Get config failed for wp[0x0102]
when I run the application on my mobile the following error appears:
[ZeroHung]zrhung_get_config: Get config failed for wp[0x0102]
it prints more than 50 times
and when i try to run on android studio emulator the application give me error…

Hosam Mohamed
- 1
- 2
0
votes
1 answer
How to resolve Shared Preferences not initialized error: Flutter
Scenario: I have a page with a ListView which shows a list of several items from the database, fetched using a REST API. I am loading the data in the initState() method. In order to load the data, I also need some data stored in the Shared…

ayush
- 464
- 5
- 17
0
votes
1 answer
How to refactor the below class to StatefulWidget and using mounted properly in addition to a context after an Async gap
How to refactor the below class to StatefulWidget and using mounted properly in addition to a context after an Async gap
class AuthService {
//sign up user
void signUpUser({
required BuildContext context,
required String email,
…

marc
- 29
- 2
0
votes
2 answers
How does Text Widget get marked for rebuild on parent setState()
When setState is called in a widget's state, the corresponding element in the element tree gets marked as dirty, and the widget gets rebuilt. However, how does it handle descendents? For example, the Text widget below gets rebuilt when its ancestor…

Joel Castro
- 485
- 6
- 20
0
votes
0 answers
Flutter: Hide or unhide field based on a button without rebuilding the widget
I have a parent widget which has 2 child widgets for input fields. So, I want one field to be hidden in the beginning and by pressing a button to hide or unhide it. I managed to achieve that by wrapping the child widget (input field) in a visibility…

CyberHunter
- 69
- 7
0
votes
1 answer
It is possible to preserve state of PopUpMenuButton?
Currently i am working on music app and according to my ui i have to display download, downloading progress and downloaded status shown inside popup menu item.But according to Popup menu button widget behaviour, it is dispose and unmounted.So when…

Kesmi Topiwala
- 62
- 8