I'm new to flutter, I'm trying to change size of a container, but it not change even i change height:150 and width=150, I just want green screen show about 1/5 screen, but i really don't know how to fix this. I don't understand why, when changing the height and width of the Container, nothing will change
here is code
return Container(
decoration: new BoxDecoration(color: Colors.white),
child: new MaterialApp(
title: "Sample",
debugShowCheckedModeBanner: false,
home: Container(
height: 150.0,
decoration: BoxDecoration(
color: Colors.green,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(30),
bottomRight: Radius.circular(30),
)),
child: Stack(
children: [
Positioned(
top: 150,
left: 0,
child: Row(
children: <Widget>[
SvgPicture.asset(
user,
width: 60,
height: 60,
),
SizedBox(
width: 10,
),
Text(
"Welcome back, $username",
style: TextStyle(
fontSize: 20,
fontFamily: fontRegular,
decoration: TextDecoration.none,
color: Colors.white,
),
),
SizedBox(
width: 10,
),
Container(
padding: const EdgeInsets.all(5.0),
decoration: BoxDecoration(
border: Border.all(width: 1.5, color: Colors.black),
color: Color.fromRGBO(230, 230, 230, 1),
borderRadius: BorderRadius.circular(30),
),
child: Row(
children: [
SvgPicture.asset(
"assert\\dollar.svg",
height: 25,
width: 25,
),
Text(
'$coinValue',
style: TextStyle(
fontSize: 18,
color: Colors.black,
decoration: TextDecoration.none),
),
],
),
),
SizedBox(
width: 13,
),
],
),
),
],
),
),
),
);
}
Here is result
i just want something like this
hope this helps you:
Add Scaffold around the inner container (the one with height 150 )... and you don't need the stack and positioned(the content won't show up if you don't remove them):
MaterialApp(
title: "Sample",
debugShowCheckedModeBanner: false,
home: Scaffold(
body: Container(
height: 150.0,
decoration: ...
Rewrite your code as below:
home: Scaffold(
body: SafeArea(
child: Container(
height: 150.0,
decoration: BoxDecoration(
color: Colors.green,
),
child: Row(
children: <Widget>[
SizedBox(
width: 10,
),
Text(
"Welcome back",
style: TextStyle(
fontSize: 20,
//fontFamily: fontRegular,
decoration: TextDecoration.none,
color: Colors.white,
),
),
SizedBox(
width: 10,
),
Container(
padding: const EdgeInsets.all(5.0),
decoration: BoxDecoration(
border: Border.all(width: 1.5, color: Colors.black),
color: Color.fromRGBO(230, 230, 230, 1),
borderRadius: BorderRadius.circular(30),
),
child: Row(
children: [
Text(
'dsfsfsf',
style: TextStyle(
fontSize: 18,
color: Colors.black,
decoration: TextDecoration.none),
),
],
),
),
SizedBox(
width: 13,
),
],
),
),
),
),
You have the Stack widget inside your Container widget. That is why it is taking the whole screen. Try removing the Stack widget.
return Container(
decoration: new BoxDecoration(color: Colors.white),
child: new MaterialApp(
title: "Sample",
debugShowCheckedModeBanner: false,
home: Container(
height: 150.0,
decoration: BoxDecoration(
color: Colors.green,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(30),
bottomRight: Radius.circular(30),
)),
child: Positioned(
top: 150,
left: 0,
child: Row(
children: <Widget>[
SvgPicture.asset(
user,
width: 60,
height: 60,
),
SizedBox(
width: 10,
),
Text(
"Welcome back, $username",
style: TextStyle(
fontSize: 20,
fontFamily: fontRegular,
decoration: TextDecoration.none,
color: Colors.white,
),
),
SizedBox(
width: 10,
),
Container(
padding: const EdgeInsets.all(5.0),
decoration: BoxDecoration(
border: Border.all(width: 1.5, color: Colors.black),
color: Color.fromRGBO(230, 230, 230, 1),
borderRadius: BorderRadius.circular(30),
),
child: Row(
children: [
SvgPicture.asset(
"assert\\dollar.svg",
height: 25,
width: 25,
),
Text(
'$coinValue',
style: TextStyle(
fontSize: 18,
color: Colors.black,
decoration: TextDecoration.none),
),
],
),
),
SizedBox(
width: 13,
),
),
],
),
),
),
);
Do as follows
Container(
height: 150,
decoration: BoxDecoration(
color: Colors.green,
borderRadius: BorderRadius.only(
bottomRight: Radius.circular(20),
bottomLeft: Radius.circular(20))),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
CircleAvatar(
radius: 30.0,
backgroundImage: NetworkImage('https://via.placeholder.com/150'),
backgroundColor: Colors.transparent,
),
Expanded(child:Text("Hey there, Welcome back LQK!")),
Container(
width:100,
padding: const EdgeInsets.all(5.0),
decoration: BoxDecoration(
border: Border.all(width: 1.5, color: Colors.black),
color: Color.fromRGBO(230, 230, 230, 1),
borderRadius: BorderRadius.circular(30),
),
child: Row(
children: [
Icon(Icons.search) //put your desired icon here
],
),
),
],
)
Related
I'm new in Flutter,
I have a Container which child is Stack that using Positioned inside.
My problem is Container just taking Non-Positioned widget size.
Here is my problem:
I want something like this:
Here is my Widget code:
class CheckUpItem extends StatelessWidget {
const CheckUpItem({
Key? key,
}) : super(key: key);
#override
Widget build(BuildContext context) {
return SizedBox(
width: 100,
child: Container(
decoration: const BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(5)),
color: Colors.white,
border: Border.fromBorderSide(
BorderSide(
width: 1,
color: Color(0xFFBAD9F8),
),
),
boxShadow: [
BoxShadow(
color: Color(0x00000029),
offset: Offset(2, 3),
blurRadius: 2,
),
],
),
child: Column(
children: [
ClipRRect(
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(4),
topRight: Radius.circular(4),
),
child: Container(
decoration: const BoxDecoration(
color: Color(0xFFE6F6FF),
border: Border(
bottom: BorderSide(
width: 1,
color: Color(0xFFBAD9F8),
),
),
),
child: Consumer(
builder: (context, ref, child) {
return Center(
child: Text(
'BMI',
style: const TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,
height: 1.43,
color: Color(0xFF6B6B6B),
),
),
);
},
),
),
),
Container(
padding: const EdgeInsets.only(top: 5.5, bottom: 4),
child: Column(
children: [
Stack(
clipBehavior: Clip.none,
children: [
Container(
width: 36,
height: 36,
decoration: const BoxDecoration(
shape: BoxShape.circle,
border: Border.fromBorderSide(
BorderSide(
width: 2,
color: Color(0xFFBF3D3D),
),
),
color: Color(0xFFF86060),
),
child: const Center(
child: Text(
'B',
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
height: 1,
fontSize: 20,
),
),
),
),
Positioned(
bottom: -6,
left: 26,
child: Container(
width: 22,
height: 22,
padding: const EdgeInsets.fromLTRB(1, 0, 3, 2),
decoration: const BoxDecoration(
border: Border.fromBorderSide(
BorderSide(
width: 1,
color: Color(0xFF6A8FD4),
),
),
color: Color(0xFFE0EEFC),
shape: BoxShape.circle,
),
child: SvgPicture.asset(ImageAssets.speaker),
),
),
],
),
const SizedBox(height: 6),
],
),
),
],
),
),
);
}
}
I'm stucking all day with this, I'm tempary using Column and const SizedBox(height: 6) for fake height.
How to make it right way?
P/s: Sorry, my English is not good!
Because every thing is static hear and you know how much the svg container going down, you can calculate it and add it to padding bottom, like this:
Container(
padding: const EdgeInsets.only(top: 5.5, bottom: 10), // 4 + 6(Positioned bottom)
child: Stack(
clipBehavior: Clip.none,
children: [
Container(
width: 36,
height: 36,
decoration: const BoxDecoration(
shape: BoxShape.circle,
border: Border.fromBorderSide(
BorderSide(
width: 2,
color: Color(0xFFBF3D3D),
),
),
color: Color(0xFFF86060),
),
child: const Center(
child: Text(
'B',
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
height: 1,
fontSize: 20,
),
),
),
),
Positioned(
bottom: -6,
left: 26,
child: Container(
height: 22,
width: 22,
decoration: const BoxDecoration(
border: Border.fromBorderSide(
BorderSide(
width: 1,
color: Color(0xFF6A8FD4),
),
),
color: Color(0xFFE0EEFC),
shape: BoxShape.circle,
),
child: SvgPicture.asset(
'assets/images/tes.svg',
),
),
),
],
),
),
I have made a Login Screen, the problem is I am getting a black stripe at the end of my screen, while in my code I have'nt added any color at the end, moreover I thought that this might because of sizebox, but even if I remove it, nothing really happens. Moreover at first when I was creating and debugging this code, there was no such line and once everything is done, it started appearing at the bottom..
Here's the output picture:
Here's my UI code:
Widget build(BuildContext context) {
return SafeArea(
child: Scaffold(
body: SingleChildScrollView(
child: Container(
padding: EdgeInsets.symmetric(vertical: 40),
width: double.infinity,
decoration: BoxDecoration(
gradient: LinearGradient(begin: Alignment.topCenter, colors: [
Colors.black,
Colors.black87,
Color(0xff0a0b0d),
])),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
height: 70,
),
Padding(
padding: EdgeInsets.all(20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
"Login",
style: TextStyle(color: Colors.white, fontSize: 30,fontFamily: 'Signatra'),
),
SizedBox(
height: 10,
),
Text(
"Welcome to T Post",
style: TextStyle(color: Colors.white, fontSize: 30, fontFamily: 'Signatra'),
),
],
),
),
Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(50),
topRight: Radius.circular(50),
)),
child: Padding(
padding: EdgeInsets.all(20),
child: Column(
children: <Widget>[
Container(
padding: EdgeInsets.all(20),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(10),
boxShadow: [
BoxShadow(
color: Color.fromARGB(220, 90, 30, 10),
blurRadius: 20,
offset: Offset(0, 10),
)
]),
child: Column(
children: <Widget>[
Container(
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey.shade200))),
child: TextField(
decoration: InputDecoration(
hintText: "Phone Number",
hintStyle: TextStyle(color: Colors.grey),
border: InputBorder.none,
),
),
),
Container(
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey.shade200))),
child: TextField(
decoration: InputDecoration(
hintText: "Password",
hintStyle: TextStyle(color: Colors.grey),
border: InputBorder.none,
),
),
)
],
),
),
SizedBox(
height: 40,
),
Text(
"Forget Password",
style: TextStyle(color: Colors.grey),
),
SizedBox(
height: 40,
),
Container(
height: 50,
margin: EdgeInsets.symmetric(horizontal: 50),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(50),
color: Color(0xff0a0b0d),
),
child: Center(
child: Text(
"Login",
style: TextStyle(
color: Colors.white,
fontSize: 18,
fontWeight: FontWeight.bold),
),
),
),
SizedBox(
height: 60,
),
Text(
"Continue with social media",
style: TextStyle(
color: Colors.grey,
),
),
SizedBox(
height: 20,
),
Row(
children: <Widget>[
Expanded(
child: Container(
height: 50,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(50),
color: Colors.blueAccent,
),
child: Center(
child: Text(
"Twitter",
style: TextStyle(color: Colors.white),
),
),
),
),
SizedBox(
width: 30,
),
Expanded(
child: Container(
height: 50,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(50),
color: Colors.deepPurpleAccent,
),
child: Center(
child: Text(
"Skype",
style: TextStyle(color: Colors.white),
),
),
),
),
SizedBox(
width: 30,
),
],
)
],
),
),
)
],
),
),
),
),
);
}
It looks like you have containers wrapping their content, so it appears like a stripe. Try having one of the containers filling the screen instead of wrapping the content. What happens when you make the following change to the SingleChildScrollView?
Container(
padding: EdgeInsets.symmetric(vertical: 40),
width: double.infinity,
height: MediaQuery.of(context).size.height, // <<<<<< Add this line.
decoration: BoxDecoration(
gradient: LinearGradient(begin: Alignment.topCenter, colors: [
Colors.black,
Colors.black87,
Color(0xff0a0b0d),
]))
Now I am trying to draw a container with the radius border to intersect with another container
But there is a line that remains visible around each container as shown in the picture Does anyone know how to hide it!
there is my code for that
Container(
height: MediaQuery.of(context).size.height * .47,
width: MediaQuery.of(context).size.width,
decoration: BoxDecoration(
color: Color.fromRGBO(28, 163, 200, 1),
border: null,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(30.0),
//bottomLeft: Radius.circular(40.0),
),
),
),
Container(
color: Colors.transparent,
child: Container(
width: MediaQuery.of(context).size.width,
color: Color.fromRGBO(28, 163, 200, 1),
child: Container(
width: MediaQuery.of(context).size.width,
decoration: BoxDecoration(
color: Color.fromRGBO(247, 250, 251, 1),
border: null,
borderRadius: BorderRadius.only(
topRight: Radius.circular(30.0),
//bottomLeft: Radius.circular(40.0),
),
),
child: Padding(
padding: const EdgeInsets.only(left: 20, right: 20, top: 20),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Text(
"القائمة",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18,
color: Colors.black),
),
Spacer(),
Text(
"عرض الكل",
style: TextStyle(
fontSize: 14,
color: Color.fromRGBO(255, 140, 0, 1)),
),
],
),
),
),
),
),
sounds like a renderer artifact, if you change the top container height ratio it goes away
height: MediaQuery.of(context).size.height * .47, // <-- change this to be 0.5
if you really want that particular height, then use a Stack() rather than embedded Containers
if you change the hight of the container it will render correctly. I have attached a screenshot of the result I get with this:
Column(
children: [
Container(
height: 300, //<--- This is what's causing the issue
width: MediaQuery.of(context).size.width,
decoration: BoxDecoration(
color: Color.fromRGBO(28, 163, 200, 1),
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(30.0),
//bottomLeft: Radius.circular(40.0),
),
),
),
Container(
// color: Colors.transparent,
child: Container(
width: MediaQuery.of(context).size.width,
decoration: BoxDecoration(
color: Color.fromRGBO(28, 163, 200, 1),
),
child: Container(
width: MediaQuery.of(context).size.width,
decoration: BoxDecoration(
color: Color.fromRGBO(247, 250, 251, 1),
borderRadius: BorderRadius.only(
topRight: Radius.circular(30.0),
//bottomLeft: Radius.circular(40.0),
),
),
child: Padding(
padding: const EdgeInsets.only(left: 20, right: 20, top: 20),
child: Row(
children: [
Text(
"القائمة",
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18, color: Colors.black),
),
Spacer(),
Text(
"عرض الكل",
style: TextStyle(fontSize: 14, color: Color.fromRGBO(255, 140, 0, 1)),
),
],
),
),
),
),
),
],
)
I am trying to apply the same concept of instagram to go from one feed to another.
Here i have like quiz1 part and i want to go to the another quiz2 section on tapping to to the right side and after pressing left side i want to go for quiz1 section.
Widget mainQuiz() {
return Column(
children: [
Spacer(
flex: 1,
),
Container(
padding: EdgeInsets.all(30),
child: Text(
"When was the first spaceship NOT launched?",
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.w600,
fontSize: 24,
),
),
),
/* ---------------------OPTION 1----------------------*/
Container(
margin: EdgeInsets.only(
left: 65,
right: 65,
bottom: 15,
),
decoration: BoxDecoration(
border: Border.all(color: Colors.white),
borderRadius: BorderRadius.circular(100)),
child: Row(
children: [
Container(
margin: EdgeInsets.all(10),
child: Row(
children: [
Stack(
children: [
Container(
margin: EdgeInsets.only(right: 10),
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(color: Colors.white),
shape: BoxShape.circle,
),
child: Icon(
Icons.check,
size: 15,
color: Color(0xffFFC700),
),
)
],
),
Text(
"Last Tuesday",
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
],
),
),
Spacer(),
Container(
constraints: BoxConstraints.expand(
height: 40,
width: 50,
),
decoration: BoxDecoration(
color: Colors.black,
borderRadius: BorderRadius.only(
topRight: Radius.circular(100),
bottomRight: Radius.circular(100),
),
),
child: Center(
child: Text(
"55%",
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
),
],
),
),
/* ---------------------OPTION 2----------------------*/
Container(
margin: EdgeInsets.only(
left: 65,
right: 65,
bottom: 15,
),
decoration: BoxDecoration(
border: Border.all(color: Colors.white),
borderRadius: BorderRadius.circular(100)),
child: Row(
children: [
Container(
margin: EdgeInsets.all(10),
child: Row(
children: [
Stack(
children: [
Container(
margin: EdgeInsets.only(right: 10),
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(color: Colors.white),
shape: BoxShape.circle,
),
child: Icon(
Icons.check,
size: 15,
color: Color(0xffFFC700),
),
)
],
),
Text(
"1969",
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
],
),
),
Spacer(),
Container(
constraints: BoxConstraints.expand(
height: 40,
width: 50,
),
decoration: BoxDecoration(
color: Colors.black,
borderRadius: BorderRadius.only(
topRight: Radius.circular(100),
bottomRight: Radius.circular(100),
),
),
child: Center(
child: Text(
"45%",
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
),
],
),
),
/* ---------------------OPTION 3----------------------*/
Container(
margin: EdgeInsets.only(
left: 65,
right: 65,
bottom: 15,
),
padding: EdgeInsets.only(left: 10, right: 10, top: 10, bottom: 10),
decoration: BoxDecoration(
border: Border.all(color: Colors.white),
borderRadius: BorderRadius.circular(100)),
child: Row(
children: [
Stack(
children: [
Container(
margin: EdgeInsets.only(right: 10),
decoration: BoxDecoration(
border: Border.all(color: Colors.white),
shape: BoxShape.circle,
),
child: SizedBox(
height: 15,
width: 15,
),
)
],
),
Text(
"1957",
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
],
),
),
Spacer(
flex: 2,
),
],
);
}
like this is quiz one section i want to go to the second quiz section which i can take as same ui
I would wrap your "mainQuiz" inside a Stack widget.
In that way you could add other 2 Containers inside the Stack's children.
Those containers could be positioned using "Positioned" widget.
One on the left of the screen and one on the right.
You should give then the size too.
I would let them transparent and I would give them a "GestureDetector" or something to detect the tap and call the Navigator to change screen.
As per your requirement, I think you should use
PageView
By default it has the swipe feature to go to the next and previous screen.
EDIT:-
As per you requirements, you know that you have a screen which already have interaction in form of giving answers, which has to be done using clicks. Though you can place empty containers in stack to implement clicks for left right, but as container need to have some width, thus they will overlap with you answers because basic padding is not more than 20. Thus I think you should go for swipe or specified buttons to go the left right i.e next and previous question.
I am building the column in flutter as below code which has a nested ListView.Builder,
but it is giving display error of RenderFlex, how should I resolve it?
A RenderFlex overflowed by 116 pixels on the bottom.
Column(
children: [
SizedBox(height: 25,),
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment:CrossAxisAlignment.center,
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment:CrossAxisAlignment.center,
children: <Widget>[
//order container
Container(
height: 32,
width: 160,
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(
width:0.5,
color: Color(0xFF766F6F),
),
borderRadius: BorderRadius.circular(10.0),
),
child: Center(
child: Text('Order Date',
style: TextStyle(backgroundColor: Colors.white,
color:Color(0xFF2e2a2a),
fontFamily: 'Roboto',
fontSize: 12,
),
),
),
),
Container(
height: 32,
width: 160,
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(
width:0.5,
color: Color(0xFF766F6F),
),
borderRadius: BorderRadius.circular(10.0),
),
child: Center(
child: Text('19 May 2020'),
),
),
],),
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment:CrossAxisAlignment.center,
children: <Widget>[
Container(
height: 32,
width: 160,
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(
width:0.5,
color: Color(0xFF766F6F),
),
borderRadius: BorderRadius.circular(10.0),
),
child: Center(
child: Text('Party',
style: TextStyle(backgroundColor: Colors.white,
color:Color(0xFF2e2a2a),
fontFamily: 'Roboto',
fontSize: 12,
),),
),
),
Container(
height: 32,
width: 160,
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(
width:0.5,
color: Color(0xFF766F6F),
),
borderRadius: BorderRadius.circular(10.0),
),
child: Center(
child: Text('Vardhman Textiles Ltd', style: TextStyle(backgroundColor: Colors.white,
color:Color(0xFF2e2a2a),
fontFamily: 'Roboto',
fontSize: 12,
),),
),
),
],),
],),
SizedBox(height: 30,),
ListView.separated(
separatorBuilder:
(BuildContext context, int index) {
return SizedBox(
height: 16,
);
},
shrinkWrap: true,
itemCount: snapshot.data.content[key].length,
itemBuilder: (context, index) {
return Column(
children: [
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
height: 40,
width: 320,
decoration: BoxDecoration(
color: Color(0xFFFF0000),
border: Border.all(
color: Color(0xFFFF0000),
),
borderRadius: BorderRadius.circular(10.0),
),
child: Center(
child: Text('ITEM DETAILS - ' + "1/2",
style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold,
fontFamily: 'Roboto',
fontSize: 20,
),
),
),
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment:CrossAxisAlignment.center,
children: <Widget>[
Container(
height: 32,
width: 160,
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(
width:0.5,
color: Color(0xFF766F6F),
),
borderRadius: BorderRadius.circular(10.0),
),
child: Center(
child: Text("Catalog Item", style: TextStyle(backgroundColor: Colors.white,
color:Color(0xFF2e2a2a),
fontFamily: 'Roboto',
fontSize: 12,
),
),
),
),
Container(
height: 32,
width: 160,
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(
width:0.5,
color: Color(0xFF766F6F),
),
borderRadius: BorderRadius.circular(10.0),
),
child: Center(
child: Text(snapshot
.data.content[key][index][0].sodPk, style: TextStyle(backgroundColor: Colors.white,
color:Color(0xFF2e2a2a),
fontFamily: 'Roboto',
fontSize: 12,
),
),
),
),
],),
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment:CrossAxisAlignment.center,
children: <Widget>[
Container(
height: 32,
width: 160,
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(
width:0.5,
color: Color(0xFF766F6F),
),
borderRadius: BorderRadius.circular(10.0),
),
child: Center(
child: Text('QTY.', style: TextStyle(backgroundColor: Colors.white,
color:Color(0xFF2e2a2a),
fontFamily: 'Roboto',
fontSize: 12,
),
),
),
),
Container(
height: 32,
width: 160,
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(
width:0.5,
color: Color(0xFF766F6F),
),
borderRadius: BorderRadius.circular(10.0),
),
child: Center(
child: Text('10', style: TextStyle(backgroundColor: Colors.white,
color:Color(0xFF2e2a2a),
fontFamily: 'Roboto',
fontSize: 12,
),),
),
),
],),
],
),
],
);
},
)
],
)
Please guide me as I am new to the flutter learning, thanks, I am trying to use Stack, but no good,
When I used stack the first child column was overlapped by the listview.builder, so removed it,
Please guide me the resolution
You can try wrap your ListView.separated with Expanded Widget. What expanded do is expands a child of a Row, Column, or Flex so that the child fills the available space. So it won't overflow