Skip to content

Instantly share code, notes, and snippets.

@harkairt
Last active December 26, 2020 11:21
Show Gist options
  • Save harkairt/7dbb4a9ccb91cd5b6d357bb370b002fb to your computer and use it in GitHub Desktop.
Save harkairt/7dbb4a9ccb91cd5b6d357bb370b002fb 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(
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