Tha*_*med 5 cross-platform dart flutter
我想在文本“NAME”和“Thashreef”之间留一个空格。所以我使用了填充:EdgeInsets.only(top:10),在视频教程中它是SizedBox(height:10)。这两个功能一样吗?
void main()=> runApp(MaterialApp(
home: FirstPage()
));
class FirstPage extends StatelessWidget{
@override
Widget build(BuildContext context) {
// TODO: implement build
return Scaffold(
backgroundColor: Colors.grey[900],
appBar: AppBar(
title: Text('Ninja ID Card'),
centerTitle: true,
backgroundColor: Colors.grey[850],
elevation: 0.0,
),
body: Padding(
padding: EdgeInsets.fromLTRB(20,30,40,50),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text('NAME',style: TextStyle(
color:Colors.grey,
letterSpacing: 2.0),),
Padding(
padding: const EdgeInsets.only(top:10),
child: Text('Thashreef',
style: TextStyle(
color: Colors.yellowAccent,
letterSpacing:2.0,fontSize: 28.0,fontWeight: FontWeight.bold)),
)
],
),
),
);
}
}```
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
10387 次 |
| 最近记录: |