Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save abhinav4848/613d0631e8eaf02a70887773acc4dab8 to your computer and use it in GitHub Desktop.
Save abhinav4848/613d0631e8eaf02a70887773acc4dab8 to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
backgroundColor: Colors.black,
body: SafeArea(
child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Expanded(
child: Container(
height: 100.0,
width: 100.0,
color: Colors.red,
child: Text('Container 1'),
),
),
Expanded(
flex: 2,
child: Container(
height: 100.0,
color: Colors.teal,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Container(
height: 100.0,
width: 100.0,
color: Colors.yellow,
),
Container(
height: 100.0,
width: 100.0,
color: Colors.lightGreen,
),
],
),
),
),
Expanded(
child: Container(
width: 100.0,
height: 100.0,
color: Colors.blue,
child: Text('Container 3'),
),
),
],
),
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment