Skip to content

Instantly share code, notes, and snippets.

@davidmigloz
Created May 26, 2022 17:13
Show Gist options
  • Select an option

  • Save davidmigloz/ff24fd9f8681cfe45826fc34018a5df2 to your computer and use it in GitHub Desktop.

Select an option

Save davidmigloz/ff24fd9f8681cfe45826fc34018a5df2 to your computer and use it in GitHub Desktop.
intrinsic_height
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