我想在底部工作表对话框中使用颤振数字选择器。但是当我通过滑动更改值时,数字选择器不会更新。我的代码如下。
GestureDetector(
onTap: (){
showModalBottomSheet<int>(
context: context,
builder: (BuildContext context){
return new Container(
height: 350.0,
color: HexColor('FF737373'),
child: new Container(
decoration: new BoxDecoration(
color: Colors.white,
borderRadius: new BorderRadius.only(
topLeft: const Radius.circular(20.0),
topRight: const Radius.circular(20.0))),
child: new Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
NumberPicker.integer(
initialValue: _currentValue,
minValue: 0,
maxValue: 1000,
),
],
),
)),
);
}
).then((int value) {
if (value != null) {
setState(() => _currentValue = value);
}
});
},
child: Container(
//container
),
),