Results for “StatefulWidget”
Full-text search across Boring Doc explanations, official documentation pages, the Flutter API index and every indexed version change.
Concepts
- Widgets and the widget lifecycle3.47.7widgets
every build. StatelessWidget: build() depends only on its constructor arguments and BuildContext. StatefulWidget creates a State object that survives rebuilds and holds mutable data. State lifecycle: initState
- State management3.47.7state
affected widgets rebuild. Keep state that only one widget cares about in a StatefulWidget; lift state that several screens share above them, expose it through an InheritedWidget
- Performance3.47.7performance
budget allows. Keep build() cheap and scoped (const widgets, small StatefulWidgets, lazy lists), avoid saveLayer-triggering effects such as Opacity and clipping in animations, and measure
- Networking and JSON3.47.7data
Use package:http to send a request, await the Future , check the
Guides
- Stateful widgetsdoc
Learn about StatefulWidgets and rebuilding Flutter UI. Learn when widgets need to be stateful and how to trigger UI updates with setState. Introduction So far, your
- Fade a widget in and outdoc
following steps: Create a box to fade in and out. Define a StatefulWidget . Display a button that toggles the visibility. Fade
- Add interactivity to your Flutter appdoc
both. You can get right to touching the code in Step 2: Subclass StatefulWidget . If you want to try different ways of managing state, skip
- Animate the properties of a containerdoc
radius when the user taps a button using the following steps: Create a StatefulWidget with default properties. Build an AnimatedContainer using the properties. Start the animation
- Differentiate between ephemeral state and app statedoc
How to tell the difference between ephemeral and app state. This doc
- Performance best practicesdoc
How to ensure that your Flutter app is performant. Generally, Flutter applications
- Flutter architectural overviewdoc
A high-level overview of the architecture of Flutter, including the core
- Retrieve the value of a text fielddoc
resources used by the object. // Define a custom Form widget. class MyCustomForm extends StatefulWidget { const MyCustomForm({super.key}); @override State createState() => _MyCustomFormState(); } // Define a corresponding State class. // This
- Build a form with validationdoc
also allows you to validate the form later. Create the form as a StatefulWidget . This allows you to create a unique GlobalKey () once. You can then store
- LayoutBuilder and adaptive layoutsdoc
foundation Create lib/screens/adaptive_layout.dart and start with the following basic structure: This is a StatefulWidget because the adaptive layout eventually
- Rebuild UI when state changesdoc
Because it must explicitly initialize data fetching before rendering, implement it as a StatefulWidget . Start by creating the basic stateful structure: Instantiate the article view model Next
- How Flutter worksdoc
Flutter Works" dives deep into the State class, a critical piece behind every StatefulWidget . Follow the full lifecycle of a State object—from initState , where you initialize
- An introduction to widget testingdoc
Learn more about widget testing in Flutter. In the introduction to unit
- User inputdoc
Accept input from the user with buttons and text fields. Learn to
API reference
- StatefulWidgetclass
widget that has mutable state. widgets.StatefulWidget StatefulWidget Stateful Widget class widgets
- StatefulWidget.newconstructor
Initializes key for subclasses. widgets.StatefulWidget.StatefulWidget.new StatefulWidget new Stateful Widget.new constructor widgets
- Expansibleclass
StatefulWidget that expands and collapses. widgets.Expansible Expansible Expansible class widgets
- Stateclass
logic and internal state for a StatefulWidget. widgets.State State State class widgets
- StatefulElementclass
Element that uses a StatefulWidget as its configuration. widgets.StatefulElement StatefulElement Stateful Element class widgets
- ButtonStyleButtonclass
base StatefulWidget class for buttons whose style is defined by a ButtonStyle object. material.ButtonStyleButton ButtonStyleButton Button Style Button class material
- widgets.RestorationMixinmixin
Manages the restoration data for a State object of a StatefulWidget. widgets.RestorationMixin RestorationMixin Restoration Mixin mixin widgets
- widgets.ToggleableStateMixinmixin
mixin for StatefulWidgets that implement toggleable controls with toggle animations (e.g. Switches, CupertinoSwitches, Checkboxes, CupertinoCheckboxes, Radios, and CupertinoRadios). widgets.ToggleableStateMixin ToggleableStateMixin Toggleable State Mixin mixin widgets
- widgets.StatefulWidgetBuildertypedef
Signature for the builder callback used by StatefulBuilder. widgets.StatefulWidgetBuilder StatefulWidgetBuilder Stateful Widget Builder typedef widgets