Created
May 26, 2022 17:13
-
-
Save davidmigloz/ff24fd9f8681cfe45826fc34018a5df2 to your computer and use it in GitHub Desktop.
intrinsic_height
This file contains hidden or 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 const MaterialApp( | |
| title: 'Flutter Demo', | |
| debugShowCheckedModeBanner: false, | |
| home: MyHomePage(), | |
| ); | |
| } | |
| } | |
| class MyHomePage extends StatelessWidget { | |
| const MyHomePage(); | |
| @override | |
| Widget build(BuildContext context) { | |
| return Scaffold( | |
| body: IntrinsicHeight( | |
| child: Row( | |
| mainAxisAlignment: MainAxisAlignment.center, | |
| children: [ | |
| Container( | |
| width: 50, | |
| color: Colors.indigo, | |
| ), | |
| const Text( | |
| 'Line 1\n' | |
| 'Line 2\n' | |
| 'Line 3\n' | |
| 'Line 4\n' | |
| 'Line 5\n' | |
| 'Line 6', | |
| ), | |
| ], | |
| ), | |
| ), | |
| ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment