只是设置内边距(padding)的代码示例
body: Center(
child: Container(
child: new Text("hello zzl ",
style: TextStyle(
fontSize: 40.0,
),
textAlign: TextAlign.center,
),
alignment: Alignment.topCenter,
width: 500.0,
height: 400.0,
color: Colors.blue,
padding: const EdgeInsets.all(50.0),//外边距
// margin: const EdgeInsets.all(100.0),//内边距
),
),
效果图如下:

设置内边距(padding)和外边距(margin)的代码示例
body: Center(
child: Container(
child: new Text("hello zzl ",
style: TextStyle(
fontSize: 40.0,
),
textAlign: TextAlign.center,
),
alignment: Alignment.topCenter,
width: 500.0,
height: 400.0,
color: Colors.blue,
padding: const EdgeInsets.all(50.0),//外边距
// margin: const EdgeInsets.all(100.0),//内边距
),
),
效果图如下:
