Align widget to bottom of sibling column - flutter

I'm having trouble recreating the layout in the screenshot that follows two rules:
The height of both Column is decided by the Column on the left, as the content (blue container) can be vary in different cases.
The Column on the right should the same height than the column on the left and it's children (yellow and red containers) should be aligned to the top and bottom of the column accordingly.
This is what I currently have
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
#override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
home: Container(
color: Colors.black12.withOpacity(0.1),
padding: const EdgeInsets.all(24),
child: Row(
children: [
Container(
padding: const EdgeInsets.all(24),
color: Colors.green,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
height: 500,
width: 200,
color: Colors.blue,
)
],
),
),
Container(
padding: const EdgeInsets.all(24),
color: Colors.greenAccent,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
padding: const EdgeInsets.all(24),
height: 100,
width: 200,
color: Colors.yellow,
),
Container(
padding: const EdgeInsets.all(24),
height: 100,
width: 200,
color: Colors.red,
),
],
),
),
],
),
),
);
}
}
And it looks like this:
Now onto the things I have tried and the problems:
Change right colum to mainAxisSize: MainAxisSize.max, results in the right column deciding the height.
Add Spacer in between the yellow and red container results in the right column expanding to the max height.
So the question is:
How can I constrain the height of the right column so
follows the height of the left column without taking all the available height
keeping the height of the entire layout dynamic (so no hardcoded heights for the blue container or left column)
Aligns containers on the right column to the top and bottom of the the right column.
I have the feeling that I'm missing something or need a special widget that I'm not aware of. Maybe some advance usage of Flexible?
Any ideas or tips are more than welcome.
Thanks.
========================
Full solution based on #Ivo Beckers answer.
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
#override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
home: Container(
color: Colors.black12.withOpacity(0.1),
padding: const EdgeInsets.all(24),
child: Center(
child: IntrinsicHeight(
child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Container(
padding: const EdgeInsets.all(24),
color: Colors.green,
child: SingleChildScrollView(
child: Column(
children: [
Container(
height: 500,
width: 200,
color: Colors.blue,
)
],
),
),
),
Container(
padding: const EdgeInsets.all(24),
color: Colors.greenAccent,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
padding: const EdgeInsets.all(24),
height: 200,
width: 200,
color: Colors.yellow,
),
Container(
padding: const EdgeInsets.all(24),
height: 50,
width: 200,
color: Colors.red,
),
],
),
),
],
),
),
),
),
);
}
}

I got your example to work like this
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
#override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
home: Container(
color: Colors.black12.withOpacity(0.1),
padding: const EdgeInsets.all(24),
child: Align(
child: IntrinsicHeight(
child: Row(
children: [
Container(
padding: const EdgeInsets.all(24),
color: Colors.green,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
height: 500,
width: 200,
color: Colors.blue,
)
],
),
),
Container(
padding: const EdgeInsets.all(24),
color: Colors.greenAccent,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
padding: const EdgeInsets.all(24),
height: 100,
width: 200,
color: Colors.yellow,
),
const Spacer(),
Container(
padding: const EdgeInsets.all(24),
height: 100,
width: 200,
color: Colors.red,
),
],
),
),
],
),
),
),
),
);
}
}
So basically the Row is wrapped in an IntrinsicHeight and that one in an Align. Just an IntrinsicHeight didn't seem to help. Furthermore a Spacer() between the Containers in the second Column

try this code..
#override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
home: Container(
color: Colors.white,
child: Row(
children: [
Flexible(child: Container(
height: MediaQuery.of(context).size.height,
padding: const EdgeInsets.all(24),
color: Colors.green,
child: Container(
height: 500,
width: MediaQuery.of(context).size.width,
color: Colors.blue,
),
),flex: 1,),
const SizedBox(width: 2.0,),
Flexible(child: Container(
height: MediaQuery.of(context).size.height,
padding: const EdgeInsets.all(24),
color: Colors.greenAccent,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
padding: const EdgeInsets.all(24),
height: 100,
width: 200,
color: Colors.yellow,
),
Container(
padding: const EdgeInsets.all(24),
height: 50,
width: 200,
color: Colors.red,
),
],
),
),flex: 1,)
],
),
),
);
}

Related

Flutter - Problem about container with Network Image aligned to right and text aligned to left

I'm trying to create a simple Container includes;
A text aligned to center left (that text can include 50 characters)
A network image which is aligned to bottom right, rotated a bit, and rounded.
I've written a code like this:
import 'package:flutter/material.dart';
class MyScreen extends StatefulWidget {
static const String idScreen = "myScreen";
#override
_MyScreenState createState() => _MyScreenState();
}
class _MyScreenState extends State<MyScreen> {
#override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text("My Screen")),
body: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
width: 200,
height: 100,
alignment: Alignment.bottomRight,
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadiusDirectional.circular(16.0),
color: Colors.yellow),
child: Row(
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Flexible(
child: Text(
"Baby",
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
),
),
),
),
Transform(
child: Image.network(
"https://target.scene7.com/is/image/Target/Baby-210913-1631564062108?wid=315&hei=315&qlt=60&fmt=webp",
fit: BoxFit.contain,
),
transform: Matrix4.rotationZ(-0.2),
alignment: FractionalOffset.centerRight,
),
],
),
),
),
);
}
}
and the output is;
My output has some problems.
I want the container to be wide left-right and has 8 padding from the right and left.
I want the network picture to be bottom right with only its rounded picture, not as white square.
-- EDIT --
I've changed my code like;
import 'package:flutter/material.dart';
class MyScreen extends StatefulWidget {
static const String idScreen = "myScreen";
#override
_MyScreenState createState() => _MyScreenState();
}
class _MyScreenState extends State<MyScreen> {
#override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text("My Screen")),
body: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
width: MediaQuery.of(context).size.width,
height: 100,
alignment: Alignment.center,
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadiusDirectional.circular(16.0),
color: Colors.yellow),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
"Baby",
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
),
),
),
Container(
width: 50,
height: 50,
decoration: const BoxDecoration(
shape: BoxShape.circle,
image: DecorationImage(
fit: BoxFit.contain,
image: NetworkImage(
"https://target.scene7.com/is/image/Target/Baby-210913-1631564062108?wid=315&hei=315&qlt=60&fmt=png"
)
)
),
),
],
),
),
),
);
}
}
But now there is no rotation on picture, and it is not aligned to bottom right. Output:
To get the container wide you should change its width from 200 to width of your screen using Mediaquery.
eg : MediaQuery.of(context).size.width
That image has a white background also its square. You should use an image with transparent background.
Add this to your row : mainAxisAlignment: MainAxisAlignment.spaceBetween this will move the image to right end and text to left.
Hope that is what you meant and this helps.
Edit
I made some changes and now your code looks like this :
Container(
color: Colors.yellow,
height: 100,
width: Constants(context).scrnWidth,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
"Baby",
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
),
),
),
Container(
height: 100,
child: Align(
alignment: Alignment.bottomCenter,
child: Transform.rotate(
angle: -0.3,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
width: 50,
height: 50,
decoration: const BoxDecoration(
shape: BoxShape.circle,
image: DecorationImage(
fit: BoxFit.contain,
image: NetworkImage(
"https://target.scene7.com/is/image/Target/Baby-210913-1631564062108?wid=315&hei=315&qlt=60&fmt=png"))),
),
),
),
),
),
],
),
),

Container is not center aligned in stack

I have simple application, and I try to center a circular image in the screen with the following:
main.dart:
import 'package:flutter/material.dart';
import './widgets/mashoff.dart';
void main() => runApp(_MyApp());
class _MyApp extends StatelessWidget {
#override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
toolbarHeight: 0,
backgroundColor: Colors.black, // status bar color
),
body: WMashoff(),
),
);
}
}
WMashoff widget:
import 'package:flutter/material.dart';
import './mashoff-item.dart';
class WMashoff extends StatelessWidget {
#override
Widget build(BuildContext context) {
return SafeArea(
child: Stack(
children: <Widget>[
Column(
children: <Widget>[
Expanded(
child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
WMashoffItem(
'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTkMKry-Vcp7oU4erjWxG4pXhfva0weO4n4_g&usqp=CAU',
Alignment.topLeft,
),
WMashoffItem(
'https://hotforsecurity.bitdefender.com/wp-content/uploads/2019/12/pexels-photo-1090393-1024x682.jpg',
Alignment.topRight,
),
],
),
),
Expanded(
child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
WMashoffItem(
'https://images.indianexpress.com/2019/07/tiktok.jpg',
Alignment.bottomLeft,
),
WMashoffItem(
'https://www.gannett-cdn.com/-mm-/b4f5f67b6112c6935b66ff0cbffc204774fdc87c/c=0-0-3022-1700/local/-/media/2020/08/18/PalmBeachPost/ghows-LK-200819292-73c48e6d.jpg?width=660&height=372&fit=crop&format=pjpg&auto=webp',
Alignment.bottomRight,
),
],
),
),
],
),
Container(
height: 70,
width: 70,
alignment: Alignment.center,
decoration: BoxDecoration(
boxShadow: <BoxShadow>[
const BoxShadow(
color: Colors.black87,
spreadRadius: 5,
blurRadius: 3,
offset: const Offset(0, 3), // changes position of shadow
),
],
image: const DecorationImage(
image: const NetworkImage('http://i.imgur.com/QSev0hg.jpg'),
fit: BoxFit.cover,
),
borderRadius: const BorderRadius.all(const Radius.circular(50)),
border: Border.all(
color: Colors.white,
width: 4,
),
),
),
],
),
);
}
}
WMashoffItem widget:
import 'package:flutter/material.dart';
class WMashoffItem extends StatelessWidget {
final Alignment _favoriteIconAlignment;
final String _img;
WMashoffItem(
this._img,
this._favoriteIconAlignment,
);
#override
Widget build(BuildContext context) {
return Expanded(
child: Stack(
fit: StackFit.expand,
children: <Widget>[
Image.network(
this._img,
fit: BoxFit.cover,
),
Container(
alignment: this._favoriteIconAlignment,
child: const IconButton(
iconSize: 50,
icon: Icon(
Icons.favorite_border,
color: Colors.red,
),
onPressed: null,
),
),
],
),
);
}
}
Please focus the 2nd stack child in the WMashoff widget code (The Container element).
Once I give this container height and width, it is no more centered.
This is the result:
As you can see the image is in the top left. But I want it in the center. Where am I wrong?
When you do:
Container(
height: 70,
width: 70,
alignment: Alignment.center,
child: MyWidget(),
),
You create a 70x70 Container and align its child in the center.
Now, what you want is to align your container at the center of the Stack:
Try this:
Stack(
children: <Widget>[
Column([...]),
Align(
alignment: Alignment.center,
child: Container(
height: 70,
width: 70,
alignment: Alignment.center,
child: MyWidget(),
),
),
],
),

Overflow visible in Expanded widget

My layout is a row with three expanded widgets.
I need overflow visible in one of the expanded widgets
This is the code
Row(
children: [
Expanded(
flex: 1,
child: Container(color: Colors.red,)
),
Expanded(
flex: 2,
child: Container(color: Colors.green,)
),
Expanded(
flex: 3,
child: Container(color: Colors.orange,)
),
],
),
Now I need to add circles like this, in of the Expanded widgets, that overflow the Expanded widget. I can't wrap the Expanded in an overflow box, so I am lost
Any help is appreciated.
Edit: I tried this with the third expanded, just to see if it will overflow, but it only overflows the SizedOverflowBox, no overflow over the Expanded
Expanded(
flex: 3,
child: SizedOverflowBox(
size: const Size(100.0, 100.0),
alignment: AlignmentDirectional.bottomCenter,
child: Container(height: 50.0, width: 1500.0, color: Colors.blue,),
),
),
It looks like it is not going to be possible
Can easily be achieved with a Stack. Please see the code below :
import 'package:flutter/material.dart';
final Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
#override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData.dark().copyWith(scaffoldBackgroundColor: darkBlue),
debugShowCheckedModeBanner: false,
home: Scaffold(
body: Center(
child: MyWidget(),
),
),
);
}
}
class MyWidget extends StatelessWidget {
#override
Widget build(BuildContext context) {
return Stack(
children: [
Row(
children: [
Expanded(
flex: 1,
child: Container(
color: Colors.red,
)),
Expanded(
flex: 2,
child: Container(
color: Colors.green,
)),
Expanded(
flex: 3,
child: Container(
color: Colors.orange,
)),
],
),
Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Container(
height: 25,
width: 25,
decoration:
BoxDecoration(color: Colors.black, shape: BoxShape.circle),
child: Center(
child: Container(
height: 15,
width: 15,
decoration: BoxDecoration(
color: Colors.white, shape: BoxShape.circle),
),
),
),
Container(
height: 25,
width: 25,
decoration:
BoxDecoration(color: Colors.black, shape: BoxShape.circle),
child: Center(
child: Container(
height: 15,
width: 15,
decoration: BoxDecoration(
color: Colors.white, shape: BoxShape.circle),
),
),
),
Container(
height: 25,
width: 25,
decoration:
BoxDecoration(color: Colors.black, shape: BoxShape.circle),
child: Center(
child: Container(
height: 15,
width: 15,
decoration: BoxDecoration(
color: Colors.white, shape: BoxShape.circle),
),
),
),
],
),
),
],
);
}
}
Please see the code for Text Bullet points overflowing.
import 'package:flutter/material.dart';
final Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
#override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData.dark().copyWith(scaffoldBackgroundColor: darkBlue),
debugShowCheckedModeBanner: false,
home: Scaffold(
appBar: AppBar(),
body: MyWidget(),
),
);
}
}
class MyWidget extends StatelessWidget {
#override
Widget build(BuildContext context) {
return Row(
children: [
Expanded(
flex: 1,
child: Container(
color: Colors.red.withAlpha(60),
child: OverflowBox(
alignment: Alignment.topLeft,
maxWidth: 400,
child: SizedBox(
width: 300,
child: Text(
'HelloHello 🅐',
style: TextStyle(color: Colors.white),
),
),
),
),
),
Expanded(
flex: 2,
child: Container(
color: Colors.green.withAlpha(60),
child: OverflowBox(
alignment: Alignment.topLeft,
maxWidth: 400,
child: SizedBox(
width: 300,
child: Container(
child: Text(
'\n\nHelloHello HelloHello 🅐\n\nHelloHello HelloHello 🅐\n\nHelloHello HelloHello 🅐\n\nHelloHello HelloHello 🅐',
style: TextStyle(color: Colors.white),
),
),
),
),
),
),
Expanded(
flex: 3,
child: Container(
color: Colors.purple.withAlpha(60),
child: OverflowBox(
alignment: Alignment.topLeft,
maxWidth: 400,
child: SizedBox(
width: 300,
child: Text(
'\n\n\n\n\n\n\n\n\n\n\n\Hello Hello Hello Hello Hello Hello ',
style: TextStyle(color: Colors.white),
),
),
),
),
),
],
);
}
}

How to add space between keyboard and focused TextField in flutter?

I have this problem with scrolling, when I focus the text field the red container covers the Textfield, where i want to write.
How can I control the scrolling, so that the Textfield shows above the red container?
I want to show the red Container above the keabord, and when the user writes in the Textfield I want to activate the nect button.
enter image description here
enter image description here
class MyHomePage extends StatefulWidget {
MyHomePage({Key key}) : super(key: key);
#override
_MyHomePageState createState() => new _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
FocusNode _focusNode = new FocusNode();
#override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: new Text("Focus Example"),
),
body: Stack(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Expanded(
flex: 9, // 90% of space => (6/(6 + 4))
child: LayoutBuilder(
builder: (context, constraint) {
return SingleChildScrollView(
child: ConstrainedBox(
constraints:
BoxConstraints(minHeight: constraint.maxHeight),
child: IntrinsicHeight(
child: Column(
children: <Widget>[
new Container(
height: 800.0,
color: Colors.blue.shade200),
new TextFormField(
focusNode: _focusNode,
decoration: new InputDecoration(
hintText: 'Focus me!',
),
),
new Container(
height: 800.0,
color: Colors.blue.shade200),
],
),
),
),
);
},
)),
Expanded(
flex: 1, // 10% of space
child: Container(
color: Colors.purple,
alignment: Alignment.center,
),
),
],
),
Align(
alignment: Alignment.bottomCenter,
child: Container(
padding: EdgeInsets.only(left: 10.0, right: 10.0),
height: 60,
color: Colors.red,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
GestureDetector(
child: Text("Back",
style:
TextStyle(color: Colors.white, fontSize: 18.0)),
onTap: () {}),
Container(
width: 40,
height: 40,
child: FlatButton(
textColor: Colors.white,
disabledColor: Colors.grey,
disabledTextColor: Colors.white70,
padding: EdgeInsets.only(top: 0.0, bottom: 0.0),
splashColor: Colors.white,
onPressed: () {},
child: Icon(
Icons.navigate_next,
size: 35,
),
),
)
],
),
),
)
],
));
}
}
I could give you an idea. Try something like this,
body: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
height: MediaQuery.of(context).size.height * 0.9 - 60,
child: Row( ..... ), // Include SingleChildScrollView too
),
Container(
padding: EdgeInsets.only(left: 10.0, right: 10.0),
height: 60,
child: Row( ... )
)
]
Hope that solves your issue.

Flutter question: How to insert a column inside a row in Flutter

My aim is to reproduce this UI layout in Flutter:
So far I have produced a layout with the below code which is missing the green square below the yellow square in the middle of the screen. How can i include the green square below the yellow square and center them? Can this be done by inserting a column inside a row? Thanks.
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
#override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
backgroundColor: Colors.teal,
body: SafeArea(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Container(
width: 100.0,
color: Colors.red,
),
Container(
width: 100.0,
height: 100.0,
color: Colors.yellow,
),
Container(
width: 100.0,
color: Colors.blue,
),
],
),
),
),
);
}
}
Simply wrap the inner container with a Column widget.
Here you go
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
#override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
backgroundColor: Colors.teal,
body: SafeArea(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Container(
width: 100.0,
color: Colors.red,
),
Column(
mainAxisAlignment:MainAxisAlignment.center ,
children: <Widget>[
Container(
width: 100.0,
height: 100.0,
color: Colors.yellow,
),
Container(
width: 100.0,
height: 100.0,
color: Colors.green,
),
],
),
Container(
width: 100.0,
color: Colors.blue,
),
],
),
),
),
);
}
}
import 'package:flutter/material.dart';
void main() => runApp(DiceApp());
class DiceApp extends StatelessWidget {
#override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
backgroundColor: Colors.teal,
appBar: AppBar(
title: Text('Dice App'),
backgroundColor: Colors.teal,
centerTitle: true,
),
body: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Container(
width: 100,
color: Colors.red,
),
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
height: 100,
width: 100,
child: Text('2'),
color: Colors.yellow,
),
Container(
height: 100,
width: 100,
child: Text('2'),
color: Colors.green,
),
],
),
Row(crossAxisAlignment: CrossAxisAlignment.stretch, children: [
Container(
width: 100,
// alignment: Alignment.center,
child: Text('1'),
color: Colors.blue,
),
])
],
),
),
);
}
}
This code gives you the same layout shown in this example
// Scroll Area
child: ListTile(
// Horizontal Row
title: Row(
children: <Widget>[
// First element in Row
ImageIcon(
AssetImage("assets/images/my_photo.png"),
),
// Second element in Row
Column(
children: [
child: Text('My name'),
Row(
children: [
child: Text('My title'),
],
Image.asset(
'assets/images/more.png',
),
),
], // End of Column children
), // End of Column
], // End of Row children
), // End of Row
), // End of Scroll
remember to add infinite height to the containers in red and blue
here is my flutter code that I made .
Create 04 containers and wrap the middle one in a column.
body: SafeArea(
child:Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
child: Text(' Container 1'),
color: Colors.red,
width: 100.0,
height: double.infinity,
),
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
child: Text(' Container 2'),
color: Colors.yellow,
width: 100.0,
height:100.0,
),
Container(
child: Text(' Container 3'),
color: Colors.green,
width: 100.0,
height:100.0,
),
],
),
Container(
child: Text('Container 4'),
color: Colors.blue,
width: 100.0,
height: double.infinity,
)
],
)),
),
);
}
}