Last active
March 15, 2019 12:27
-
-
Save ScottS2017/fa5866637f5f2cd9f561b0492a969163 to your computer and use it in GitHub Desktop.
tight_and_loose_flexibles_together.dart
This file contains 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
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