使用展开的小部件时无法更改图像的高度

问题描述

我正在尝试更改图像的高度,但是当我更改高度时,只有容器的大小会更改,但是图像的高度保持不变。

Container(
            color: Colors.white,height: 250,child: Row(
              children: <Widget>[
                Expanded(
                    flex: 3,child: Container(
                      color: Colors.red,// child: Padding(
                      // padding: const EdgeInsets.all(5.0),child: Image(
                        height: 150,// width: 100,image: Assetimage("images/MiddleEarthWp.jpg"),),// ),)),Expanded(
                  flex: 7,child: Container(
                    color: Colors.Amber,)
              ],

Before changing height of image After changing a height

解决方法

之所以会这样,是因为您的图片是容器的子级,并且因为您没有指定图片的适合度,因此可以尝试以下代码:

1- pipenv install jupyterlab
2- pipenv shell
3- jupyter lab 

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...