Created
February 15, 2020 16:38
-
-
Save ryanlid/0fd152bf916ab79a8eacd35173659001 to your computer and use it in GitHub Desktop.
Padding 填充布局
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(MaterialApp( | |
title: "Padding 填充布局示例", | |
home: LayoutDemo(), | |
)); | |
} | |
class LayoutDemo extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: Text("Padding 填充布局示例"), | |
), | |
body: Center( | |
child: Container( | |
width: 300.0, | |
height: 300.0, | |
padding: EdgeInsets.all(6.0), | |
decoration: BoxDecoration( | |
color: Colors.white, | |
border: Border.all(color: Colors.green, width: 8.0), | |
), | |
child: Container( | |
width: 200.0, | |
height: 200.0, | |
decoration: BoxDecoration( | |
color: Colors.blue, | |
border: Border.all( | |
color: Colors.blue, | |
width: 8.0, | |
)), | |
child: FlutterLogo(), | |
), | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment