Card widget (colored in yellow) is being cut-off at the end on iOS simulator, whereas it displays properly on Android emulator, as shown below:
iOS:
Android
Code to render card widget is:
Widget _editButton() {
return new Container(
padding: new EdgeInsets.all(10.0),
child: new Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Card(
color: Colors.yellow,
elevation: 2.0,
child: FlatButton(
splashColor: Colors.greenAccent,
onPressed: () {},
))
]));
}
How to align the card so as to make it consistent (like on Android)?
Android emulator: Nexus 6P (1440 x 2560: 560dpi)
iOS simulator: iPhone 8
答案 0 :(得分:0)
我通过将width
内Positioned
小部件的Stack
设置为:
MediaQuery.of(context).size.width