Created
February 15, 2020 16:47
-
-
Save ryanlid/4d9e271242ea9ea6e1deed03a2ca28ef to your computer and use it in GitHub Desktop.
Column 垂直布局
This file contains hidden or 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: "Column 垂直布局", | |
home: LayoutDemo(), | |
)); | |
} | |
class LayoutDemo extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: Text("Column 垂直布局"), | |
), | |
body: Column( | |
children: <Widget>[ | |
Text("Flutter"), | |
Text("垂直布局"), | |
Expanded( | |
child: FittedBox( | |
fit: BoxFit.contain, | |
child: FlutterLogo(), | |
), | |
) | |
], | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment