Skip to content

Instantly share code, notes, and snippets.

@pedromassango
Created December 27, 2018 23:11
Show Gist options
  • Save pedromassango/13eaf16e03cc716ebc9c54d06947aaf7 to your computer and use it in GitHub Desktop.
Save pedromassango/13eaf16e03cc716ebc9c54d06947aaf7 to your computer and use it in GitHub Desktop.
This code split a flutter app into two parts.
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.
);
}
@pedromassango
Copy link
Author

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment