1、项目找不到头文件
- 刚 clone 下来的找不到头文件
import ‘package:flutter/material.dart‘;
// 错误里写的是不存在,上网搜索了一下解决方法:
// 在项目的目录打开终端,输入 flutter packages get ,
2、Error running pod install
-
Automatically assigning platform
iOSwith version8.0on targetRunnerbecause no platform was specified. Please specify a platform for this target解决:只要修改ios目录下podfile 第二行 去掉#号
3、模拟器不能启动
-
Could not build the application for the simulator.
Command MergeSwiftModule failed with a nonzero exit code
fatal error: 'flutter_dd_dataoke_sdk-Swift.h' file not found
4、ListView 不满屏无法滚动问题
// listView 添加属性
physics: const AlwaysScrollableScrollPhysics(),
5、 \flutter\bin\cache\dart-sdk\bin\dart.exe"' 不是内部或外部命令
删除flutter\bin\cache 文件夹,重新执行flutter docator 即可
6、解决输入框添加文字光标不在最后面问题
_contentController.text = _contentController.text + '[${expression.name}]';
_contentController.selection = TextSelection.fromPosition(TextPosition(offset: _contentController.text.length));
7、Extentded_text_field
1、不能打空格。 是因为 Extentded_text_field 放在了InkWell 里面 。
2、获取光标位置,在文本中间插入表情。
// 1、通过 controller.selection.baseOfset 可以获取光标的位置的。
// 2、但是点击按钮弹起表情况的时候, 输入框失去响应,就获取不到光标位置了。
// 3、所以添加监听的方式记录光标位置
_contentController.addListener(() {
if (_contentController.selection.baseOffset != -1) {
this._curseOffset = _contentController.selection.baseOffset;
}
});
8、 A package may not list itself as a dependency.
项目名称和第三方库名称重复