sách gpt4 ai đã đi

容器内的 Flutter 文本

In lại 作者:行者123 更新时间:2023-12-05 09:33:47 29 4
mua khóa gpt4 Nike

我在容器 (1) 中创建了容器 (2)。你能帮忙如何向容器(1)添加文本吗?下面是我的代码

    return Scaffold(
body:
Padding(
padding: const EdgeInsets.only(top: 100, left: 30, right: 30, bottom: 25,),
child: Container(
height: 300,
color: Colors.red,
alignment: Alignment.bottomLeft,
child: Container(
width: 360,
height: 230,
color: Colors.blue,
child: Align(
alignment: Alignment.center,
child: Text(
'Car or sport car'
maxLines: 3,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 20,
),
),
),
),
),
),

1 Câu trả lời

您只需要在第一个Container 中放置一个Column、Row 或Stack。下面是一个例子,供您理解。

return Scaffold(
body:
Padding(
padding: const EdgeInsets.only(top: 100, left: 30, right: 30, bottom: 25,),
child: Container(
height: 300,
color: Colors.red,
alignment: Alignment.bottomLeft,
child: Column(
children: [
Text("Put your Text Here!!!!"),
Container(
width: 360,
height: 230,
color: Colors.blue,
child: Align(
alignment: Alignment.center,
child: Text(
'Car or sport car'
maxLines: 3,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 20,
),
),
),
),]
),
),
),

关于容器内的 Flutter 文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67054067/

29 4 0
行者123
Hồ sơ cá nhân

Tôi là một lập trình viên xuất sắc, rất giỏi!

Nhận phiếu giảm giá Didi Taxi miễn phí
Mã giảm giá Didi Taxi
Giấy chứng nhận ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com