Created
February 15, 2020 16:36
-
-
Save ryanlid/9b10a8153279397ea8a7b5445a9b36b0 to your computer and use it in GitHub Desktop.
Center 居中布局
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: "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