【发布时间】:2022-11-19 09:45:15
【问题描述】:
我有一个 flutter 应用程序给我一个 snapshot.data 但我需要在 snapshot.data 之前添加一个固定的文本 示例:“位置:”snapshot.data
drawer: new Drawer(
child: new ListView(
children: <Widget>[
new UserAccountsDrawerHeader(
//accountEmail: Text("Paso:"),
accountEmail: FutureBuilder<String>(
future: functions.FunctionsHelper.getAgentPosition(),
builder: (context, snapshot) {
if (snapshot.hasData) {
return RichText(
text: TextSpan(
children: [
TextSpan(
text: snapshot.data,
style: new TextStyle(
height: -0.2,
fontSize: 11.4,
color: Colors.white,
fontWeight: FontWeight.w700)),
],
),
);
【问题讨论】:
标签: flutter