In ios/android apps emojis are shown correctly. But using any web-browser (e.g. Chrome) the emoji appears in black and white. I also tried different Font-Families but with the same result.
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return const Scaffold(
body: Center(
child: Text('Enjoy! 🥳 If there's any question')
),
);
}
}
2
Answers
Use Noto Color Emoji from google (follow this steps):
Added it to pubspec.yaml `flutter:
fonts:
fonts:
And in TextStyle class use it like this
TextStyle( fontFamilyFallbackm: [ 'Apple Color Emoji', 'Noto Color Emoji', ], )
Unlike that try to:
. Delete web folder
. Update flutter by using command
flutter upgrade
. Run command
flutter create .
Right now, it is issue with the flutter-engine. It was probably introduced in here https://github.com/flutter/engine/commit/7406fd81865292772689a1bbbc2239c665ba07d8
The initial issue looks like the fonts provided in flutter does not have support for emoji characters (.AppleSystemUIFont) hence first fallback font is used that is NatoEmoji.
The temporary solution is to provide Apple Color Emoji font file to the web app as asset. You can find the file here
"/System/Library/Fonts/Apple Color Emoji.ttc"
You can copy this to your app’s asset. Once that is done,
Then inside main.dart
Output: