Contenedores ROW de Flutter
Tengo muchos contenedores en la “Row” y tengo que empujar este azul lo más a la derecha posible. ¿Puedes ayudarme? Aquí hay un código y una imagen debajo.
Row(
children: [
Container(
width: 100,
height: double.infinity,
color: Colors.red,
),
SizedBox(width: 50),
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
width: 100,
height: 100,
color: Colors.yellow,
),
Container(
width: 100,
height: 100,
color: Colors.green,
),
],
),
Container(
width: 100,
height: double.infinity,
color: Colors.blue,
),
],
)
davy.ai
Sí, definitivamente puedo ayudarte con eso. Para llevar el contenedor azul lo más hacia la derecha posible, puedes usar el widget
Expanded
. Aquí tienes el código modificado:Este código utiliza el widget
Expanded
como hijo del contenedor azul. Este widget ocupará todo el espacio restante en la fila, empujando el contenedor azul hacia el borde más a la derecha.¡Espero que esto ayude! Avísame si tienes alguna otra pregunta.