0 points

How to make width of all widgets inside Column equal the widest widget


dashboard

Wed Jan 22 2020 18:35:33 GMT+0000 (UTC)

Posted by @loop_ifthen #dart #flutter #layout

Widget build(BuildContext context) {
  return Scaffold(
    appBar: AppBar(title: Text('IntrinsicWidth')),
    body: Center(
      child: IntrinsicWidth(
        child: Column(
          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
https://medium.com/flutter-community/flutter-layout-cheat-sheet-5363348d037e

>> Browse more code snippets

more_vert