Flutter:有没有办法用英语打开键盘? [英] Flutter: is there a way to open the keyboard in English?

查看:296
本文介绍了Flutter:有没有办法用英语打开键盘?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Flutter中,有没有一种方法可以强制单击TextForm的键盘是英语?

Is there a way in Flutter to force that the keyboard which opens once I click the TextForm is in English?

我希望TextField仅包含英文字符.有办法吗?

I want a TextField to contain only English characters. Is there a way?

推荐答案

使用此选项将启动具有预定义语言的默认键盘应用程序.

Use this would launch the default keyboard app with predefined language.

FocusScope.of(context).requestFocus(FocusNode());


无法使用特定语言启动键盘.用户必须从键盘设置的末端开始执行此操作.但是,您可以使用RegExp检查所有字符是否都是英文.


There is no way to launch the keyboard in particular language. Users have to do that from their end in keyboard settings. However you may use the RegExp to check if all the characters are in English.

这篇关于Flutter:有没有办法用英语打开键盘?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆