Dpedrinha
Dpedrinha

Reputation: 4230

How to force Rows to fill horizontal space in a Positioned Column inside a Stack in flutter?

Here's my widget tree:

Stack(
  children:[
    IrrelevantWidget(),
    Positioned(
      right: 0,
      top: 0,
      child: Container(
        child: Column(
          children: [
            Row(...),
            Row(...),
            Row(...),
            ...

It works fine, but I'd like all the Row() to have the same width as the widest Row(). The Container() containing the Column() has the width of the widest Row(), but I can't find a way to stretch the other Row() to the full width of the Container().

Everything I tried either breaks the view with a paint error or enlarges the Container() to the full width of the screen due to the nature of Stack().

Is it possible?

Upvotes: 2

Views: 479

Answers (2)

PixelToast
PixelToast

Reputation: 965

Wrapping that Column in IntrinsicWidth should expand each Row to the largest of all the children of the Column.

Upvotes: 1

Vettiyanakan
Vettiyanakan

Reputation: 8510

Check boxy: ^2.0.6+2 here, it provides utilities for flex, custom multi-child layouts, dynamic widget inflation, slivers, and more

Upvotes: 1

Related Questions