【发布时间】:2020-03-26 21:48:08
【问题描述】:
在我的颤振应用程序中,我无法在抽屉标题中加载图像。 我已经用了好几个小时了,不明白为什么它不起作用。
有什么问题
请帮忙
Container(
width: 100,
height: 100,
child: UserAccountsDrawerHeader(
accountName: const Text(_AccountName),
accountEmail: const Text(_AccountEmail),
currentAccountPicture: CircleAvatar(
backgroundColor: Colors.brown,
child: Text(_AccountAbbr),
),
decoration: BoxDecoration(
//color: Colors.yellow,
image: DecorationImage(
image: AssetImage('../assets/md_drawer_header.png'),
fit: BoxFit.cover,
),
),
),
),
【问题讨论】:
-
你的
pubspec.yaml是什么样的? -
我没有对 pubspec.yaml 进行任何更改 -
-
dependencies: flutter: sdk: flutterdev_dependencies: flutter_test: sdk: flutter -
你加载你的资产了吗?
-
你是什么意思?
标签: android iphone flutter dart