How to get a dynamic layout in Flutter?

336 views
Skip to first unread message

Lavan Sri Chandrahasan

unread,
May 4, 2018, 3:40:22 AM5/4/18
to Flutter Dev
What Layout/Widget should I use inside the container (scrollable vertically, fixed size) to place text and images to be positioned preferably centered within the container? 
Please also note that the text also can have different font size and not necessarily a single line and image sizes can also be varied.

If I have to use Flow Layout, it would be great help if someone could also give me a simple example, because I have found almost no example for the usage of Flow Layout and I'm pretty much unable to grasp the actual usage of the Flow Delegate class.




Regards
Lavan


Brian Duffy

unread,
May 4, 2018, 10:58:46 AM5/4/18
to Flutter Dev
Maybe you can use "center" eg ...

...
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Reading and Writing Files'),
),
body: Center(
child: Column(
...

Lavan Sri Chandrahasan

unread,
May 4, 2018, 12:25:46 PM5/4/18
to Flutter Dev


Center combined with Column will just arrange all the Widgets vertically in the middle of the container.

Say when I tried to use Wrap, it would come out like this

The last widget "Laurens" in the bottom isn't where I'd want it to be, I'd prefer if there is a layout/way for widgets to automatically fit into any available free position close to the start. So in this case that bottom "Laurens" widget would be better if it could go to the top instead of leaving a very large empty space.Near the blue Card/image.

Regards
Lavan
Reply all
Reply to author
Forward
0 new messages