Results for “State”
Full-text search across Boring Doc explanations, official documentation pages, the Flutter API index and every indexed version change.
Concepts
- State management3.47.7state
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
- Widgets and the widget lifecycle3.47.7widgets
objects; a new widget instance is cheap and is created on every build. StatelessWidget: build() depends only on its constructor arguments and BuildContext. StatefulWidget creates a State
Guides
- Add interactivity to your Flutter appdoc
respond to taps. How to create a custom widget. The difference between stateless and stateful widgets. In this tutorial, you'll add interactivity to an app that
- Differentiate between ephemeral state and app statedoc
tell the difference between ephemeral and app state. This doc introduces app state, ephemeral state, and how you might manage each in a Flutter
- 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
- Flutter architectural overviewdoc
code as possible. During development, Flutter apps run in a VM that offers stateful hot reload of changes without needing a full recompile. For release, Flutter apps
- State managementdoc
Content covering state management in Flutter apps
- State managementdoc
structure an app to manage the state of the data flowing through it. and wonder why your app's state is lost on a restart, check
- State management in Flutterdoc
ChangeNotifier and manage loading, success, and error states. Introduction When developers talk about state-management in Flutter, they're essentially referring to the pattern by which
- Approaches to state managementdoc
introduction to different approaches to managing state in Flutter apps. State management is a complex topic. If you feel that some of your questions haven
- 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
- Simple app state managementdoc
simple form of state management. Now that you know about declarative UI programming and the difference between ephemeral and app state , you are ready to learn
- 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 the box in and out. 1. Create
- Guide to app architecturedoc
The recommended way to architect a Flutter app. The following pages demonstrate
- Animations API overviewdoc
their build functions directly by reading their current value and listening to their state changes or they can use the animations as the basis of more elaborate
- Common architecture conceptsdoc
Learn about common architecture concepts in application design, and how they apply
- How Flutter worksdoc
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
API reference
- Stateclass
logic and internal state for a StatefulWidget. widgets.State State State class widgets
- StatefulWidgetclass
widget that has mutable state. widgets.StatefulWidget StatefulWidget Stateful Widget class widgets
- StatelessWidgetclass
widget that does not require mutable state. widgets.StatelessWidget StatelessWidget Stateless Widget class widgets
- StatefulElementclass
Element that uses a StatefulWidget as its configuration. widgets.StatefulElement StatefulElement Stateful Element class widgets
- StatelessElementclass
Element that uses a StatelessWidget as its configuration. widgets.StatelessElement StatelessElement Stateless Element class widgets
- StatefulBuilderclass
state and calls a closure to obtain its child widget. widgets.StatefulBuilder StatefulBuilder Stateful Builder class widgets
- State.newconstructor
widgets.State.State.new State new State.new constructor widgets
- StatefulBuilder.newconstructor
that both has state and delegates its build to a callback. widgets.StatefulBuilder.StatefulBuilder.new StatefulBuilder new Stateful Builder.new constructor widgets
- StatelessWidget.newconstructor
Initializes key for subclasses. widgets.StatelessWidget.StatelessWidget.new StatelessWidget new Stateless Widget.new constructor widgets
- StatefulWidget.newconstructor
Initializes key for subclasses. widgets.StatefulWidget.StatefulWidget.new StatefulWidget new Stateful Widget.new constructor widgets
- StatefulElement.newconstructor
Creates an element that uses the given widget as its configuration. widgets.StatefulElement.StatefulElement.new StatefulElement new Stateful Element.new constructor widgets
- StatelessElement.newconstructor
Creates an element that uses the given widget as its configuration. widgets.StatelessElement.StatelessElement.new StatelessElement new Stateless Element.new constructor widgets
- RestorablePropertyclass
Manages an object of type T, whose value a State object wants to have restored during state restoration. widgets.RestorableProperty RestorableProperty Restorable Property class widgets
- ScaffoldStateclass
State for a Scaffold. material.ScaffoldState ScaffoldState Scaffold State class material
- ScaffoldMessengerStateclass
State for a ScaffoldMessenger. material.ScaffoldMessengerState ScaffoldMessengerState Scaffold Messenger State class material
- TooltipStateclass
Contains the state for a Tooltip. material.TooltipState TooltipState Tooltip State class material
- UndoHistoryStateclass
State for a UndoHistory. widgets.UndoHistoryState UndoHistoryState Undo History State class widgets
- DrawerControllerStateclass
State for a DrawerController. material.DrawerControllerState DrawerControllerState Drawer Controller State class material
- SegmentedButtonStateclass
State for SegmentedButton. material.SegmentedButtonState SegmentedButtonState Segmented Button State class material
- SelectionAreaStateclass
State for a SelectionArea. material.SelectionAreaState SelectionAreaState Selection Area State class material
- SelectableRegionStateclass
State for a SelectableRegion. widgets.SelectableRegionState SelectableRegionState Selectable Region State class widgets
- EditableTextStateclass
State for an EditableText. widgets.EditableTextState EditableTextState Editable Text State class widgets
- NavigatorStateclass
state for a Navigator widget. widgets.NavigatorState NavigatorState Navigator State class widgets
- OverlayStateclass
current state of an Overlay. widgets.OverlayState OverlayState Overlay State class widgets
Version changes
- TestTextInput state reset1.17.0breaking
state of a `TestTextInput` instance, a stub for the system's onscreen keyboard, is now reset between tests. The state of `WidgetTester.testTextInput` is now reset before
- Prevent `StateError: Bad state: Future already completed in Symbolizer` during stack symbolization.3.47.2bugfix
Prevent `StateError: Bad state: Future already completed in Symbolizer` during stack symbolization
- Added AppLifecycleState.hidden3.13.0breaking
the application is in when `WidgetsBindingObserver.didChangeAppLifecycleState` is called. If code has switch statements that handle all cases of the `AppLifecycleState` enum, a new case will need
- ThemeData's toggleableActiveColor property has been deprecated3.7.0deprecated
ThemeData(); MaterialApp( theme: theme.copyWith( switchTheme: SwitchThemeData( thumbColor: MaterialStateProperty.resolveWith<Color?>( (Set states) { if (states.contains(MaterialState.disabled)) { return null; } if (states.contains(MaterialState.selected)) { return myColor
- Updated Checkbox.fillColor behavior3.13.0breaking
customize the checkbox. Code before migration: ```dart Checkbox( fillColor: MaterialStateProperty.resolveWith((states) { if (!states.contains(MaterialState.selected)) { return Colors.red; } return null; }), value: _checked, onChanged: _enabled ? (bool? value) { setState(() { _checked = value
- Actions API revision1.20.0breaking
rather than an `Intent(TheAction.key)` instance. Code before migration: ```dart class MyWidget extends StatelessWidget { // ... @override Widget build(BuildContext context) { return Shortcuts( shortcuts: <LogicalKeySet, Intent> { LogicalKeySet(LogicalKeyboardKey.enter): Intent(ActivateAction.key
- Rename MaterialState to WidgetState3.22.0breaking
states) => resolveCallback(states) ?? MouseCursor.uncontrolled; } BorderSide side = MaterialStateBorderSide.resolveWith((Set states) { if (states.contains(MaterialState.selected)) { return const BorderSide(color: Colors.red); } return null; }); ``` Code after migration: ```dart WidgetState selected
- - Bad state exception can occur when HTTPS connection attempt errors or is aborted2.0.2bugfix
state exception can occur when HTTPS connection attempt errors or is aborted
- Migrate to widget state3.38.0improvement
Migrate to widget state (Material, by @ValentinVignal
- Migrate to widget state3.38.0improvement
Migrate to widget state (Material, by @ValentinVignal
- Fix ADB device list parsing for long wireless mDNS serials separated from state by a single space.3.47.1bugfix
device list parsing for long wireless mDNS serials separated from state by a single space
- Rebuild optimization for OverlayEntries and Routes1.17.0breaking
implicit rebuilds you may see issues, which can be resolved by wrapping any state change in a `setState` call. Prior to this change, an `OverlayEntry` would rebuild
- Fix logic statements in year2023 documentation3.38.0bugfix
logic statements in year2023 documentation (Material, by @xVemu
- Add state restoration for UIScene migration3.38.0new-feature
state restoration for UIScene migration (iOS, by @vashworth
- Handle 'no permissions' adb device state3.47.0tooling
Handle 'no permissions' adb device state (Tooling, by @mboetger
- Fix VoiceOver does not announce state of ButtonSegment3.41.0bugfix
VoiceOver does not announce state of ButtonSegment (Material, by @huycozy). VoiceOver ButtonSegment
- Ensures initial semantics state is sent to engine3.38.0improvement
Ensures initial semantics state is sent to engine (Framework, by @chunhtai
- Fix SegmentedButton border doesn't reflect states3.38.0bugfix
SegmentedButton border doesn't reflect states (Material, by @bleroux). SegmentedButton
- Simplify `if-else` block into single `return` statement3.41.0improvement
Simplify `if-else` block into single `return` statement (Material, by @ValentinVignal