【发布时间】:2022-10-13 23:39:08
【问题描述】:
我正在使用颤振开发 android 应用程序,并且在我的应用程序中试图将文本扭曲到下一行,但它不起作用。在我的应用程序中,邮件 ID 没有换行。它是直线前进的。但我想将文本包装在下一行。那么,如何在颤动的下一行中显示换行文本(邮件 ID)。
如果有人知道答案,请帮助找到解决方案。
Widget build(BuildContext context)
{
return Drawer(
child: ListView(
children: [
//drawer header
Container(
height: 165,
color: Colors.amber,
child: DrawerHeader(
decoration: BoxDecoration(color: Color(0xFFF5F1F1)),
child: Row(
children: [
const Icon(
Icons.person,
size: 50,
color: Colors.black,
),
const SizedBox(width: 16,),
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
"Name",
maxLines: 1,
overflow: TextOverflow.ellipsis,
softWrap: false,
style: const TextStyle(fontSize: 16,color: Colors.black,fontWeight: FontWeight.bold,),
),
const SizedBox(height: 10,),
Text(
"mynameeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee@gmail.com",
maxLines: 2,
overflow: TextOverflow.ellipsis,
softWrap: true,
style: const TextStyle(
fontSize: 12,
color: Colors.black,
),
),
],
),
],
),
),
),
const SizedBox(height: 12.0,),
//drawer body
GestureDetector(
onTap: ()
{
Navigator.push(context, MaterialPageRoute(builder: (c)=> TripsHistoryScreen()));
},
child: const ListTile(
leading: Icon(Icons.history, color: Colors.black,),
title: Text(
"History",
style: TextStyle(
color: Colors.black
),
),
),
),
GestureDetector(
onTap: ()
{
Navigator.push(context, MaterialPageRoute(builder: (c)=> ProfileScreen()));
},
child: const ListTile(
leading: Icon(Icons.person, color: Colors.black,),
title: Text(
"Visit Profile",
style: TextStyle(
color: Colors.black
),
),
),
)
],
),
);
}
【问题讨论】:
标签: flutter flutter-layout flutter-android