Skip to content

Instantly share code, notes, and snippets.

@manujbahl
Created May 25, 2018 18:23
Show Gist options
  • Save manujbahl/a0310f32825af0122820d87fec386a9a to your computer and use it in GitHub Desktop.
Save manujbahl/a0310f32825af0122820d87fec386a9a to your computer and use it in GitHub Desktop.
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