Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

emoji表情 #6

Open
windows771053651 opened this issue Oct 15, 2020 · 0 comments
Open

emoji表情 #6

windows771053651 opened this issue Oct 15, 2020 · 0 comments

Comments

@windows771053651
Copy link

代码中看到还未实现emoji的删除,我的实现如下:
1:显示emoji,实现方式:https://blog.csdn.net/beyondforme/article/details/103837481
2:emoji Widget中自定义删除功能实现:
/// 将输入框内容转成unicode编码,从后往前每次删除一个unicode,达到删除文本内容的目的
setState(() {
_inputContent = deleteInputContent(_inputContent);
});

 String deleteInputContent(String str) {
     int unitLen = 1;
     var sRunes = str.runes;
     return sRunes.length >= unitLen ?  String.fromCharCodes(sRunes, 0, sRunes.length - unitLen) : str;
 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant