第7章页面布局-Padding填充布局
防采集标记:亢少军老师的课程和资料
import 'package:flutter/material.dart';
void main() => runApp(
new MaterialApp(
title: 'Padding填充布局示例',
home: new LayoutDemo(),
),
);
class LayoutDemo extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: new Text('Padding填充布局示例'),
),
body: new Center(
child: new Container(
width: 300.0,
height: 300.0,
padding: EdgeInsets.all(6.0),//容器填充上下左右设置为60.0
decoration: new BoxDecoration(
color: Colors.white,
border: new Border.all(
color: Colors.green,
width: 8.0,
),
),
child: new Container(
width: 200.0,
height: 200.0,
decoration: new BoxDecoration(
color: Colors.white,
border: new Border.all(
color: Colors.blue,
width: 8.0,
),
),
child: new FlutterLogo(),
),
),
),
);
}
}
- Flutter技术入门与实战: http://product.dangdang.com/26485813.html
- Flutter交流学习群:894109159
- Flutter开源项目请关注: https://github.com/kangshaojun
- Flutter****:https://edu.****.net/lecturer/2436
@作者: 亢少军