Flutter从入门到入土(报错总结)
1、在引入一个第3方依赖后执行package get后长时间提示该语句:
Waiting for another flutter command to release the startup lock
- 删除flutter SDK 下的/bin/cache/lockfile文件
- 重启Android Studio
2、长时间 ‘flutter pub get‘:
转到:https://www.cnblogs.com/smallstars/p/12904551.html
配置环境中的那一步
3、Error: No pubspec.yaml file found:
Terminal路径不对,重定向到该项目目录下(cd E:\Code\...)
4、使用Dialog后,报错说缺少MaterialApp:
最外层需要用StatelessWidget包裹起来
class MyApp extends StatelessWidget{ @override Widget build(BuildContext context) { // TODO: implement build return MaterialApp( home: LibraryApp(), ); } } class LibraryApp extends StatefulWidget{ State<StatefulWidget> createState(){ return _MyHomePage(); } } class _MyHomePage extends State<LibraryApp>{ ...... }
5、图片资源引入报错:
Unable to get status of file "X:\...\assets\images\icon\login_user.png": file not found. 或者 Error on line 48, column 4: Expected a key while parsing a block mapping. ╷ 48 │ assets: │ ^ ╵
第一种:assets/images就是默认加载图片资源的地方,放在子文件下无法加载
第二种:在pubspes.yaml中配置的时候assets没有对齐
每天进步一点点