Flutter-是否可以在 flutter 中将 RichText class 放入 Container class 中

Flutter-Is it possible to put a RichText class within a Container class in flutter

所以我目前正在开发一个应用程序项目,我已经到了我想将两个文本行放在一行中的位置。作为一个例子,它应该像这样 app demo created with figma。到目前为止,我有一行,其中包含相同高度的每个元素,但我很难将 2 个元素放在一行中。我发现这个 class 叫做 Stack 但我很难实现它。在我的 Stack class 中,我有一个 RichText Class。从 flutter api,我的理解是你必须使用容器(才能定义位置)。所以我想知道是否应该在 Stack class 之后切换到容器 classes,然后在每个容器 class 中放置一个 RichText?如果我能对此提出一些建议,或者只是关于如何创建图片中的内容,那就太好了。提前致谢。

添加了您要实现的目标的演示:

        Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            // row containing the avatar, name, date and icons (likes and comments)
            Row(
              children: [
                // circle avatart
                CircleAvatar(
                  backgroundColor: Colors.blue,
                  radius: 25,
                ),
                // spacing
                SizedBox(
                  width: 10,
                ),

                // the name of poster and date in a column
                Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    Text(
                      'Claire',
                    ),
                    Text(
                      'July 03 at 13:08PM',
                    ),
                  ],
                ),
                // spacer
                Spacer(),

                // likes icon
                Icon(Icons.favorite_border),
                Text(
                  '32',
                ),

                // spacing
                SizedBox(
                  width: 10,
                ),

                // comments icon
                Icon(
                  Icons.comment,
                ),
                Text(
                  '32',
                ),
              ],
            ),
            // spacing
            SizedBox(
              height: 10,
            ),
            // title text
            Text(
              'Dorm recommendation',
            ),

            // decription
            Text(
              'Any recommendations on dorm application? Does anyone know how\'s the facility at Talent Apartment? Are there teamrooms and gym in TA? Also, updates on the location of washers and dryers?',
              maxLines: 3,
              overflow: TextOverflow.ellipsis,
            ),
          ],
        ),

结果: