Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Column Isuue
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