错误是这个
无法获取文件"C:\Users\gio\Desktop\flutter\TodoAppV2\assets\Magic_Menu_Image.webp": file not found.
的状态
但是我无法加载它。下面是我的代码。
main.dart:
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Home'),
),
drawer: Drawer(
child: ListView(
padding: EdgeInsets.all(0),
children: <Widget>[
DrawerHeader(
child: null,//Image.asset('assets/Magic_Menu_Image.jpg'),
decoration: BoxDecoration(color: Colors.black),
),
ListTile(
title: Container(
color: Colors.orange[900],
child: Row(
children: <Widget>[
Icon(
Icons.home,
size: 30,
),
Text(
'Home',
style: TextStyle(fontSize: 20,),
)
]
)
),
)
]
)
),
);
} }
并且不在pubspec.yaml文件中:
flutter:
assets:
- assets/Magic_Menu_Image.jpg
如果有人可以帮助您修复此错误。