0

I'm trying to just allow a textfield to allow any input with text and emojis, no special character/symbols because it gives all sorts of error.

I only know how to remove all special characters with inputFormatter, but it also disable all emojis.

inputFormatters: [new WhitelistingTextInputFormatter(RegExp("[a-zA-Z]")),],

Does anyone know how to do this?

  • Does the following article answer your question? => [How to detect emojis in a String in Flutter using Dart?](https://stackoverflow.com/questions/55433185/how-to-detect-emojis-in-a-string-in-flutter-using-dart) – daddygames Feb 16 '22 at 13:50

1 Answers1

0

This package will help you.

try to use this package flutter_emoji

and use like this

static final RegExp REGEX_EMOJI = RegExp(r'(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])');
Anand
  • 4,355
  • 2
  • 35
  • 45