flutter - 如何在颤振中将欢迎文本放在用户名之前?
问题描述
我正在创建一个简单的颤振应用程序。
我有一个关于如何在从 api 调用值之前放置文本的问题
这是我想要实现的输出
Hello, $username
Tittle : $adsTitle
****
Hello, Jack
Tittle : Make A wish
Profile profile = snapshot.data[index];
return Card(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget> [
Padding(
padding: const EdgeInsets.all(8.0),
child: Center(child:user == null ? Text('') : Text((user), style:
TextStyle(fontSize: 30) )),
Center(
child: Text('${profile.adsTitle}', style: TextStyle(fontSize: 25, color:
mainColor),
),
),
),
],
),
),
);
怎么把文字Hello
放在child: Center(child:user == null ? Text('') : Text((user), style: TextStyle(fontSize: 30))),
并且Tittle
在 Center(child: Text('${profile.adsTitle}', style: TextStyle(fontSize: 25, color: mainColor),),),
解决方案
像这样
Text("Hello $user");
推荐阅读
- html - 如何使图像向下滑动
- javascript - 通过 JavaScript 和 Angular 中的 UWP 应用程序下载文件
- angular - Angular 7 中的 SCSS 加载顺序
- entity-framework - 一项任务与一个人有关。但是当我们查询 _getPerson(id) 时如何获取所有的任务呢?
- xml - 验证 .xml 提要结构的脚本
- python - 使用 Python 在删除之前终止文件进程
- javascript - 如何订阅 ngRx 状态
- angular - 在位置或基于经度和纬度的离子设置标记
- jquery - 如何使用 codeigniter 3、AJAX 和 Jquery 在数据库中上传图像多选
- c - C指针不显示到相同的地址?*pa=a; 帕=&a; 帕!= &帕