How to add a container on the bottom page in Flutter - flutter

I would like to add the container with the "Total amount" at the bottom of my screen.
I tried with Alignment.bottom center, but nothing.
Right now, the listview.builder is smaller, and the container go just under.
I don't want to add padding, as i want something responsive for different screens sizes.
This is my code:
#override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(...
),
body: Padding(
padding: const EdgeInsets.only(top: 15.0),
child: SingleChildScrollView(
child: Container(
height: MediaQuery
.of(context)
.size
.height * 0.9,
child: Column(
children: <Widget>[
ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemBuilder: (contetx ,index) {
return Column(
children:[
Padding(
padding: const EdgeInsets.only(top: 8.0, left: 15, right: 15),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(child: Text(widget.newList[index].name,
style: TextStyle(fontWeight: FontWeight.bold),),
margin: EdgeInsets.only(left: 5.0),),
Container(child: Text((widget.newList[index].quantity),
style: TextStyle(fontSize: 18),)),
],
),
),
Divider(thickness: 1,indent: 20,endIndent: 20,),
],
);
},
itemCount: widget.newList.length,
),
Align(
alignment: Alignment.bottomCenter,
child: Padding(
padding: const EdgeInsets.all(15.0),
child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text('Total'.toUpperCase().tr(),
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20),),
Text( (widget.totalRecipe),
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18),),
],
),

Just use Spacer right before the Align. Also, use LayoutBuilder to get the remaining size instead of MediaQuery.of(context).size.height * 0.9,.
The code is going to be the following:
#override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Results'),
backgroundColor: const Color.fromARGB(255, 237, 98, 55),
),
body: Padding(
padding: const EdgeInsets.only(top: 15.0),
child: LayoutBuilder(builder: (context, constraints) {
return SingleChildScrollView(
child: Container(
height: constraints.maxHeight,
child: Column(
children: <Widget>[
ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemBuilder: (contetx, index) {
return Column(
children: [
Padding(
padding: const EdgeInsets.only(
top: 8.0, left: 15, right: 15),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
child: Text(
widget.newList[index].name,
style:
TextStyle(fontWeight: FontWeight.bold),
),
margin: EdgeInsets.only(left: 5.0),
),
Container(
child: Text(
(widget.newList[index].quantity),
style: TextStyle(fontSize: 18),
)),
],
),
),
Divider(
thickness: 1,
indent: 20,
endIndent: 20,
),
],
);
},
itemCount: widget.newList.length,
),
const Spacer(),
Align(
alignment: Alignment.bottomCenter,
child: Padding(
padding: const EdgeInsets.all(15.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'Total'.toUpperCase(),
style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 20),
),
Text(
(widget.totalRecipe),
style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 18),
),
],
),
),
),
],
),
),
);
}),
),
);
}

You can add mainAxisAlignment in Column() widget.
mainAxisAlignment: MainAxisAlignment.spaceBetween,

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)

Flutter click a card from a ListView.builder

I have a screen in my application where I create a bunch of cards from a map using ListView.builder:
Now I want to click on those cards and when I do, I go to a new activity and pass the name of the doctor and the rest of his information to the new activity.
How can I do that?
this is a code sample
class DocBanner extends StatelessWidget {
#override
Widget build(BuildContext context) {
Size size = MediaQuery.of(context).size;
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Padding(
padding: const EdgeInsets.symmetric(vertical: 0, horizontal: 10),
child: Text(
'Our Doctors:',
style: TextStyle(
fontSize: 18,
),
),
),
Container(
padding: EdgeInsets.symmetric(
horizontal: 5.0,
vertical: 25.0,
),
height: 190,
width: size.width,
child: ListView.builder(
scrollDirection: Axis.horizontal,
shrinkWrap: true,
itemBuilder: (context, index) {
return Container(
width: size.width - 150,
child: Card(
child: Padding(
padding: const EdgeInsets.all(18.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
'${myList[index]['name']}',
style: TextStyle(
fontSize: 22,
fontWeight: FontWeight.bold,
letterSpacing: 2,
),
),
SizedBox(
height: size.height - (size.height * 0.99),
),
Text(
'${myList[index]['specialite']}',
style: TextStyle(
fontSize: 20,
),
),
SizedBox(
height: size.height - (size.height * 0.99),
),
Text(
'${myList[index]['city']}',
style: TextStyle(
fontSize: 20,
color: Colors.red,
),
),
],
),
),
),
);
},
itemCount: myList.length,
),
),
],
);
}
}
You can use a GestureDetector and navigate to another screen in onTap method, like this:
ListView.builder(
scrollDirection: Axis.horizontal,
shrinkWrap: true,
itemBuilder: (context, index) {
return GestureDetector(
onTap: navigateToOtherScreen(myList[index]),
child: Container(
....

Unable to scroll on page using listview inside gridview

I'm trying to develop a dashboard page, with 4 gridviews in a row and 2 gridviews in another row(image below). I'm trying to make the page scrollable and make it look like the image shown below:
I have developed the layout on flutter with code below:
import 'package:flutter/material.dart';
import 'package:syncfusion_flutter_charts/charts.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class Reporting extends StatefulWidget {
#override
_Reporting createState() => _Reporting();
}
class _Reporting extends State<Reporting> {
SfCartesianChart _getAnimationLineChart() {
return SfCartesianChart(
plotAreaBorderWidth: 0,
primaryXAxis: NumericAxis(majorGridLines: MajorGridLines(width: 0)),
primaryYAxis: NumericAxis(
majorTickLines: MajorTickLines(color: Colors.transparent),
axisLine: AxisLine(width: 0),
minimum: 0,
maximum: 100),
);
}
#override
Widget build(BuildContext context) {
;
return Scaffold(
body: Container(
height: MediaQuery.of(context).size.height,
width: MediaQuery.of(context).size.width,
decoration: BoxDecoration(
color: Colors.grey.shade100,
),
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
CustomAppBar(),
Expanded(
child: Column(
children: <Widget>[
ListView(
primary: false,
scrollDirection: Axis.vertical,
shrinkWrap: true,
children: <Widget>[
GridView(
scrollDirection: Axis.vertical,
shrinkWrap: true,
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount(
childAspectRatio: 6 / 3.5,
crossAxisCount: MediaQuery.of(context)
.size
.width >=
1300
? 4
: MediaQuery.of(context).size.width >= 700
? 2
: 1),
children: [
Card(
margin: EdgeInsets.all(20.0),
//margin: EdgeInsets.fromLTRB(80, 60, 80, 60),
elevation: 3.0,
color: Colors.white,
child: Padding(
padding: const EdgeInsets.fromLTRB(30, 0, 0, 0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Number Of Bugs",
style: TextStyle(
color: Colors.black, fontSize: 30.0),
),
Text(
"Critical, High, Info",
style: TextStyle(
color: Colors.green[900],
fontSize: 20.0),
),
],
),
),
),
Card(
margin: EdgeInsets.all(20.0),
elevation: 3.0,
color: Colors.white,
child: Padding(
padding: const EdgeInsets.fromLTRB(30, 0, 0, 0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Tile 2",
style: TextStyle(
color: Colors.blue[900],
fontSize: 30.0),
),
Text(
"Tile 2",
style: TextStyle(
color: Colors.blue[900],
fontSize: 20.0),
),
],
),
),
),
Card(
margin: EdgeInsets.all(20.0),
elevation: 3.0,
color: Colors.white,
child: Padding(
padding: const EdgeInsets.fromLTRB(30, 0, 0, 0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Tile 3",
style: TextStyle(
color: Colors.deepOrange[900],
fontSize: 30.0),
),
Text(
"Tile 3",
style: TextStyle(
color: Colors.deepOrange[900],
fontSize: 20.0),
),
],
),
),
),
Card(
margin: EdgeInsets.all(20.0),
elevation: 3.0,
color: Colors.white,
child: Padding(
padding: const EdgeInsets.fromLTRB(30, 0, 0, 0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Tile 3",
style: TextStyle(
color: Colors.deepOrange[900],
fontSize: 30.0),
),
Text(
"Tile 3",
style: TextStyle(
color: Colors.deepOrange[900],
fontSize: 20.0),
),
],
),
),
),
],
),
GridView(
shrinkWrap: true,
padding: EdgeInsets.only(
//top: 20.0,
left: 90.0,
right: 100.0),
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount(
childAspectRatio: 3 / 2,
crossAxisCount: MediaQuery.of(context)
.size
.width >=
1300
? 2
: MediaQuery.of(context).size.width >=
700
? 2
: 1),
children: <Widget>[
Card(
//margin: EdgeInsets.all(20.0),
//margin: EdgeInsets.fromLTRB(80, 60, 80, 60),
elevation: 3.0,
color: Colors.white,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
//mychart2Items("Conversion","0.9M","+19% of target"),
_getAnimationLineChart(),
],
),
),
Card(
//margin: EdgeInsets.all(20.0),
elevation: 3.0,
color: Colors.white,
child: Padding(
padding:
const EdgeInsets.fromLTRB(30, 0, 0, 0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
"Tile 2",
style: TextStyle(
color: Colors.blue[900],
fontSize: 30.0),
),
Text(
"Tile 2",
style: TextStyle(
color: Colors.blue[900],
fontSize: 20.0),
),
],
),
),
),
Card(
margin: EdgeInsets.all(20.0),
elevation: 3.0,
color: Colors.white,
child: Padding(
padding:
const EdgeInsets.fromLTRB(30, 0, 0, 0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
"Tile 3",
style: TextStyle(
color: Colors.deepOrange[900],
fontSize: 30.0),
),
Text(
"Tile 3",
style: TextStyle(
color: Colors.deepOrange[900],
fontSize: 20.0),
),
],
),
),
),
Card(
margin: EdgeInsets.all(20.0),
elevation: 3.0,
color: Colors.white,
child: Padding(
padding:
const EdgeInsets.fromLTRB(10, 0, 0, 0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
"Tile 3",
style: TextStyle(
color: Colors.deepOrange[900],
fontSize: 30.0),
),
Text(
"Tile 3",
style: TextStyle(
color: Colors.deepOrange[900],
fontSize: 20.0),
),
],
),
),
),
])
],
),
],
),
),
],
),
),
),
);
}
}
I'm getting an error and it is overflowing. Things that I have tried to make it scrollable are used SingleChildScrollView, added shrinkwrap, added scrollAxisDirection. But nothing seems to work. Can someone guild me on how to solve this problem.
A RenderFlex overflowed by 408 pixels on the bottom.
The relevant error-causing widget was:
Column file:///Users/akramkhan/Documents/cshweb/cshwebapp/lib/pages/Reporting.dart:43:24
════════════════════════════════════════════════════════════════════════════════════════════════════
I tried your code and you could remove a couple of widgets and start with this:
return Scaffold(
body: SingleChildScrollView(
child: Column(children: <Widget>[
GridView(),
GridView(),
]),
),
);
then you can disable scrolls on the grid views and add more things you need.
Hope this helps. Let me pls know if this solves your issue

Issues getting text laid out correctly using Rows and Columns

I'm still familiarizing myself with Flutter's layout tools and I'm trying to get some Text aligned correctly with some title text above it. I'm having some issues getting it where I want it though. If anyone has any advice I'd be forever grateful!
This is what I currently have. I have everything how I like it except for the amount text. I want them all lined up under the Amount title. Except I cant get them line up for the life of me. They are all messed up due to the text before it having different lengths.
This is the code for how I am currently rendering everything. The amount text is the bottom Row.
return Scaffold(
backgroundColor: Colors.grey[200],
appBar: PreferredSize(
preferredSize: Size.fromHeight(95.0),
child: AppBar(
automaticallyImplyLeading: false, // hides leading widget
flexibleSpace: TransactionsAppBar(),
),
),
body: FutureBuilder<List<Transaction>>(
future: _future,
builder: (context, AsyncSnapshot<List<Transaction>> snapshot) {
switch (snapshot.connectionState) {
case ConnectionState.none:
return Text('none');
case ConnectionState.waiting:
return Center(child: CircularProgressIndicator());
case ConnectionState.active:
return Text('');
case ConnectionState.done:
if (snapshot.hasError) {
print(
'SNAPSHOT ERROR HERE${snapshot.error}',
);
}
}
List transaction = snapshot.data;
print(transaction);
return ListView.builder(
itemCount: transaction.length,
shrinkWrap: true,
itemBuilder: (context, index) {
return Padding(
padding:
EdgeInsets.symmetric(vertical: 1.0, horizontal: 4.0),
child: Card(
color: (index % 2 == 0) ? greycolor : Colors.white,
child: Container(
height: 60,
padding: EdgeInsets.fromLTRB(0, 0, 0, 0),
child: Row(
children: <Widget>[
Column(
children: [
Container(
margin: EdgeInsets.only(left: 5, top: 13),
child: Text(transaction[index].date,
style: TextStyle(
fontSize: 15, color: Colors.black),
textAlign: TextAlign.left),
),
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(top: 13, left: 8),
child: Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Text(transaction[index].title,
style: TextStyle(
fontSize: 15,
fontWeight: FontWeight.bold,
color: Colors.black,
fontFamily: 'Montserrat'),
textAlign: TextAlign.center)
],
)),
Padding(
padding: EdgeInsets.only(left: 8,right: 39),
child: Row(
children: [
Text(
'${transaction[index].description}',
style: TextStyle(
color: Colors.black,
fontStyle: FontStyle.italic),
),
],
),
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Padding(
padding:
EdgeInsets.only(left: 20, top: 13),
child: Container(
child: Text(
'\$${transaction[index].amount}',
style: TextStyle(
fontSize: 16,
color: Colors.black),
textAlign: TextAlign.right),
),
),
],
),
],
)),
),
);
},
);
}));
Wrap each child of the root Row by Expanded widget this will allows the children to split the width equally ( You can change flex parameter for Expanded widget to get more space , i.e: 3 children with flex:1 will give them 1/3 each of the width, two children with flex:1 and one with flex:2 with be divided 1/4 1/4 2/4 ..ect).
So in your case you can give date and amount flex:1 and item flex:2
itemBuilder: (context, index) {
return Padding(
padding:
EdgeInsets.symmetric(vertical: 1.0, horizontal: 4.0),
child: Card(
color: (index % 2 == 0) ? greycolor : Colors.white,
child: Container(
height: 60,
padding: EdgeInsets.fromLTRB(0, 0, 0, 0),
child: Row(
children: <Widget>[
Expanded(child:Column(
children: [
Container(
margin: EdgeInsets.only(left: 5, top: 13),
child: Text(transaction[index].date,
style: TextStyle(
fontSize: 15, color: Colors.black),
textAlign: TextAlign.left),
),
],
),),
...
you can wrap the second column with Expanded Widget

listview.builder bottom overflowing and errors with Flexible and Expanded widgets

I'm trying to build a ListView but I can't do that my list hit the bottom without overflowing it, the way that I found to work was setting the height on a container, but, when I use my personal device I got a big white space below my list.
I already tried the flexible and expanded widgets before the list, but neither worked, I always get the same errors:
RenderFlex children have non-zero flex but incoming height constraints are unbounded
Vertical viewport was given unbounded height error
Do you have any solutions for this?
#override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
elevation: 0,
backgroundColor: Colors.blueAccent,
title: Padding(
padding: EdgeInsets.only(left: 5.0),
child: Text(
user.name,
style: TextStyle(fontSize: 30.0),
),
),
actions: <Widget>[
IconButton(
alignment: Alignment.center,
icon: Icon(Icons.forward),
onPressed: () {},
),
],
),
body: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Container(
color: Colors.blueAccent,
child: Padding(
padding: EdgeInsets.only(top: 30.0, left: 20.0, right: 20.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text("Conta",
style: TextStyle(fontSize: 17.0, color: Colors.white)),
Divider(color: Colors.blueAccent),
Text("${user.bankAccount} / ${user.agency}",
style: TextStyle(fontSize: 30.0, color: Colors.white)),
Padding(
padding: EdgeInsets.only(top: 30.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text("Saldo",
style:
TextStyle(fontSize: 17.0, color: Colors.white)),
Divider(color: Colors.blueAccent),
Text("${user.balance}",
style:
TextStyle(fontSize: 30.0, color: Colors.white)),
Divider(color: Colors.blueAccent),
],
),
),
],
),
),
),
Divider(color: Colors.white),
Padding(
padding: EdgeInsets.only(left: 20.0, right: 20.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text("Recentes",
style: TextStyle(fontSize: 20.0, color: Colors.black)),
FutureBuilder(
future: getuserStatement(user.userId),
builder: getstatements,
),
],
),
),
],
),
);
}
Future getuserStatement(int id) {
return api.getUserExtract(id);
}
Widget getstatements(BuildContext context, AsyncSnapshot snapshot) {
return !snapshot.hasData
? Center(child: CircularProgressIndicator())
: Container(
height: 340,
child: ListView.builder(
itemCount: snapshot.data.length,
itemBuilder: (context, index) {
print(snapshot.data[index].title);
return Card(
elevation: 5,
child: Column(
children: <Widget>[
Padding(
padding: EdgeInsets.only(top: 10.0, left: 10.0),
child: Row(
children: <Widget>[
Text(snapshot.data[index].title),
Expanded(
child: Align(
alignment: Alignment(0.90, 0.00),
child: Text(snapshot.data[index].date),
),
),
],
),
),
Padding(
padding:
EdgeInsets.only(top: 20.0, bottom: 10.0, left: 10.0),
child: Row(
children: <Widget>[
Text(snapshot.data[index].desc),
Expanded(
child: Align(
alignment: Alignment(0.90, 0.00),
child:
Text(snapshot.data[index].value.toString()),
),
),
],
),
)
],
),
);
},
),
);
}
}
Solution:
after spending so much time on this, i found the solution:
i saw that on this part of my code i put another column inside a padding:
Padding(
padding: EdgeInsets.only(left: 20.0, right: 20.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text("Recentes",
style: TextStyle(fontSize: 20.0, color: Colors.black)),
Expanded(
child: FutureBuilder(
future: getuserStatement(user.userId),
builder: getstatements,
),
),
],
),
),
so what i did was, just removed the Column and left the Text widget and put the expanded widget below the padding.
Padding(
padding: EdgeInsets.only(left: 20.0, right: 20.0),
child: Text("Recentes",
style: TextStyle(fontSize: 20.0, color: Colors.black)),
),
Expanded(
child: FutureBuilder(
future: getuserStatement(user.userId),
builder: getstatements,
),
),
that created my list with the maximum space of the device, with this i don't need to set a height with Container or a sizedBox.
In my vision, i think that happens cause i put a list inside a Column that already is inside a column, so the list doesn't known how much space she has