我的Flutter应用程式不适用于其他装置

时间:2018-06-24 08:56:07

标签: flutter flutter-layout flutter-dependencies flutter-test flutter-sliver

new Container(
          margin: const EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0),
          color: Colors.black12,
          child: new Row(

            children: <Widget>[
              new Image.asset('images/driver.jpeg',
                  height: 80.0,
                  width:150.0,
                alignment: Alignment.topLeft,
                repeat:ImageRepeat.repeat ,
                fit: BoxFit.fitHeight,
              ),
              new Image.asset('images/car.png',
                  height: 80.0,
                  width:150.0,
                alignment: Alignment.centerLeft,

              )
            ],
          ),
        ),

1 个答案:

答案 0 :(得分:1)

什么是合适的?

如果您的意思是Container应该填充其父级,则可以将inifinity设置为其高度

new Container(
      height: double.infinity,
      ...

或拉伸Row的横轴对齐方式

 Row(
     crossAxisAlignment: CrossAxisAlignment.stretch,
     ...