Flutter 踩坑记录
环境相关
【fix】
1.Waiting for another flutter command to release the startup lock…
[solution]: 杀死dart相关进程。命令行:taskkill /F /IM dart.exe
2.Win10系统 升级AS至4.1.0,导致Flutter/Dart 插件找不到
**[solution]😗*因为新版本的AS 插件位置发生更改, ^1.27.0的flutter stable版本 还未调整,但是本地dev 版本已经调整,因此只能切换版本规避;
flutter channel
flutter channel dev
flutter doctor
- flutter 版本高于 ^1.26.0 时,rich_input: ^1.2.1 版本Bug(The method ‘RichInputController.buildTextSpan’ has fewer named arguments than those of overridden method ‘TextEditingController.buildTextSpan’)
[solution]: 因为新版本的flutter 中,editable_text.dart TextSpan buildTextSpan方法 新增了BuildContext context 上下文命名参数;rich_input: ^1.2.1 版本@override TextSpan buildTextSpan 为做更新,导致报错,修改覆盖插件:
【change】TextSpan buildTextSpan({TextStyle style, bool withComposing})
【to】TextSpan buildTextSpan({BuildContext context, TextStyle style , bool withComposing})
4、运行flutter-web
flutter run -d chrome --web-port=8080 --web-hostname=127.0.0.1