【发布时间】:2021-08-27 05:54:03
【问题描述】:
我想按照设计图片中提供的方式设置文本,但我的背景图像上显示了文本,我无法相应地设置它.. 我尝试过其他方法,例如将“容器”放在顶部,然后在下面应用脚手架,但它也没有用...... 或者是否有任何文本属性,如“边距”,以相应地为文本和其他组件添加边距.. 这是我的代码:
return Scaffold(
body: SingleChildScrollView(
child: Column(
children: [
Container(
height: size.height * 1,
width: size.width * 1,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage('images/bg.png'), fit: BoxFit.cover),
),
child: Column(
children: [
Text(
('Kleine.'),
style: TextStyle(
color: Colors.white,
fontSize: 20.0,
fontWeight: FontWeight.bold,
),
textAlign: TextAlign.center,
),
Text(
//code
),
],
)),
],
),
),
);
```[![This is what I want][1]][1]
[![This is what I am getting "keline" on top][2]][2]
[1]: https://i.stack.imgur.com/9kpK5.png
[2]: https://i.stack.imgur.com/f4aIX.png
I want my text and other widgets to justify accordingly just as given in the provided image.
【问题讨论】:
-
你能发一张你的结果图片吗? ...我没有得到你的问题
-
@Why_So_Ezz 请检查
标签: flutter dart flutter-layout flutter-test