gpt4 book ai didi

android - 如何在 Flutter 中的文本之间加载图像

转载 作者:行者123 更新时间:2023-12-05 00:16:13 24 4
gpt4 key购买 nike

我需要在我的 android 应用程序上显示包含来自 API 的文本和图像的内容,当我将它保存在字符串类型的变量中时,文本会显示,但图像显示为 url。如何加载获取链接以在文本之间加载?

最佳答案

enter image description here

我需要插入一个与文本句子内联的图像。所以为此我使用了这个:

  final String paragraph1 =
'Advanciti App is an app where you can study and make friends with people living near your home. Advanciti is an Edtech Startup based out of Pune, Maharashtra, India.\n';

RichText(
text: TextSpan(
children: [
TextSpan(text: "The "),
WidgetSpan(child: Container(width: 20.0, child: Image.asset('assets/app_icon.png', scale: 1))),
TextSpan(text: paragraph1),
],
),
),

关于android - 如何在 Flutter 中的文本之间加载图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61486993/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com