From 94167b429fc9d4ed147ae200dae4920c64703ce8 Mon Sep 17 00:00:00 2001 From: K1A2 Date: Fri, 13 Aug 2021 10:03:22 +0900 Subject: [PATCH] Update README.md Add StatefulBuilder() to solve issue #116. --- README.md | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index a20b955..f057493 100644 --- a/README.md +++ b/README.md @@ -18,16 +18,20 @@ class __IntegerExampleState extends State<_IntegerExample> { @override Widget build(BuildContext context) { - return Column( - children: [ - NumberPicker( - value: _currentValue, - minValue: 0, - maxValue: 100, - onChanged: (value) => setState(() => _currentValue = value), - ), - Text('Current value: $_currentValue'), - ], + return StatefulBuilder( + builder: (context4, setState2) { + return Column( + children: [ + NumberPicker( + value: _currentValue, + minValue: 0, + maxValue: 100, + onChanged: (value) => setState2(() => _currentValue = value), + ), + Text('Current value: $_currentValue'), + ], + ); + }, ); } }