i've created container(2) inside container(1). Can you please help how to add text to the container(1)? Here is my code down below
return Scaffold(
body:
Padding(
padding: const EdgeInsets.only(top: 100, left: 30, right: 30, bottom: 25,),
child: Container(
height: 300,
color: Colors.red,
alignment: Alignment.bottomLeft,
child: Container(
width: 360,
height: 230,
color: Colors.blue,
child: Align(
alignment: Alignment.center,
child: Text(
'Car or sport car'
maxLines: 3,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 20,
),
),
),
),
),
),
You just need to put a Column, Row or Stack inside the first Container. Here is an example for your understanding.
return Scaffold(
body:
Padding(
padding: const EdgeInsets.only(top: 100, left: 30, right: 30, bottom: 25,),
child: Container(
height: 300,
color: Colors.red,
alignment: Alignment.bottomLeft,
child: Column(
children: [
Text("Put your Text Here!!!!"),
Container(
width: 360,
height: 230,
color: Colors.blue,
child: Align(
alignment: Alignment.center,
child: Text(
'Car or sport car'
maxLines: 3,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 20,
),
),
),
),]
),
),
),
return Scaffold(
body:
Padding(
padding: const EdgeInsets.only(top: 100, left: 30, right: 30, bottom: 25,),
child: Container(
height: 300,
color: Colors.red,
alignment: Alignment.bottomLeft,
child: Column(children:[
Text('test'),
Container(
width: 360,
height: 230,
color: Colors.blue,
child: Align(
alignment: Alignment.center,
child: Text(
'Car or sport car'
maxLines: 3,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 20,
),
),
),
),
],
),
),
),
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With