Card widget being cut-off at the end on ios simulator

时间:2018-12-19 11:25:21

标签: ios flutter flutter-layout

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:

enter image description here

Android

enter image description here

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

1 个答案:

答案 0 :(得分:0)

我通过将widthPositioned小部件的Stack设置为:

MediaQuery.of(context).size.width