Created
June 20, 2020 16:33
-
-
Save lukepighetti/a2a90b4f3ff11bb32d1e838b0948a8e3 to your computer and use it in GitHub Desktop.
Just another day fighting flutter
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
import 'package:flutter/material.dart'; | |
import 'package:flutter_sandbox/widgets/layout/default_scaffold.dart'; | |
import 'package:flutter_sandbox/themes/text_themes.dart'; | |
class SandboxRoute extends StatefulWidget { | |
@override | |
_SandboxRouteState createState() => _SandboxRouteState(); | |
} | |
class _SandboxRouteState extends State<SandboxRoute> { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar(), | |
body: Center( | |
child: Container( | |
height: 200, | |
child: ClipRect( | |
child: Container( | |
height: 300, | |
width: 100, | |
color: Colors.blue.withOpacity(0.2), | |
child: Column( | |
children: [ | |
for (var e in [1, 2, 3]) | |
Expanded( | |
/// Remove expanded to see appropriate size, but clipping | |
child: AspectRatio( | |
aspectRatio: 1.0, | |
child: Container( | |
color: Colors.red.withOpacity(0.2), | |
alignment: Alignment.center, | |
child: Text("$e"), | |
), | |
), | |
) | |
], | |
), | |
), | |
), | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment