Questions tagged [statefulwidget]

339 questions
2
votes
2 answers

BottomSheet value does not update using button flutter

I have a Bottom Sheet which has sets of buttons. I use the buttons to change the value of pinString and a text to show the pinString. The value of the text does not update when button is clicked. How to fix this showNumberPad(BuildContext context)…
Nehal
  • 1,261
  • 12
  • 18
2
votes
1 answer

Change the parent widget height without causing the child to rebuild Flutter

I have a parent widget which is a Container() and a child widget which is a FutureBuilder... In my app I need to change the height of the container so that it fits the newly added items in the FutureBuilder But the problem is when I setState and…
2
votes
1 answer

Unable to work with Flutter Stateful widget

I'm Ravi. I am pretty much new to Flutter but I am not new to programming. I am Stuck working with stateful widgets of Flutter. Since i am new to this SDK i am unable to figure out why my state isn't getting updated. What i did was just wrote some…
Ravikiran
  • 512
  • 3
  • 14
2
votes
1 answer

Flutter - NoSuchMethodError: The getter 'focusScopeNode' was called on null

I am having the following error while trying to pass List from one screen to another. The data is being passed from the async function. I need to open the other Screen based on the data fetched from the database. The answer mentioned here didn't…
Jamshaid
  • 370
  • 2
  • 11
  • 40
2
votes
1 answer

Statefull widget state is rebuilt after back pressed

I have strange issue: I have StatefullWidget like this class ActionDetailView extends StatefulWidget { static const routeName = '/actionDetails'; @override _ActionDetailViewState createState() { print("Create state"); return…
masztalski
  • 152
  • 2
  • 15
2
votes
2 answers

How to reuse a stateful widget in flutter

I have a following state full widget. I need to reuse it as it is by just changing two variables id and collectionName. Generally I would extract a widget, but in this case I am modifying variable firstName which wont let me extract the…
Aseem
  • 5,848
  • 7
  • 45
  • 69
2
votes
2 answers

setState() method in Flutter is not updating the view until the last call in a for loop

The problem I am trying to build a sorting visualizer using Flutter. I have used a CustomPainter to paint vertical lines that correspond to the values of the integer list that I intend to sort. The application is set up such that when a user clicks…
2
votes
2 answers

setState() not changing container properties

what I am doing wrong? even though the function gets called the widget tree isn't updating, another question is how setState knows which widget to rebuild? and is there a way to view the widget tree in runtime? import 'dart:developer'; import…
RootOfMinusOne
  • 137
  • 2
  • 11
2
votes
0 answers

How to access a variable inside a Stateful Widget from its Instance

I use a stateful class that returns DropdownButton widget for me, I need to access a variable in it that is not final and can be accessed through its object. here is my code: class ListItemHelper extends StatefulWidget { String name = ''; …
2
votes
1 answer

Choosing StatelessWidget or StatefulWidget for sub-widget which has TextEditingController as a child

I'm working on a refactored code to separated small piece of widgets. There's several columns with TextFields in each one of them.I have two options to complete the task : Choosing StatelessWidget since it have more performance, may put…
JerryZhou
  • 4,566
  • 3
  • 37
  • 60
1
vote
0 answers

I am having troubles with pageview and stateful widget FLUTTER

Usually when I work with listview on stateless widgets this is how I do it I have a model class for data handling class CategoriesModel { String? categoryId; String? categoryNameEn; String? categoryNameAr; String? categoryIcon; String?…
Toxicless
  • 23
  • 4
1
vote
1 answer

Unable to get values from flutter radio group in custom bottom sheet

I am trying to create a custom bottom sheet and it contains a list of radio buttons. Currently the buttons are showing properly. But when user chooses an option from it, the value is not displayed on the selected page. code for custom bottom sheet…
kapil tk
  • 186
  • 10
1
vote
2 answers

How to call a function in a main file Stateful Widget from another StatefulWidget in another file?

I am new to flutter) I want to make function which calls showDialog() with 2 TextField() when user press the FloatingActionButton() in the main.dart file. I don't know how to call a function in a main file Stateful Widget from another StatefulWidget…
Eliza_K
  • 13
  • 2
1
vote
1 answer

flutter - update or remove stateFullWidget in ListWidgets

in my case i have stateFulwidget that will handle move,rotate and scale of widget i have map ... after move or action in screen i will update the stateFulwidget as set new info's on that what is the problem list Widgets from Map…
1
vote
0 answers

Rive Animation.asset stop animating after setState

I want to use a Rive to make animated icons in NavigationBar. I have a NavigationBar widget in StatefulWidget. When I call setState, destinations (in NavigationBar) is redrawn and the Rive animation is interrupted and flickers. How to use a Rive…
nehex
  • 11
  • 2