Skip to content

Instantly share code, notes, and snippets.

@ryanlid
Created February 15, 2020 16:36
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/9b10a8153279397ea8a7b5445a9b36b0 to your computer and use it in GitHub Desktop.
Save ryanlid/9b10a8153279397ea8a7b5445a9b36b0 to your computer and use it in GitHub Desktop.
Center 居中布局
import "package:flutter/material.dart";
void main() {
runApp(
MaterialApp(
title: "Center 居中布局示例",
home: LayoutDemo(),
),
);
}
class LayoutDemo extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Center 居中布局示例'),
),
body: Center(
child: Text(
"Hello World",
style: TextStyle(
fontSize: 36.0,
),
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment