Created
December 27, 2018 23:11
-
-
Save pedromassango/13eaf16e03cc716ebc9c54d06947aaf7 to your computer and use it in GitHub Desktop.
This code split a flutter app into two parts.
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
class _MyHomePageState extends State<MyHomePage> { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
body: Stack( | |
children: <Widget>[ | |
Positioned( | |
top: 0, | |
bottom: MediaQuery.of(context).size.height / 2, | |
width: double.maxFinite, | |
child: Container( | |
color: Colors.orangeAccent, | |
), | |
), | |
Positioned( | |
top: (MediaQuery.of(context).size.height / 2), | |
bottom: 0, | |
width: double.maxFinite, | |
child: Container( | |
color: Colors.red, | |
)) | |
], | |
) // This trailing comma makes auto-formatting nicer for build methods. | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just a suggestion: Trailing comma everywhere makes formatting nicer. When I started learning Dart, I couldn't understand why the formatting is so ugly until I figured that out.