【发布时间】:2021-07-24 19:50:06
【问题描述】:
class app1 extends StatelessWidget {
@override
Widget build(BuildContext context) {
return (MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Hello ',
home: Material(
child: Container (
alignment: Alignment.topCenter ,
//padding: EdgeInsets.all (30 ),
margin: EdgeInsets.all(30),
child: Row(
children: <Widget> [
Text ( 'Hello There ' , style: TextStyle (fontSize: 30 ) ),
],
),
),
),
)
);
}
}
【问题讨论】:
-
边距通常是从工作区(屏幕)边缘开始的测量值。而填充通常是该区域内不同元素之间的间距。尝试添加第二个元素,然后调整填充,你会看到不同。
-
你的意思是在 Row 中添加另一个文本小部件?