Skip to content

Instantly share code, notes, and snippets.

@ScottS2017
Last active March 15, 2019 12:27
Show Gist options
  • Save ScottS2017/fa5866637f5f2cd9f561b0492a969163 to your computer and use it in GitHub Desktop.
Save ScottS2017/fa5866637f5f2cd9f561b0492a969163 to your computer and use it in GitHub Desktop.
tight_and_loose_flexibles_together.dart
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData.dark(),
home: Scaffold(
appBar: AppBar(
title: Text('Deep Dive Testing'),
backgroundColor: Colors.blue,
),
body: SizedBox(
height: 200.0,
width: 200.0,
child: Container(
child: Column(
// We set the mainAxisSize to min
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Flexible(
fit: FlexFit.tight,
flex: 1,
child: Container(
color: Colors.green,
width: 100.0,
height: 100.0,
),
),
Flexible(
fit: FlexFit.loose,
flex: 1,
child: Container(
color: Colors.yellow,
width: 100.0,
height: 10.0,
),
),
],
),
),
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment