Intrinsic Height Widget
Complete Code For Intrinsic Height Widget In Flutter
main.dart
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
debugShowCheckedModeBanner: false,
title: 'APP',
home: MyHomePage(),
);
}
}
class MyHomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.deepOrangeAccent,
title: Text("IntrinsicHeight Widget"
)),
body: Center(
child: IntrinsicHeight(
child: Padding(
padding: const EdgeInsets.only(left:50.0),
child: Row(
children: [
Container(
height: 100.0,
width: 20.0,
color: Colors.red,
child: Container(color: Colors.deepOrangeAccent),
),
SizedBox(width: 10),
Container(
height: 50.0,
width: 20.0,
child: Container(color: Colors.lightGreen),
),
SizedBox(width: 10),
Container(
height: 200.0,
width: 20.0,
child: Container(color: Colors.pink),
),
SizedBox(width: 10),
Container(
height: 40.0,
width: 20.0,
child: Container(color: Colors.pink),
),
SizedBox(width: 10),
Container(
height: 90.0,
width: 40.0,
child: Container(color: Colors.indigo,),
),
SizedBox(width: 10),
Container(
height: 350.0,
width: 20.0,
child: Container(color: Colors.blueGrey,),
),
SizedBox(width: 10),
Container(
height: 30.0,
width: 10.0,
child: Container(color: Colors.amber),
),
],
),
),
),
),
);
}
}