Last active
December 26, 2020 11:21
-
-
Save harkairt/7dbb4a9ccb91cd5b6d357bb370b002fb to your computer and use it in GitHub Desktop.
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'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
debugShowCheckedModeBanner: false, | |
home: Scaffold( | |
appBar: AppBar(title: Text('In the real scenario the widths are not known!!')), | |
body: SingleChildScrollView( | |
scrollDirection: Axis.horizontal, | |
child: Row( | |
mainAxisSize: MainAxisSize.min, | |
children: [ | |
Column(children: [ | |
Container( | |
width: 100, | |
height: 200, | |
decoration: BoxDecoration(color: Colors.red), | |
), | |
Expanded( | |
child: Text('This is wrapped in an expaned '), | |
), | |
]), | |
Column(children: [ | |
Container( | |
width: 150, | |
height: 200, | |
decoration: BoxDecoration(color: Colors.yellow), | |
), | |
Text('Lorem'), | |
]), | |
Column(children: [ | |
Container( | |
width: 90, | |
height: 200, | |
decoration: BoxDecoration(color: Colors.green), | |
), | |
Text('Duis aute irure dolor in reprehenderit'), | |
]), | |
], | |
), | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment