Skip to content

Instantly share code, notes, and snippets.

@ryanlid
Created February 15, 2020 16:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanlid/4d9e271242ea9ea6e1deed03a2ca28ef to your computer and use it in GitHub Desktop.
Save ryanlid/4d9e271242ea9ea6e1deed03a2ca28ef to your computer and use it in GitHub Desktop.
Column 垂直布局
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