A RenderFlex overflowed by 230 pixels on the bottom - flutter

I keep getting this error and I know how to fix it I've tried wrapping my column inside an Expanded and a Flexible widget but it doesn't seem to be working.
Here's my code :
return Scaffold(
body: Column(
children: [
//To Show Current Date
Container(
height: 30,
margin: EdgeInsets.only(left: 10),
alignment: Alignment.centerLeft,
),
SizedBox(height: 10),
//To show Calendar Widget
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Expanded(
flex : 2,
child: SingleChildScrollView(
child: Center(
child: Card(
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
const ListTile(
title: Text(
'MISSIONS',
style: TextStyle(
fontStyle: FontStyle.italic,
fontSize: 20),
textAlign: TextAlign.center,
),
),
],
),
),
),
),
),
Expanded(
flex : 8,
child: SizedBox(
height: 600.0,
child: ListView.builder(
itemCount:
3,
itemBuilder: (BuildContext context, int index) {
// box.put('missionName', missionName);
//box.put("entries",entries);
//var name = box.get('missionName');
//print('Name: $name');
return GestureDetector(
child: Card(
child: Center(
child: Container(
height: 110,
child: Row(
children: <Widget>[
Expanded(
child: Text(
'mission'),
),
SizedBox(height: 30),
Expanded(
child: GestureDetector(
child: Padding(
padding: const EdgeInsets.all(20.0),
child: Column(
children: <Widget>[
// Just a top space
// main content
Container(
child: Stack(
children: <Widget>[
// Box and icons
Stack(
children: <Widget>[
// Box
renderBox(),
// Icons
renderIcons(),
],
alignment: Alignment.bottomCenter,
),
// Button like
renderBtnLike(),
// Icons when jump
// Icon like
whichIconUserChoose == 1 && !isDragging
? Container(
child: Transform.scale(
child: Image.asset(
"images/close.png",
width: 20.0,
height: 20.0,
),
scale: this.zoomIconWhenRelease.value,
),
margin: EdgeInsets.only(
top: processTopPosition(this.moveUpIconWhenRelease.value),
left: this.moveLeftIconLikeWhenRelease.value,
),
)
: Container(),
// Icon love
whichIconUserChoose == 2 && !isDragging
? Container(
child: Transform.scale(
child: Image.asset(
"images/nowork.png",
width: 20.0,
height: 20.0,
),
scale: this.zoomIconWhenRelease.value,
),
margin: EdgeInsets.only(
top: processTopPosition(this.moveUpIconWhenRelease.value),
left: this.moveLeftIconLoveWhenRelease.value,
),
)
: Container(),
// Icon haha
whichIconUserChoose == 3 && !isDragging
? Container(
child: Transform.scale(
child: Image.asset(
"images/sunny.png",
width: 20.0,
height: 20.0,
),
scale: this.zoomIconWhenRelease.value,
),
margin: EdgeInsets.only(
top: processTopPosition(this.moveUpIconWhenRelease.value),
left: this.moveLeftIconHahaWhenRelease.value,
),
)
: Container(),
],
),
margin: EdgeInsets.only(left: 20.0, right: 20.0),
// Area of the content can drag
// decoration: BoxDecoration(border: Border.all(color: Colors.grey)),
width: double.infinity,
),
],
),
),
onHorizontalDragEnd: onHorizontalDragEndBoxIcon,
onHorizontalDragUpdate: onHorizontalDragUpdateBoxIcon,
),
)
],
),
),
),
),
);
}),
),
),
SizedBox(height: 30),
],
)),
],
),
);
This is the renderBtnLike() widget :
Widget renderBtnLike() {
return Container(
child: GestureDetector(
onTapDown: onTapDownBtn,
onTapUp: onTapUpBtn,
onTap: onTapBtn,
child: Container(
child: Row(
children: <Widget>[
// Icon like
Expanded(
child: Transform.scale(
child: Transform.rotate(
child: Image.asset(
getImageIconBtn(),
width: 10.0,
height: 10.0,
fit: BoxFit.contain,
color: getTintColorIconBtn(),
),
angle:
!isLongPress ? handleOutputRangeTiltIconLike(tiltIconLikeInBtn2.value) : tiltIconLikeInBtn.value,
),
scale:
!isLongPress ? handleOutputRangeZoomInIconLike(zoomIconLikeInBtn2.value) : zoomIconLikeInBtn.value,
),
),
// Text like
Expanded(
child: Transform.scale(
child: Text(
getTextBtn(),
style: TextStyle(
color: getColorTextBtn(),
fontSize: 8.0,
fontWeight: FontWeight.bold,
),
),
scale:
!isLongPress ? handleOutputRangeZoomInIconLike(zoomIconLikeInBtn2.value) : zoomTextLikeInBtn.value,
),
),
],
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
),
padding: EdgeInsets.all(8.0),
color: Colors.transparent,
),
),
width: 100.0,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4.0),
color: Colors.white,
border: Border.all(color: getColorBorderBtn()),
),
margin: EdgeInsets.all(20.0),
);
}
If anyone seems to know the answer please tell me how to fix this and thank you in advance.

you just need to wrap your Column widget into SingleChildScrollView widget to get rid of and Expanded and Flexible widgets works inside Column or Row
return Scaffold(
body: SingleChildScrollView(
child : Column(
children: [
//To Show Current Date
Container(
height: 30,
margin: EdgeInsets.only(left: 10),
alignment: Alignment.centerLeft,
),
SizedBox(height: 10),
//To show Calendar Widget
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Expanded(
flex : 2,
child: SingleChildScrollView(
child: Center(
child: Card(
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
const ListTile(
title: Text(
'MISSIONS',
style: TextStyle(
fontStyle: FontStyle.italic,
fontSize: 20),
textAlign: TextAlign.center,
),
),
],
),
),
),
),
),
Expanded(
flex : 8,
child: SizedBox(
height: 600.0,
child: ListView.builder(
itemCount:
3,
itemBuilder: (BuildContext context, int index) {
// box.put('missionName', missionName);
//box.put("entries",entries);
//var name = box.get('missionName');
//print('Name: $name');
return GestureDetector(
child: Card(
child: Center(
child: Container(
height: 110,
child: Row(
children: <Widget>[
Expanded(
child: Text(
'mission'),
),
SizedBox(height: 30),
Expanded(
child: GestureDetector(
child: Padding(
padding: const EdgeInsets.all(20.0),
child: Column(
children: <Widget>[
// Just a top space
// main content
Container(
child: Stack(
children: <Widget>[
// Box and icons
Stack(
children: <Widget>[
// Box
renderBox(),
// Icons
renderIcons(),
],
alignment: Alignment.bottomCenter,
),
// Button like
renderBtnLike(),
// Icons when jump
// Icon like
whichIconUserChoose == 1 && !isDragging
? Container(
child: Transform.scale(
child: Image.asset(
"images/close.png",
width: 20.0,
height: 20.0,
),
scale: this.zoomIconWhenRelease.value,
),
margin: EdgeInsets.only(
top: processTopPosition(this.moveUpIconWhenRelease.value),
left: this.moveLeftIconLikeWhenRelease.value,
),
)
: Container(),
// Icon love
whichIconUserChoose == 2 && !isDragging
? Container(
child: Transform.scale(
child: Image.asset(
"images/nowork.png",
width: 20.0,
height: 20.0,
),
scale: this.zoomIconWhenRelease.value,
),
margin: EdgeInsets.only(
top: processTopPosition(this.moveUpIconWhenRelease.value),
left: this.moveLeftIconLoveWhenRelease.value,
),
)
: Container(),
// Icon haha
whichIconUserChoose == 3 && !isDragging
? Container(
child: Transform.scale(
child: Image.asset(
"images/sunny.png",
width: 20.0,
height: 20.0,
),
scale: this.zoomIconWhenRelease.value,
),
margin: EdgeInsets.only(
top: processTopPosition(this.moveUpIconWhenRelease.value),
left: this.moveLeftIconHahaWhenRelease.value,
),
)
: Container(),
],
),
margin: EdgeInsets.only(left: 20.0, right: 20.0),
// Area of the content can drag
// decoration: BoxDecoration(border: Border.all(color: Colors.grey)),
width: double.infinity,
),
],
),
),
onHorizontalDragEnd: onHorizontalDragEndBoxIcon,
onHorizontalDragUpdate: onHorizontalDragUpdateBoxIcon,
),
)
],
),
),
),
),
);
}),
),
),
SizedBox(height: 30),
],
)),
],
),
),
);

return Scaffold(
body: singlechildscrollview(
child:Column(
children: [
//To Show Current Date
Container(
height: 30,
margin: EdgeInsets.only(left: 10),
alignment: Alignment.centerLeft,
),
SizedBox(height: 10),
//To show Calendar Widget
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Expanded(
flex : 2,
child: SingleChildScrollView(
child: Center(
child: Card(
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
const ListTile(
title: Text(
'MISSIONS',
style: TextStyle(
fontStyle: FontStyle.italic,
fontSize: 20),
textAlign: TextAlign.center,
),
),
],
),
),
),
),
),
Expanded(
flex : 8,
child: SizedBox(
height: 600.0,
child: ListView.builder(
itemCount:
3,
itemBuilder: (BuildContext context, int index) {
// box.put('missionName', missionName);
//box.put("entries",entries);
//var name = box.get('missionName');
//print('Name: $name');
return GestureDetector(
child: Card(
child: Center(
child: Container(
height: 110,
child: Row(
children: <Widget>[
Expanded(
child: Text(
'mission'),
),
SizedBox(height: 30),
Expanded(
child: GestureDetector(
child: Padding(
padding: const EdgeInsets.all(20.0),
child: Column(
children: <Widget>[
// Just a top space
// main content
Container(
child: Stack(
children: <Widget>[
// Box and icons
Stack(
children: <Widget>[
// Box
renderBox(),
// Icons
renderIcons(),
],
alignment: Alignment.bottomCenter,
),
// Button like
renderBtnLike(),
// Icons when jump
// Icon like
whichIconUserChoose == 1 && !isDragging
? Container(
child: Transform.scale(
child: Image.asset(
"images/close.png",
width: 20.0,
height: 20.0,
),
scale: this.zoomIconWhenRelease.value,
),
margin: EdgeInsets.only(
top: processTopPosition(this.moveUpIconWhenRelease.value),
left: this.moveLeftIconLikeWhenRelease.value,
),
)
: Container(),
// Icon love
whichIconUserChoose == 2 && !isDragging
? Container(
child: Transform.scale(
child: Image.asset(
"images/nowork.png",
width: 20.0,
height: 20.0,
),
scale: this.zoomIconWhenRelease.value,
),
margin: EdgeInsets.only(
top: processTopPosition(this.moveUpIconWhenRelease.value),
left: this.moveLeftIconLoveWhenRelease.value,
),
)
: Container(),
// Icon haha
whichIconUserChoose == 3 && !isDragging
? Container(
child: Transform.scale(
child: Image.asset(
"images/sunny.png",
width: 20.0,
height: 20.0,
),
scale: this.zoomIconWhenRelease.value,
),
margin: EdgeInsets.only(
top: processTopPosition(this.moveUpIconWhenRelease.value),
left: this.moveLeftIconHahaWhenRelease.value,
),
)
: Container(),
],
),
margin: EdgeInsets.only(left: 20.0, right: 20.0),
// Area of the content can drag
// decoration: BoxDecoration(border: Border.all(color: Colors.grey)),
width: double.infinity,
),
],
),
),
onHorizontalDragEnd: onHorizontalDragEndBoxIcon,
onHorizontalDragUpdate: onHorizontalDragUpdateBoxIcon,
),
)
],
),
),
),
),
);
}),
),
),
SizedBox(height: 30),
],
)),
],
),
);
);

Related

How can I make a Flutter Scaffold scroll to not have TextFields covered

I have a somewhat complicated widget tree and can't figure this out. I've tried wrapping the Scaffold body in a SingleChildScrollView but for some reason it just makes the Container shrink and does not scroll. Here is the build function code:
return Stack(
children: [
Scaffold(
resizeToAvoidBottomInset: false,
body: Stack(
children: [
background(),
Padding(
padding: const EdgeInsets.only(top: 55),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset('assets/logo.png', height: 100),
const SizedBox(width: 5),
const Text('GLOBE',
style: TextStyle(
fontSize: 40,
fontWeight: FontWeight.bold,
color: Color(0xFF7FCCDC)))
],
),
),
Padding(
padding: const EdgeInsets.only(
top: 175, left: 35, right: 35, bottom: 50),
child: Container(
decoration: BoxDecoration(
color: const Color(0xFFFCFBF4).withOpacity(0.5),
borderRadius: BorderRadius.circular(20),
),
child: Column(
mainAxisSize: MainAxisSize.max,
children: [
const SizedBox(height: 20),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: const [
Text('Welcome!',
style: TextStyle(
fontSize: 30, color: Color(0xFF6B6FAB))),
],
),
loginForm()
],
),
),
),
],
),
),
if (_isLoading)
const Opacity(
opacity: 0.8,
child: ModalBarrier(dismissible: false, color: Colors.black),
),
if (_isLoading)
const Center(
child: CircularProgressIndicator(color: Color(0xFFb1bbd8)),
),
],
);
Return a scaffold and add a sized box of height and width same as device. As a body use stack. Then in children add the next stack.
return Scaffold(
resizeToAvoidBottomInset: false,
body: SizedBox(
height: MediaQuery.of(context).size.height,
width: MediaQuery.of(context).size.width,
child: Stack(
children: [
background(),
SizedBox(
height:MediaQuery.of(context).size.height,
width: MediaQuery.of(context).size.width,
child: SingleChildScrollView(
child: Column(
mainAxisSize : MainAxisSize.min,
children:[
Padding(
padding: const EdgeInsets.only(top: 55),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset('assets/logo.png', height: 100),
const SizedBox(width: 5),
const Text('GLOBE',
style: TextStyle(
fontSize: 40,
fontWeight: FontWeight.bold,
color: Color(0xFF7FCCDC)))
],
),
),
Padding(
padding: const EdgeInsets.only(
top: 100, left: 35, right: 35, bottom: 50),
child: Container(
decoration: BoxDecoration(
color: const Color(0xFFFCFBF4).withOpacity(0.5),
borderRadius: BorderRadius.circular(20),
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
const SizedBox(height: 20),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: const [
Text('Welcome!',
style: TextStyle(
fontSize: 30, color: Color(0xFF6B6FAB))),
],
),
loginForm()
],
),
),
),
]
)
)
if (_isLoading)
const Opacity(
opacity: 0.8,
child: ModalBarrier(dismissible: false, color: Colors.black),
),
if (_isLoading)
const Center(
child: CircularProgressIndicator(color: Color(0xFFb1bbd8)),
),
]
)
)
)
TextField has a property called scrollPadding.
scrollPadding: EdgeInsets.only(bottom: 40)
By default it is set to EdgeInsets.all(20.0)

how to put different distances between the items inside a **ListView.builder** depending on their score?

I'm trying to display a list of contestants that are participating in a challenge and sort them by their score but other then that I'm trying to put some actual distance between them in the list where one can actually tell how far behind he actually is from the other contestant whether he is in front or behind of him with their accumulated score(you will find an example of what I'm trying to do down below), so far what I've done is displaying the list of the contestants with a listview.builder and returned a TimelineTile() (timeline_tile) and the result is shown below, what I'm stuck right now is how to start/do the dynamic distance between each contestant depending on their score?
Any help is appreciated :D
My ListView.builder:
body: Center(
child: ListView.builder(
shrinkWrap: true,
itemCount: _contestants.length,
itemBuilder: (context, index) {
var data = _contestants[index];
bool isTeamOne = data.team == 'teamOne';
bool isTeamTwo = data.team == 'teamTwo';
return SizedBox(
height: 100,
width: 50,
child: TimelineTile(
alignment: TimelineAlign.center,
endChild: isTeamOne
? Align(
alignment: Alignment.centerLeft, child: _userCard(data))
: const Text(''),
startChild: isTeamTwo
? Align(
alignment: Alignment.centerRight,
child: _userCard(
data,
))
: const Text(''),
beforeLineStyle: const LineStyle(
color: Colors.brown,
thickness: 5,
),
afterLineStyle: const LineStyle(
color: Colors.black,
thickness: 5,
),
indicatorStyle: IndicatorStyle(
padding: const EdgeInsets.symmetric(horizontal: 0),
color: isTeamOne ? Colors.red : Colors.green,
indicatorXY: 0.5,
drawGap: true,
),
),
);
},
),
),
Widget _userCard(ChallengeModel data) {
return Card(
elevation: 5,
color: Colors.teal,
child: Text(data.name),
);
}
My list of data:
final List<ChallengeModel> _contestants = [
ChallengeModel(
id: 1,
name: 'Team1',
createdAt: 'createdAt',
numeric: 4,
team: 'teamOne',
indicatorXY: 0.7,
),
ChallengeModel(
id: 2,
name: 'Team2',
createdAt: 'createdAt',
numeric: 3,
team: 'teamTwo',
indicatorXY: 0.5,
),
ChallengeModel(
id: 3,
name: 'Team1',
createdAt: 'createdAt',
numeric: 2,
team: 'teamOne',
indicatorXY: 0.3,
),
ChallengeModel(
id: 4,
name: 'Team2',
createdAt: 'createdAt',
numeric: 3,
team: 'teamTwo',
indicatorXY: 0.6,
),
];
What I want to achieve:
What I got so far:
Update
I tried another approach to put actual distance between the players/contestants on a challenge, what I did was by putting everything in a stack and draw a line with a Container() and removed the TimeLineTile() widget and added some containers as cards and dots to see where he is in the line, the way I move them up and down is by basically pushing the player/contestant from the bottom to the top, but this is leading to some other issues mainly the accuracy of the miles a player/contestant has and the actual moving of the container proportionally in the drawn line(which is the line of how much miles should a player/contestant accomplish)
My code so far with the Stack() solution:
body: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 0.0),
child: Stack(
alignment: AlignmentDirectional.bottomCenter,
children: [
Padding(
padding: const EdgeInsets.only(top: 28.0),
child: Container(
height: 500,
width: 20,
color: Colors.red,
),
),
Padding(
padding: const EdgeInsets.symmetric(vertical: 0.0),
child: ListView.builder(
shrinkWrap: true,
itemCount: _contestants.length,
itemBuilder: (context, index) {
var data = _contestants[index];
bool isTeamOne = data.team == 'teamOne';
bool isTeamTwo = data.team == 'teamTwo';
return Align(heightFactor: 0.01, child: _userCard(data));
},
),
),
],
),
),
);
Widget _userCard(ChallengeModel data) {
var isTeamOne = data.team == 'teamOne';
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 167.0),
child: Container(
margin: EdgeInsets.only(bottom: data.numeric),
alignment: Alignment.bottomCenter,
child: Row(
mainAxisAlignment:
isTeamOne ? MainAxisAlignment.end : MainAxisAlignment.start,
children: [
isTeamOne
? const Icon(Icons.ac_unit_rounded)
: Padding(
padding: const EdgeInsets.only(right: 20.0),
child: Card(
elevation: 5,
color: Colors.teal,
child: Text(data.name),
),
),
isTeamOne
? Padding(
padding: const EdgeInsets.only(left: 20.0),
child: Card(
elevation: 5,
color: Colors.teal,
child: Text(data.name),
),
)
: Icon(Icons.ac_unit_rounded),
],
),
),
);
}
I think wrapping your TimelineTile into SizedBox then assigning a height will be good option. Try below code :
Column(
children: [
SizedBox(
height: 200,
child: TimelineTile(
alignment: TimelineAlign.center,
startChild: Container(
height: 50,
child: Card(
color: Colors.lightBlueAccent,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(50)),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text("59"),Text("Title"),
Icon(Icons.ac_unit)
],
),
),
),
),
),
),
SizedBox(
height: 150,
child: TimelineTile(
alignment: TimelineAlign.center,
endChild: Container(
height: 50,
child: Card(
color: Colors.lightBlueAccent,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(50)),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text("59"),Text("Title"),
Icon(Icons.ac_unit)
],
),
),
),
),
),
),
SizedBox(
height: 80,
child: TimelineTile(
alignment: TimelineAlign.center,
endChild: Container(
height: 50,
child: Card(
color: Colors.lightBlueAccent,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(50)),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text("59"),Text("Title"),
Icon(Icons.ac_unit)
],
),
),
),
),
),
),
SizedBox(
height: 100,
child: TimelineTile(lineXY: 0.0,
alignment: TimelineAlign.center,
endChild: SizedBox(
height: 50,
child: Card(
color: Colors.lightBlueAccent,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(50)),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text("59"),Text("Title"),
Icon(Icons.ac_unit)
],
),
),
),
),
),
),
],
)

How to fix this Error Unexpected null value?

I am getting the following error while rendering in my FutureBuilder:
======== Exception caught by rendering library =====================================================
The following TypeErrorImpl was thrown during paint(): Unexpected null value.
Here is my code:
file1.dart
DataCell(IconButton(
icon: Icon(Icons.info_outline),
onPressed: () {
showDialog(
context: context,
builder: (BuildContext context) {
return VendorDetailBox(document.data()['uid']);
});
},
)),
]);
file.dart
Widget build(BuildContext context) {
return FutureBuilder(
future: _services.vendors.doc(widget.uid).get(),
builder:
(BuildContext context, AsyncSnapshot<DocumentSnapshot> snapshot) {
if (snapshot.hasError) {
return Center(child: Text('Something Went Wrong'));
}
if (snapshot.connectionState == ConnectionState.waiting) {
return Center(child: CircularProgressIndicator());
}
return Dialog(
child: Container(
height: MediaQuery.of(context).size.height,
width: MediaQuery.of(context).size.width * .3,
child: ListView(children: [
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
SizedBox(
height: 100,
width: 100,
child: Image.network(
snapshot.data['url'],
fit: BoxFit.cover,
),
),
ListView(children: [
SizedBox(
width: 20,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
snapshot.data['name'],
style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 25),
),
Text(
snapshot.data['dialog'],
),
]),
]),
],
),
Divider(
thickness: 4,
),
Column(
children: [
Padding(
padding: const EdgeInsets.only(top: 10.0),
child: Row(
children: [
Expanded(
child: Container(
child: Text("Contact Numbers",
style: VendorDetailTextStyle),
),
),
Container(
child: Padding(
padding:
const EdgeInsets.only(left: 10.0, right: 10),
child: Text(':'),
),
),
Expanded(
child: Container(
child: Text(snapshot.data['mobile']),
),
),
],
),
),
Padding(
padding: const EdgeInsets.only(top: 10.0),
child: Row(
children: [
Expanded(
child: Container(
child: Text("Email", style: VendorDetailTextStyle),
)),
Container(
child: Padding(
padding:
const EdgeInsets.only(left: 10.0, right: 10),
child: Text(':'),
),
),
Expanded(
child: Container(
child: Text(snapshot.data['email']),
),
),
],
),
),
Padding(
padding: const EdgeInsets.only(top: 10.0),
child: Row(
children: [
Expanded(
child: Container(
child:
Text("address", style: VendorDetailTextStyle),
)),
Container(
child: Padding(
padding:
const EdgeInsets.only(left: 10.0, right: 10),
child: Text(':'),
),
),
Expanded(
child: Container(
child: Text(snapshot.data['address']),
),
),
],
),
),
// Padding(
// padding: const EdgeInsets.only(top: 10.0),
// child: Row(
// children: [
// Expanded(
// child: Container(
// child: Text("Created At",
// style: VendorDetailTextStyle),
// )),
// Container(
// child: Padding(
// padding:
// const EdgeInsets.only(left: 10.0, right: 10),
// child: Text(':'),
// ),
// ),
// Expanded(
// child: Container(
// child:
// Text(snapshot.data['Created At'].toString()),
// ),
// ),
// ],
// ),
// ),
],
),
]),
),
);
});
}

How to clamp scroll view and container at the end

I have a single child scroll view inside of stack trying to clamp the bottom container and the scrollview at the end how would be able to achieve that? the scroll view doesn't end before the container at the bottom. Tried changing the physics to clamping but still not working?What am i missing here?
return Stack(
children: [
SingleChildScrollView(
physics: AlwaysScrollableScrollPhysics(),
child: Column(
children: [
Padding(
padding: const EdgeInsets.only(top: 8.0),
child: BiggerBuildProduct(
onPressed: null,
bigImageUrl: product.image[0],
price: product.price.toString(),
name: product.name,
description: product.description,
),
),
Column(
children: <Widget>[
SizedBox(
height: 10,
),
Container(
width: double.infinity,
child: Column(
children: <Widget>[
Container(
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(
color: Colors.grey[200], width: 2.0),
),
height: 50,
child: Padding(
padding:
const EdgeInsets.only(left: 8.0, right: 8.0),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: <Widget>[
Text(
'Product Details',
style: TextStyle(fontSize: 18),
),
CopyButton(
isIOS: isIOS,
product: product,
)
],
),
),
),
Container(
color: Colors.white,
width: MediaQuery.of(context).size.width,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(product.description),
),
),
],
),
),
SizedBox(
height: 10,
),
BuildServiceItems()
],
),
],
)),
Align(
alignment: Alignment.bottomCenter,
child: Container(
padding: EdgeInsets.only(bottom: 20),
height: 100,
color: Colors.white,
width: MediaQuery.of(context).size.width,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
AppButton(
padding: EdgeInsets.all(0),
isIOS: isIOS,
height: 60,
width: MediaQuery.of(context).size.width * 0.45,
icon: FrinoIcons.f_share,
buttonType: ButtonType.Resell,
text: 'Share Product',
onPressed: () => onImageDownLoad(product),
),
AppButton(
padding: EdgeInsets.all(0),
height: 60,
width: MediaQuery.of(context).size.width * 0.45,
isIOS: isIOS,
icon: FrinoIcons.f_cart_add,
buttonType: ButtonType.DarkRed,
text: 'Add To Cart',
onPressed: () => onAddCartPressed(context, product, isIOS),
),
],
),
),
),
],
);
}

Dismissible without border radius

I'm creating a Dismissible with Flutter and my Container child have a border radius of 40.0 and when I long press (Flat Button animation) it shows that is rounded BUT when I drag it's not, like you can see in the image bellow.
Is this possible?
Container(
margin: const EdgeInsets.only(bottom: 0.0, top: 15.0, right: 10.0, left: 10.0),
child: FlatButton(
//color: Colors.grey.withOpacity(0.1),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(40.0),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Stack(
children: <Widget>[
CircleAvatar(
child: ClipOval(
child: (document['photoUrl'] != null)
? CachedNetworkImage(
placeholder: (context, url) => Icon(
Icons.face,
size: 60.0,
color: Colors.white,
),
imageUrl: document['photoUrl'],
width: 60.0,
height: 60.0,
fit: BoxFit.cover,
fadeInDuration: Duration(milliseconds: 100),
)
: Image.asset(
"assets/images/placeholder_small_avatar.jpg",
fit: BoxFit.cover,
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
),
),
radius: 30.0,
backgroundColor: Colors.grey[400],
),
],
),
Expanded(
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Text(
'${document['nickname']}',
style: TextStyle(
color: Colors.black87,
fontWeight: FontWeight.bold,
fontSize: 16.0,
),
),
],
),
alignment: Alignment.centerLeft,
margin: const EdgeInsets.only(left: 5.0, bottom: 5.0),
),
Container(
child: MessageTile(ctx: context, peerId: document['userId'], id: id),
margin: const EdgeInsets.only(left: 5.0, bottom: 5.0),
)
],
),
margin: const EdgeInsets.only(
left: 10.0,
),
),
),
],
),
onPressed: () {
//bla bla
},
padding: const EdgeInsets.fromLTRB(8.0, 7.0, 8.0, 7.0),
),
),
You can try with Flutter Slidable Package
or else try this method too
ClipRRect(
borderRadius: BorderRadius.circular(12.0),
child: Dismissible(
child: YourWidget();
)
)