0 points

How to make height of all widgets inside Row equal the tallest widget


dashboard

Wed Jan 22 2020 18:43:41 GMT+0000 (UTC)

Posted by @loop_ifthen #dart #flutter #layouts

Widget build(BuildContext context) {
  return Scaffold(
    appBar: AppBar(title: Text('IntrinsicWidth')),
    body: Center(
      child: IntrinsicHeight(
        child: Row(
          crossAxisAlignment: CrossAxisAlignment.stretch,
          children: <Widget>[
            RaisedButton(
              onPressed: () {},
              child: Text('Short'),
            ),
            RaisedButton(
              onPressed: () {},
              child: Text('A bit Longer'),
            ),
            RaisedButton(
              onPressed: () {},
              child: Text('The Longest text button'),
            ),
          ],
        ),
      ),
    ),
  );
}
content_copy

All you need to add is the "IntrinsicHeight" property

https://medium.com/flutter-community/flutter-layout-cheat-sheet-5363348d037e

>> Browse more code snippets

more_vert