Home > Net >  How to show colored emoji from custom font on Flutter app?
How to show colored emoji from custom font on Flutter app?

Time:01-07

I'd like to use Result

CodePudding user response:

Try using RichText widget instead of the regular Text widget

CodePudding user response:

Use RichText widget as:

RichText(
  text: TextSpan(
    children: <TextSpan>[
      TextSpan(
        text: 'Hello',  // non-emoji characters
      ),
      TextSpan(
        text: '? ?️u200d?', // emoji characters
        style: TextStyle(
          fontFamily: 'EmojiOne',
        ),
      ),
    ],
  ),
);

[OR]

Widget build(BuildContext context) {
    return Center(
        child: Container(
            alignment: Alignment.center,
            color: Colors.deepPurple,
            //width: 200.0,
            //height: 100.0,
            child: Text("Emoji ? ",
                style: TextStyle(
                  fontFamily: 'Raleway',
                  fontSize: 40,
                  decoration: TextDecoration.none,
                  color: Colors.white

                ))));
  }
  •  Tags:  
  • Related