Created
May 25, 2018 18:23
-
-
Save manujbahl/a0310f32825af0122820d87fec386a9a to your computer and use it in GitHub Desktop.
Column Isuue
This file contains hidden or 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'; | |
import 'package:flutter/services.dart'; | |
void main() { | |
runApp(new MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return new MaterialApp( | |
title: 'Flutter Demo', | |
home: new Scaffold( // 1 | |
appBar: new AppBar( | |
title: new Text("Demo"), // screen title | |
), | |
body: new MyContainer() | |
) | |
); | |
} | |
} | |
class MyContainer extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return new Container( | |
color: Colors.cyan, | |
height: 400.0, | |
width: 400.0, | |
child: new Stack( | |
children: <Widget>[ | |
getFlexColumn(context) | |
] | |
) | |
); | |
} | |
getFlexColumn(context) { | |
return new Column( | |
mainAxisAlignment: MainAxisAlignment.spaceEvenly, | |
crossAxisAlignment: CrossAxisAlignment.end, | |
children: <Widget>[ | |
new Container( | |
color: Colors.red, | |
height: 120.0, | |
width: 120.0, | |
), | |
new Container( | |
color: Colors.green, | |
height: 120.0, | |
width: 120.0, | |
) | |
], | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment