Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Add StatefulBuilder() to solve issue MarcinusX#116.
  • Loading branch information
K1A2 authored Aug 13, 2021
1 parent 0287b05 commit 94167b4
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,20 @@ class __IntegerExampleState extends State<_IntegerExample> {
@override
Widget build(BuildContext context) {
return Column(
children: <Widget>[
NumberPicker(
value: _currentValue,
minValue: 0,
maxValue: 100,
onChanged: (value) => setState(() => _currentValue = value),
),
Text('Current value: $_currentValue'),
],
return StatefulBuilder(
builder: (context4, setState2) {
return Column(
children: <Widget>[
NumberPicker(
value: _currentValue,
minValue: 0,
maxValue: 100,
onChanged: (value) => setState2(() => _currentValue = value),
),
Text('Current value: $_currentValue'),
],
);
},
);
}
}
Expand Down

0 comments on commit 94167b4

Please sign in to comment.