Intrinsic Width Widget
Complete Code For Intrinsic Width Widget In Flutter
main.dart
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
@override
State<StatefulWidget> createState() => MyHomePageState();
}
class MyHomePageState extends State<MyHomePage> with SingleTickerProviderStateMixin {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.pink,
title: Text("IntrinsicWidth Widget")),
body: Center(
child: IntrinsicWidth(
child: Container(
height: 50.0,
width: 290.0,
color: Colors.pink[900],
child: Container(color: Colors.orange, width: 80.0),
),
),
),
);
}
}