我正试着在Ffltter应用程序上打印表情符号,但我没有看到表情符号,而是看到了这些表情符号的轮廓(分享下面的截图).

I have two files coursedata.dart and coursedescription.dart, The coursedata file contains information of courses that I am going to display in the coursedescription file.

这就是我在运行应用程序时看到的情况.以下是我期望的输出结果

西兰花和玉米

☐开放式cheese 菠菜 cogo toast

🥪墨西哥cheese 口袋

孟买 cogo toast

🥪辣味芝士三明治

素食cheese 烤三明治

Paneer Tikka开放式三明治

仓鼠cheese 爆裂披萨三明治

☐Paneer Toofani三明治

绿巨人三明治

这是coursedata.dart门课程中的一门

Course(
      id: '3',
      title: 'Cafe Style Sandwiches',
      time: '11:00AM - 3:00PM',
      imagePath: 'Cafe_Style_Sandwiches3.png',
      noOfItems: '10',
      items: '''西兰花和玉米 
☐开放式cheese 菠菜 cogo toast  
🥪墨西哥cheese 口袋
孟买 cogo toast 
🥪辣味芝士三明治
素食cheese 烤三明治
Paneer Tikka开放式三明治
仓鼠cheese 爆裂披萨三明治
☐Paneer Toofani三明治
绿巨人三明治''',
      imagePaths: [],
      language: 'English',
      certificateofCompletion: '', //Show Sample
      highlights: '',
      description:
          'Join our Sandwich-Making course to learn the tricks of the trade. From old-school favorites to new and exciting creations, you will become a sandwich pro, making delicious flavors that everyone will love.',
      price: 'Rs.2000'),

下面是我的容器,里面有coursedescription.dart人的名单

Container(
          margin: const EdgeInsets.only(right: 15, left: 15),
          alignment: Alignment.bottomLeft,
          child: Text(course.items),
        ),

我应该怎么做才能通过这种方式获得表情符号?

推荐答案

似乎问题是在this GitHub issue个人中发现的.

要添加的解决方案would be:

engineInitializer.initializeEngine({
  useColorEmoji: true,
});

到你位于<project-dir/web/index.html号的index.html号档案.

所以,把你的index.html分从:

onEntrypointLoaded: function(engineInitializer) {
          engineInitializer.initializeEngine().then(function(appRunner) {
            useColorEmoji: true,
            appRunner.runApp();
          });

致:

onEntrypointLoaded: function(engineInitializer) {
          engineInitializer.initializeEngine(
          {useColorEmoji:true} 
          ).then(function(appRunner) {
            useColorEmoji: true,
            appRunner.runApp();
          });

Chrome张图片:

Before

enter image description here

After

enter image description here

Flutter相关问答推荐

具有可变高度小部件的SingleChildScrollView内的列

如何增加容器高度?

在Flutter中创建具有固定行的压缩水平列表

我怎样才能判断一个字符串值是否为空(&Q;&Q;)?

audioQuery不会等待判断存储权限

在Flutter 中每次点击按钮时都很难调用自定义函数

为什么PUT方法没有发出任何响应?

无法将新文物与Flutter 项目集成在一起

如何将 Flutter 项目迁移到具有多个插件的 Gradle 8?

尽管海拔设置为 0,如何删除 appBar 下的下划线

Flutter 使用扩展的 TextField 定位小部件

Flutter:使用 GlobalKey 访问 BlocProvider

创建混合 TextWidget 和 TextFieldWidget

有什么办法可以消除Flutter 中的传递依赖?

访问 AsyncSnapshot 中的嵌套属性

如何按键在 map 列表中搜索

无法列出 com.facebook.android:facebook-login -Facebook 登录问题的版本

在 Flutter 中,如何使用文本字段和方形图像进行行布局

既然我们已经有了 Flutter 的内置 setState,为什么还要在 Flutter 中使用 BloC 或 Provider?

如何将所有行项目平等地放在一行中?Flutter