Flutter 禁止emjio

const String REGEX_EMOJI =
    "[^\\u0020-\\u007E\\u00A0-\\u00BE\\u2E80-\\uA4CF\\uF900-\\uFAFF\\uFE30-\\uFE4F\\uFF00-\\uFFEF\\u0080-\\u009F\\u2000-\\u201f\r\n]"

TextField(
                  cursorColor: Theme.of(context).cursorColor,
                  inputFormatters: [
                    FilteringTextInputFormatter.deny(RegExp(REGEX_EMOJI))
                  ],
                )

你可能感兴趣的:(Flutter 禁止emjio)