文本在一个设备上工作很好,但在其他屏幕上的文本是凌乱的,所以请帮助我减少这个容器的规模,我想让它运行在所有屏幕上像这样的图像image preview example和输出在我的屏幕上是这样的,但在其他屏幕上是凌乱的
Container(
width: 350,
child: FutureBuilder(
future: GetJuz(),
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return Center(child: CircularProgressIndicator());
} else {
var ayat = snapshot.data!;
var ayah = "";
for (var i = 12; i < 23; i++) {
ayah += ayat[i].codes!.replaceAll(" ", "");
}
return Container(
child: RichText(
textDirection: TextDirection.rtl,
text: TextSpan(
children: [
for (var element in ayat) ...[
if (element.page == "5")
TextSpan(
text: element.codes
.toString()
.replaceAll(" ", ""),
recognizer: TapGestureRecognizer()
..onTap = () {
print(element.text);
},
style: TextStyle(
fontFamily: 'Schyler',
fontSize:
MediaQuery.of(context).size.width *
0.05,
color: Colors.black,
),
),
],
],
),
),
);
}
},
),
),
2条答案
按热度按时间7nbnzgx91#
我不确定这个,但你试试看
gc0ot86w2#
我认为你希望文本从两端对齐。如果是这样的话,您可以在RichText中使用它