如何跟随相同的高度
How to follow the same height
我正在尝试跟随左侧图片的高度。但是即使我调整了右侧图片的填充,它仍然不会像左侧那样变小。
左侧图片:
return WillPopScope(
onWillPop: () async {
return true;
},
child: Scaffold(
drawer: Drawer(
child: ListView(...)
),
body: UpgradeAlert(
canDismissDialog: false,
child: Column(
children: <Widget>[
Container(
width: Get.size.width,
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: const BorderRadius.only(
bottomLeft: Radius.circular(20.0),
bottomRight: Radius.circular(20.0),
),
),
child: SafeArea(
bottom: false,
child: Padding(
padding: const EdgeInsets.only(
left: 16.0, right: 16.0, top: 0.0, bottom: 16.0),
child:
右图:
return WillPopScope(
onWillPop: _onWillPop,
child: Scaffold(
appBar: AppBar(
backgroundColor: Colors.purple,
title: Text('Test'),
),
body: Column(
children: <Widget>[
Container(
width: Get.size.width,
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.secondary,
borderRadius: const BorderRadius.only(
bottomLeft: Radius.circular(20.0),
bottomRight: Radius.circular(20.0),
),
),
child: const SafeArea(
bottom: false,
child: Padding(
padding: EdgeInsets.only(
left: 16.0, right: 16.0, top: 0.0, bottom: 16.0),
),
编辑:单独显示图片。
左侧图片:
右侧图片:
并排比较以显示右图中的额外高度。
底部来自 bottom
填充。
Padding(
padding: EdgeInsets.only(
left: 16.0,
right: 16.0,
top: 0.0,
// bottom: 16.0, you can remove this to have desire result
),
),
要获得圆角,请在 AppBar
上使用 shape
属性。
appBar: AppBar(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(25.0),
bottomRight: Radius.circular(25.0),
),
),
backgroundColor: Colors.purple,
title: Text('Test'),
),
我正在尝试跟随左侧图片的高度。但是即使我调整了右侧图片的填充,它仍然不会像左侧那样变小。
左侧图片:
return WillPopScope(
onWillPop: () async {
return true;
},
child: Scaffold(
drawer: Drawer(
child: ListView(...)
),
body: UpgradeAlert(
canDismissDialog: false,
child: Column(
children: <Widget>[
Container(
width: Get.size.width,
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: const BorderRadius.only(
bottomLeft: Radius.circular(20.0),
bottomRight: Radius.circular(20.0),
),
),
child: SafeArea(
bottom: false,
child: Padding(
padding: const EdgeInsets.only(
left: 16.0, right: 16.0, top: 0.0, bottom: 16.0),
child:
右图:
return WillPopScope(
onWillPop: _onWillPop,
child: Scaffold(
appBar: AppBar(
backgroundColor: Colors.purple,
title: Text('Test'),
),
body: Column(
children: <Widget>[
Container(
width: Get.size.width,
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.secondary,
borderRadius: const BorderRadius.only(
bottomLeft: Radius.circular(20.0),
bottomRight: Radius.circular(20.0),
),
),
child: const SafeArea(
bottom: false,
child: Padding(
padding: EdgeInsets.only(
left: 16.0, right: 16.0, top: 0.0, bottom: 16.0),
),
编辑:单独显示图片。
左侧图片:
底部来自 bottom
填充。
Padding(
padding: EdgeInsets.only(
left: 16.0,
right: 16.0,
top: 0.0,
// bottom: 16.0, you can remove this to have desire result
),
),
要获得圆角,请在 AppBar
上使用 shape
属性。
appBar: AppBar(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(25.0),
bottomRight: Radius.circular(25.0),
),
),
backgroundColor: Colors.purple,
title: Text('Test'),
),