Files
FlutterUnit/lib/views/widgets/SingleChildRenderObjectWidget/Padding/node1_all.dart
2020-05-03 23:05:53 +08:00

40 lines
951 B
Dart

import 'package:flutter/material.dart';
/// create by 张风捷特烈 on 2020/5/3
/// contact me by email 1981462002@qq.com
/// 说明:
// {
// "widgetId": 74,
// "name": 'Padding四面等边距',
// "priority": 1,
// "subtitle":
// "【child】 : 孩子组件 【Widget】\n"
// "【padding】 : 内四边距 【EdgeInsetsGeometry】"
// "EdgeInsets.all用来限定相同的四边边距",
// }
class PaddingAll extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
color: Colors.grey.withAlpha(22),
width: 200,
height: 150,
child: Padding(
padding: EdgeInsets.all(20),
child: _buildChild(),
),
);
}
Widget _buildChild() {
return Container(
alignment: Alignment.center,
color: Colors.cyanAccent,
width: 100,
height: 100,
child: Text("孩子"),
);
}
}