有没有办法在使用时更改叠加背景颜色showModalBottomSheet?
现在颜色总是灰色,但我想使用不同的颜色,如绿色,如下所示。
这是演示中使用的代码以供参考
showModalBottomSheet<void>(context: context, builder: (BuildContext context) {
return Container(
child: Padding(
padding: const EdgeInsets.all(32.0),
child: Text('This is the modal bottom sheet. Tap anywhere to dismiss.',
textAlign: TextAlign.center,
style: TextStyle(
color: Theme.of(context).accentColor,
fontSize: 24.0
)
)
)
);
});
Run Code Online (Sandbox Code Playgroud)
LP *_*are 14
新的颤振更新允许您更改barrierColor在showModalBottomSheet()
showModalBottomSheet(
barrierColor: Colors.yellow.withOpacity(0.5),
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4252 次 |
| 最近记录: |