【发布时间】:2022-01-01 15:58:24
【问题描述】:
大家晚上好。我试图在我的富文本中使用扩展但无法实现。我的主要问题是小部件在不同的屏幕尺寸上溢出,所以我需要一种如何实现扩展的方法,因为扩展将帮助文本根据屏幕的尺寸适应
代码:
Container(
width: double.maxFinite,
height: 100,
margin: const EdgeInsets.only(left: 150,top: 50),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Watch your playlist",
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: color.AppColor.homePageDetails
),
),
SizedBox(height: 10,),//56:39
RichText(
text: TextSpan(
text: "stream up\n",
style:TextStyle(
color: color.AppColor.homePagePlanColor,
fontSize: 16
),
children: [
TextSpan(
text:"check out your favourite"
)
]
),
),
],
),
)
【问题讨论】:
-
RichText的父窗口小部件是什么?您能否提供有关其祖先的更多详细信息? -
@YeasinSheikh 我已经更新了代码,请看看谢谢
标签: flutter flutter-layout cross-platform