Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
26d7f502
Unverified
Commit
26d7f502
authored
Apr 27, 2019
by
xster
Committed by
GitHub
Apr 27, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some docs to StatefulBuilder (#31291)
parent
81af5a76
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
0 deletions
+39
-0
basic.dart
packages/flutter/lib/src/widgets/basic.dart
+39
-0
No files found.
packages/flutter/lib/src/widgets/basic.dart
View file @
26d7f502
...
...
@@ -6249,6 +6249,45 @@ typedef StatefulWidgetBuilder = Widget Function(BuildContext context, StateSette
/// A platonic widget that both has state and calls a closure to obtain its child widget.
///
/// The [StateSetter] function passed to the [builder] is used to invoke a
/// rebuild instead of a typical [State]'s [State.setState].
///
/// Since the [builder] is re-invoked when the [StateSetter] is called, any
/// variables that represents state should be kept outside the [builder] function.
///
/// {@tool sample}
///
/// This example shows using an inline StatefulBuilder that rebuilds and that
/// also has state.
///
/// ```dart
/// await showDialog<void>(
/// context: context,
/// builder: (BuildContext context) {
/// int selectedRadio = 0;
/// return AlertDialog(
/// content: StatefulBuilder(
/// builder: (BuildContext context, StateSetter setState) {
/// return Column(
/// mainAxisSize: MainAxisSize.min,
/// children: List<Widget>.generate(4, (int index) {
/// return Radio<int>(
/// value: index,
/// groupValue: selectedRadio,
/// onChanged: (int value) {
/// setState(() => selectedRadio = value);
/// },
/// );
/// }),
/// );
/// },
/// ),
/// );
/// },
/// );
/// ```
/// {@end-tool}
///
/// See also:
///
/// * [Builder], the platonic stateless widget.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment