问题描述
如何定位文本,以便用户名和电子邮件位于右上角?整个时间都在左上角。对我没有任何帮助吗?
Center(
child: Column(
children: <Widget> [
Center(
child: FutureBuilder(
future: getUserInfo(),builder: (context,AsyncSnapshot<DocumentSnapshot> snapshot) {
if (snapshot.connectionState == ConnectionState.done) {
return ListView.builder(
shrinkWrap: true,itemCount: 1,itemBuilder: (BuildContext context,int index) {
return ListTile(
subtitle: Text(snapshot.data.data()["Email"],style: TextStyle(
color: Colors.white,fontFamily: 'Orbitron',fontSize: 15.0,fontWeight: FontWeight.bold,),title: Text(snapshot.data.data()["Username"],style: TextStyle(
color: Colors.white,fontSize: 25.0,fontWeight: FontWeight.bold),);});
} else if (snapshot.connectionState == ConnectionState.none) {
return Text("No data");}
return Center(
child: SpinKitFadingCircle(color: Colors.white,size: 20.0),);
},],
这是我的编辑脚本,但仅显示SpinKitFadingCircle。
Column(
children: <Widget> [
FutureBuilder(
future: getUserInfo(),AsyncSnapshot<DocumentSnapshot> snapshot) {
if (snapshot.connectionState == ConnectionState.done) {
return Text(snapshot.data.data()["Username"],style: TextStyle(
color: Colors.white,);
} else if (snapshot.connectionState == ConnectionState.none) {
return Text("No data");}
return Center(
child: SpinKitFadingCircle(color: Colors.white,crossAxisAlignment: CrossAxisAlignment.end,
解决方法
您应该使用“ textalign”并将其命名为“ TextAlign.right”。