Unable to scroll the page content of listview
I'm new to flutter. I rendering my page with listitems. If the list items are increased, page content is being overflowed and unable to scroll . shrinkWrap is also not working for the scaffold
_buildOrderDetails(context, model) is a widget that is dynamically generated using listviewbuilder().
Here is my code of _buildOrderDetails list builder
Widget _buildOrderDetails(BuildContext context, MainModel model) {
Widget ordersCard;
List orderItems = model.currentOrder.items;
if(orderItems.length > 0) {
ordersCard = ListView.builder(
shrinkWrap: true,
scrollDirection: Axis.vertical,
itemCount: orderItems.length,
itemBuilder: (BuildContext context, int index){
return Dismissible(
key: Key(index.toString()),
onDismissed: (direction) {
model.removeOrderItem(orderItems[index]);
Scaffold.of(context)
.showSnackBar(
SnackBar(content: Text(orderItems[index].item.name)
)
);
},
background: Container(color: Colors.red),
child: Card(
child: Container(
decoration: BoxDecoration(
border: Border(
top: BorderSide(
color: Theme.of(context).canvasColor
)
)
),
padding: const EdgeInsets.symmetric(horizontal:5.0),
child: Flex(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
direction: Axis.horizontal,
children: <Widget>[
Container(
alignment: FractionalOffset(0.0, 0.0),
width: 100.0,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.only(bottom: 3.0),
alignment: FractionalOffset(0.0, 0.0),
child: Text(orderItems[index].item.name,
style: TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.w600
)
),
),
Container(
alignment: FractionalOffset(0.0, 0.0),
child: Text('Regular',
style: TextStyle(
fontSize: 12.0
),
),
)
],
),
),
Container(
child: Row(
children: [
RupeeWidget(),
Container(
alignment: FractionalOffset(1.0, 1.0),
width: 40.0,
child: Text(orderItems[index].item.price.toString())
)
],
),
),
Container(
margin: EdgeInsets.symmetric(vertical: 5.0),
height: 30.0,
decoration: BoxDecoration(
border: Border.all(
color: Color.fromRGBO(37, 134, 16, 1.0),
),
borderRadius: BorderRadius.circular(6.0)
),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
GestureDetector(
onTap: () {
model.decreaseOrderItemQuantity(orderItems[index]);
},
child: Container(
width: 25.0,
child: Text('-',
textAlign: TextAlign.center,
style: TextStyle(fontSize: 20.0),
)
),
),
Container(
color: Color.fromRGBO(37, 134, 16, 1.0),
height: 30.0,
width: 30.0,
alignment: FractionalOffset(0.5, 0.5),
child: Text(orderItems[index].quantity.toString(),
style: TextStyle(color: Colors.white),
)
),
GestureDetector(
onTap:() {
model.increaseOrderItemQuantity(orderItems[index]);
},
child: Container(
width: 25.0,
child: Text('+',
textAlign: TextAlign.center,
style: TextStyle(fontSize: 20.0),
)
),
),
],
),
),
Container(
child: Row(
children: [
RupeeWidget(),
Container(
alignment: FractionalOffset(1.0, 1.0),
width: 40.0,
child: Text((orderItems[index].quantity*orderItems[index].item.price).toString())
)
],
),
)
]
)
),
),
);
}
);
}
return ordersCard;
}
Widget _orderAmount(BuildContext context, MainModel model){
final gstValue = 0.0;
return Container(
padding: const EdgeInsets.symmetric(vertical: 10.0, horizontal: 10.0),
child: Column(
children: [
Container(
alignment: FractionalOffset(0.0, 0.0),
child: Text('Total',
style: TextStyle(
fontSize: 18.0,
height: 1.5,
color: Color.fromRGBO(0, 0, 0, 1.0)
),
),
),
Container(
padding: const EdgeInsets.symmetric(vertical: 3.0),
child: Flex(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
direction: Axis.horizontal,
children: [
Flexible(
child: Text('Subtotal'),
),
Row(
children: [
RupeeWidget(),
Container(
alignment: FractionalOffset(1.0, 1.0),
width: 60.0,
child: Text(model.currentOrder.price.toString())
)
],
)
],
),
),
Container(
padding: const EdgeInsets.symmetric(vertical: 5.0),
child: Flex(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
direction: Axis.horizontal,
children: [
Flexible(
child: Text('GST'),
),
Row(
children: [
RupeeWidget(),
Container(
alignment: FractionalOffset(1.0, 1.0),
width: 60.0,
child: Text(gstValue.toString())
)
],
)
],
),
),
Container(
padding: const EdgeInsets.symmetric(vertical: 5.0),
decoration: BoxDecoration(
border: Border(
top: BorderSide(
color: Color.fromRGBO(37, 134, 16, 1.0),
)
)
),
child: Flex(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
direction: Axis.horizontal,
children: [
Flexible(
child: Text('Grandtotal'),
),
Row(
children: [
RupeeWidget(),
Container(
alignment: FractionalOffset(1.0, 1.0),
width: 60.0,
child: Text((model.currentOrder.price +
gstValue).toString())
)
],
)
],
),
)
]
),
);
}
Widget build(BuildContext context){
return ScopedModelDescendant<MainModel>(
builder: (BuildContext context, Widget child, MainModel model) {
return Scaffold(
appBar: AppBar(
title: Text('Order Details'),
actions: <Widget>[
IconButton(
onPressed: () {
model.addNewOrder();
},
icon: Icon(Icons.add),
),
BadgeIconButton(
itemCount: model.ordersCount,
badgeColor: Color.fromRGBO(37, 134, 16, 1.0),
badgeTextColor: Colors.white,
icon: Icon(Icons.shopping_cart, size: 30.0,),
onPressed: () {}
),
]
),
body: Column(
children: [
Column(
children: [
_buildItemsTitle(),
Expanded(child: _buildOrderDetails(context, model)),
]
),
Card(child: _orderAmount(context, model),),
RaisedButton(
color: Theme.of(context).accentColor,
onPressed: (){},
child: Text('Checkout',
style: TextStyle(
fontSize: 20.0,
color: Colors.white
)
),
)
]
),
floatingActionButton: FloatingActionButton(
child: Text('Add Item',
textAlign: TextAlign.center,
),
onPressed: (){
Navigator.pushNamed(context, '/');
},
),
);
}
);
}
}
flutter
add a comment |
I'm new to flutter. I rendering my page with listitems. If the list items are increased, page content is being overflowed and unable to scroll . shrinkWrap is also not working for the scaffold
_buildOrderDetails(context, model) is a widget that is dynamically generated using listviewbuilder().
Here is my code of _buildOrderDetails list builder
Widget _buildOrderDetails(BuildContext context, MainModel model) {
Widget ordersCard;
List orderItems = model.currentOrder.items;
if(orderItems.length > 0) {
ordersCard = ListView.builder(
shrinkWrap: true,
scrollDirection: Axis.vertical,
itemCount: orderItems.length,
itemBuilder: (BuildContext context, int index){
return Dismissible(
key: Key(index.toString()),
onDismissed: (direction) {
model.removeOrderItem(orderItems[index]);
Scaffold.of(context)
.showSnackBar(
SnackBar(content: Text(orderItems[index].item.name)
)
);
},
background: Container(color: Colors.red),
child: Card(
child: Container(
decoration: BoxDecoration(
border: Border(
top: BorderSide(
color: Theme.of(context).canvasColor
)
)
),
padding: const EdgeInsets.symmetric(horizontal:5.0),
child: Flex(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
direction: Axis.horizontal,
children: <Widget>[
Container(
alignment: FractionalOffset(0.0, 0.0),
width: 100.0,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.only(bottom: 3.0),
alignment: FractionalOffset(0.0, 0.0),
child: Text(orderItems[index].item.name,
style: TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.w600
)
),
),
Container(
alignment: FractionalOffset(0.0, 0.0),
child: Text('Regular',
style: TextStyle(
fontSize: 12.0
),
),
)
],
),
),
Container(
child: Row(
children: [
RupeeWidget(),
Container(
alignment: FractionalOffset(1.0, 1.0),
width: 40.0,
child: Text(orderItems[index].item.price.toString())
)
],
),
),
Container(
margin: EdgeInsets.symmetric(vertical: 5.0),
height: 30.0,
decoration: BoxDecoration(
border: Border.all(
color: Color.fromRGBO(37, 134, 16, 1.0),
),
borderRadius: BorderRadius.circular(6.0)
),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
GestureDetector(
onTap: () {
model.decreaseOrderItemQuantity(orderItems[index]);
},
child: Container(
width: 25.0,
child: Text('-',
textAlign: TextAlign.center,
style: TextStyle(fontSize: 20.0),
)
),
),
Container(
color: Color.fromRGBO(37, 134, 16, 1.0),
height: 30.0,
width: 30.0,
alignment: FractionalOffset(0.5, 0.5),
child: Text(orderItems[index].quantity.toString(),
style: TextStyle(color: Colors.white),
)
),
GestureDetector(
onTap:() {
model.increaseOrderItemQuantity(orderItems[index]);
},
child: Container(
width: 25.0,
child: Text('+',
textAlign: TextAlign.center,
style: TextStyle(fontSize: 20.0),
)
),
),
],
),
),
Container(
child: Row(
children: [
RupeeWidget(),
Container(
alignment: FractionalOffset(1.0, 1.0),
width: 40.0,
child: Text((orderItems[index].quantity*orderItems[index].item.price).toString())
)
],
),
)
]
)
),
),
);
}
);
}
return ordersCard;
}
Widget _orderAmount(BuildContext context, MainModel model){
final gstValue = 0.0;
return Container(
padding: const EdgeInsets.symmetric(vertical: 10.0, horizontal: 10.0),
child: Column(
children: [
Container(
alignment: FractionalOffset(0.0, 0.0),
child: Text('Total',
style: TextStyle(
fontSize: 18.0,
height: 1.5,
color: Color.fromRGBO(0, 0, 0, 1.0)
),
),
),
Container(
padding: const EdgeInsets.symmetric(vertical: 3.0),
child: Flex(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
direction: Axis.horizontal,
children: [
Flexible(
child: Text('Subtotal'),
),
Row(
children: [
RupeeWidget(),
Container(
alignment: FractionalOffset(1.0, 1.0),
width: 60.0,
child: Text(model.currentOrder.price.toString())
)
],
)
],
),
),
Container(
padding: const EdgeInsets.symmetric(vertical: 5.0),
child: Flex(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
direction: Axis.horizontal,
children: [
Flexible(
child: Text('GST'),
),
Row(
children: [
RupeeWidget(),
Container(
alignment: FractionalOffset(1.0, 1.0),
width: 60.0,
child: Text(gstValue.toString())
)
],
)
],
),
),
Container(
padding: const EdgeInsets.symmetric(vertical: 5.0),
decoration: BoxDecoration(
border: Border(
top: BorderSide(
color: Color.fromRGBO(37, 134, 16, 1.0),
)
)
),
child: Flex(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
direction: Axis.horizontal,
children: [
Flexible(
child: Text('Grandtotal'),
),
Row(
children: [
RupeeWidget(),
Container(
alignment: FractionalOffset(1.0, 1.0),
width: 60.0,
child: Text((model.currentOrder.price +
gstValue).toString())
)
],
)
],
),
)
]
),
);
}
Widget build(BuildContext context){
return ScopedModelDescendant<MainModel>(
builder: (BuildContext context, Widget child, MainModel model) {
return Scaffold(
appBar: AppBar(
title: Text('Order Details'),
actions: <Widget>[
IconButton(
onPressed: () {
model.addNewOrder();
},
icon: Icon(Icons.add),
),
BadgeIconButton(
itemCount: model.ordersCount,
badgeColor: Color.fromRGBO(37, 134, 16, 1.0),
badgeTextColor: Colors.white,
icon: Icon(Icons.shopping_cart, size: 30.0,),
onPressed: () {}
),
]
),
body: Column(
children: [
Column(
children: [
_buildItemsTitle(),
Expanded(child: _buildOrderDetails(context, model)),
]
),
Card(child: _orderAmount(context, model),),
RaisedButton(
color: Theme.of(context).accentColor,
onPressed: (){},
child: Text('Checkout',
style: TextStyle(
fontSize: 20.0,
color: Colors.white
)
),
)
]
),
floatingActionButton: FloatingActionButton(
child: Text('Add Item',
textAlign: TextAlign.center,
),
onPressed: (){
Navigator.pushNamed(context, '/');
},
),
);
}
);
}
}
flutter
Please add _buildOrderDetails and _buildItemsTitle functions.
– Aawaz Gyawali
Nov 24 '18 at 16:54
Add shrinkwrap: true in your listview.builder
– anmol.majhail
Nov 24 '18 at 18:44
@anmol.majhail. Shrinkwrap is also added in the listview.builder. But not working
– KURRU HEM
Nov 25 '18 at 12:20
Replace body: Column( with body: ListView(
– anmol.majhail
Nov 25 '18 at 14:00
@anmol.majhail. ListView is also not working.
– KURRU HEM
Nov 26 '18 at 3:13
add a comment |
I'm new to flutter. I rendering my page with listitems. If the list items are increased, page content is being overflowed and unable to scroll . shrinkWrap is also not working for the scaffold
_buildOrderDetails(context, model) is a widget that is dynamically generated using listviewbuilder().
Here is my code of _buildOrderDetails list builder
Widget _buildOrderDetails(BuildContext context, MainModel model) {
Widget ordersCard;
List orderItems = model.currentOrder.items;
if(orderItems.length > 0) {
ordersCard = ListView.builder(
shrinkWrap: true,
scrollDirection: Axis.vertical,
itemCount: orderItems.length,
itemBuilder: (BuildContext context, int index){
return Dismissible(
key: Key(index.toString()),
onDismissed: (direction) {
model.removeOrderItem(orderItems[index]);
Scaffold.of(context)
.showSnackBar(
SnackBar(content: Text(orderItems[index].item.name)
)
);
},
background: Container(color: Colors.red),
child: Card(
child: Container(
decoration: BoxDecoration(
border: Border(
top: BorderSide(
color: Theme.of(context).canvasColor
)
)
),
padding: const EdgeInsets.symmetric(horizontal:5.0),
child: Flex(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
direction: Axis.horizontal,
children: <Widget>[
Container(
alignment: FractionalOffset(0.0, 0.0),
width: 100.0,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.only(bottom: 3.0),
alignment: FractionalOffset(0.0, 0.0),
child: Text(orderItems[index].item.name,
style: TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.w600
)
),
),
Container(
alignment: FractionalOffset(0.0, 0.0),
child: Text('Regular',
style: TextStyle(
fontSize: 12.0
),
),
)
],
),
),
Container(
child: Row(
children: [
RupeeWidget(),
Container(
alignment: FractionalOffset(1.0, 1.0),
width: 40.0,
child: Text(orderItems[index].item.price.toString())
)
],
),
),
Container(
margin: EdgeInsets.symmetric(vertical: 5.0),
height: 30.0,
decoration: BoxDecoration(
border: Border.all(
color: Color.fromRGBO(37, 134, 16, 1.0),
),
borderRadius: BorderRadius.circular(6.0)
),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
GestureDetector(
onTap: () {
model.decreaseOrderItemQuantity(orderItems[index]);
},
child: Container(
width: 25.0,
child: Text('-',
textAlign: TextAlign.center,
style: TextStyle(fontSize: 20.0),
)
),
),
Container(
color: Color.fromRGBO(37, 134, 16, 1.0),
height: 30.0,
width: 30.0,
alignment: FractionalOffset(0.5, 0.5),
child: Text(orderItems[index].quantity.toString(),
style: TextStyle(color: Colors.white),
)
),
GestureDetector(
onTap:() {
model.increaseOrderItemQuantity(orderItems[index]);
},
child: Container(
width: 25.0,
child: Text('+',
textAlign: TextAlign.center,
style: TextStyle(fontSize: 20.0),
)
),
),
],
),
),
Container(
child: Row(
children: [
RupeeWidget(),
Container(
alignment: FractionalOffset(1.0, 1.0),
width: 40.0,
child: Text((orderItems[index].quantity*orderItems[index].item.price).toString())
)
],
),
)
]
)
),
),
);
}
);
}
return ordersCard;
}
Widget _orderAmount(BuildContext context, MainModel model){
final gstValue = 0.0;
return Container(
padding: const EdgeInsets.symmetric(vertical: 10.0, horizontal: 10.0),
child: Column(
children: [
Container(
alignment: FractionalOffset(0.0, 0.0),
child: Text('Total',
style: TextStyle(
fontSize: 18.0,
height: 1.5,
color: Color.fromRGBO(0, 0, 0, 1.0)
),
),
),
Container(
padding: const EdgeInsets.symmetric(vertical: 3.0),
child: Flex(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
direction: Axis.horizontal,
children: [
Flexible(
child: Text('Subtotal'),
),
Row(
children: [
RupeeWidget(),
Container(
alignment: FractionalOffset(1.0, 1.0),
width: 60.0,
child: Text(model.currentOrder.price.toString())
)
],
)
],
),
),
Container(
padding: const EdgeInsets.symmetric(vertical: 5.0),
child: Flex(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
direction: Axis.horizontal,
children: [
Flexible(
child: Text('GST'),
),
Row(
children: [
RupeeWidget(),
Container(
alignment: FractionalOffset(1.0, 1.0),
width: 60.0,
child: Text(gstValue.toString())
)
],
)
],
),
),
Container(
padding: const EdgeInsets.symmetric(vertical: 5.0),
decoration: BoxDecoration(
border: Border(
top: BorderSide(
color: Color.fromRGBO(37, 134, 16, 1.0),
)
)
),
child: Flex(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
direction: Axis.horizontal,
children: [
Flexible(
child: Text('Grandtotal'),
),
Row(
children: [
RupeeWidget(),
Container(
alignment: FractionalOffset(1.0, 1.0),
width: 60.0,
child: Text((model.currentOrder.price +
gstValue).toString())
)
],
)
],
),
)
]
),
);
}
Widget build(BuildContext context){
return ScopedModelDescendant<MainModel>(
builder: (BuildContext context, Widget child, MainModel model) {
return Scaffold(
appBar: AppBar(
title: Text('Order Details'),
actions: <Widget>[
IconButton(
onPressed: () {
model.addNewOrder();
},
icon: Icon(Icons.add),
),
BadgeIconButton(
itemCount: model.ordersCount,
badgeColor: Color.fromRGBO(37, 134, 16, 1.0),
badgeTextColor: Colors.white,
icon: Icon(Icons.shopping_cart, size: 30.0,),
onPressed: () {}
),
]
),
body: Column(
children: [
Column(
children: [
_buildItemsTitle(),
Expanded(child: _buildOrderDetails(context, model)),
]
),
Card(child: _orderAmount(context, model),),
RaisedButton(
color: Theme.of(context).accentColor,
onPressed: (){},
child: Text('Checkout',
style: TextStyle(
fontSize: 20.0,
color: Colors.white
)
),
)
]
),
floatingActionButton: FloatingActionButton(
child: Text('Add Item',
textAlign: TextAlign.center,
),
onPressed: (){
Navigator.pushNamed(context, '/');
},
),
);
}
);
}
}
flutter
I'm new to flutter. I rendering my page with listitems. If the list items are increased, page content is being overflowed and unable to scroll . shrinkWrap is also not working for the scaffold
_buildOrderDetails(context, model) is a widget that is dynamically generated using listviewbuilder().
Here is my code of _buildOrderDetails list builder
Widget _buildOrderDetails(BuildContext context, MainModel model) {
Widget ordersCard;
List orderItems = model.currentOrder.items;
if(orderItems.length > 0) {
ordersCard = ListView.builder(
shrinkWrap: true,
scrollDirection: Axis.vertical,
itemCount: orderItems.length,
itemBuilder: (BuildContext context, int index){
return Dismissible(
key: Key(index.toString()),
onDismissed: (direction) {
model.removeOrderItem(orderItems[index]);
Scaffold.of(context)
.showSnackBar(
SnackBar(content: Text(orderItems[index].item.name)
)
);
},
background: Container(color: Colors.red),
child: Card(
child: Container(
decoration: BoxDecoration(
border: Border(
top: BorderSide(
color: Theme.of(context).canvasColor
)
)
),
padding: const EdgeInsets.symmetric(horizontal:5.0),
child: Flex(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
direction: Axis.horizontal,
children: <Widget>[
Container(
alignment: FractionalOffset(0.0, 0.0),
width: 100.0,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.only(bottom: 3.0),
alignment: FractionalOffset(0.0, 0.0),
child: Text(orderItems[index].item.name,
style: TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.w600
)
),
),
Container(
alignment: FractionalOffset(0.0, 0.0),
child: Text('Regular',
style: TextStyle(
fontSize: 12.0
),
),
)
],
),
),
Container(
child: Row(
children: [
RupeeWidget(),
Container(
alignment: FractionalOffset(1.0, 1.0),
width: 40.0,
child: Text(orderItems[index].item.price.toString())
)
],
),
),
Container(
margin: EdgeInsets.symmetric(vertical: 5.0),
height: 30.0,
decoration: BoxDecoration(
border: Border.all(
color: Color.fromRGBO(37, 134, 16, 1.0),
),
borderRadius: BorderRadius.circular(6.0)
),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
GestureDetector(
onTap: () {
model.decreaseOrderItemQuantity(orderItems[index]);
},
child: Container(
width: 25.0,
child: Text('-',
textAlign: TextAlign.center,
style: TextStyle(fontSize: 20.0),
)
),
),
Container(
color: Color.fromRGBO(37, 134, 16, 1.0),
height: 30.0,
width: 30.0,
alignment: FractionalOffset(0.5, 0.5),
child: Text(orderItems[index].quantity.toString(),
style: TextStyle(color: Colors.white),
)
),
GestureDetector(
onTap:() {
model.increaseOrderItemQuantity(orderItems[index]);
},
child: Container(
width: 25.0,
child: Text('+',
textAlign: TextAlign.center,
style: TextStyle(fontSize: 20.0),
)
),
),
],
),
),
Container(
child: Row(
children: [
RupeeWidget(),
Container(
alignment: FractionalOffset(1.0, 1.0),
width: 40.0,
child: Text((orderItems[index].quantity*orderItems[index].item.price).toString())
)
],
),
)
]
)
),
),
);
}
);
}
return ordersCard;
}
Widget _orderAmount(BuildContext context, MainModel model){
final gstValue = 0.0;
return Container(
padding: const EdgeInsets.symmetric(vertical: 10.0, horizontal: 10.0),
child: Column(
children: [
Container(
alignment: FractionalOffset(0.0, 0.0),
child: Text('Total',
style: TextStyle(
fontSize: 18.0,
height: 1.5,
color: Color.fromRGBO(0, 0, 0, 1.0)
),
),
),
Container(
padding: const EdgeInsets.symmetric(vertical: 3.0),
child: Flex(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
direction: Axis.horizontal,
children: [
Flexible(
child: Text('Subtotal'),
),
Row(
children: [
RupeeWidget(),
Container(
alignment: FractionalOffset(1.0, 1.0),
width: 60.0,
child: Text(model.currentOrder.price.toString())
)
],
)
],
),
),
Container(
padding: const EdgeInsets.symmetric(vertical: 5.0),
child: Flex(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
direction: Axis.horizontal,
children: [
Flexible(
child: Text('GST'),
),
Row(
children: [
RupeeWidget(),
Container(
alignment: FractionalOffset(1.0, 1.0),
width: 60.0,
child: Text(gstValue.toString())
)
],
)
],
),
),
Container(
padding: const EdgeInsets.symmetric(vertical: 5.0),
decoration: BoxDecoration(
border: Border(
top: BorderSide(
color: Color.fromRGBO(37, 134, 16, 1.0),
)
)
),
child: Flex(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
direction: Axis.horizontal,
children: [
Flexible(
child: Text('Grandtotal'),
),
Row(
children: [
RupeeWidget(),
Container(
alignment: FractionalOffset(1.0, 1.0),
width: 60.0,
child: Text((model.currentOrder.price +
gstValue).toString())
)
],
)
],
),
)
]
),
);
}
Widget build(BuildContext context){
return ScopedModelDescendant<MainModel>(
builder: (BuildContext context, Widget child, MainModel model) {
return Scaffold(
appBar: AppBar(
title: Text('Order Details'),
actions: <Widget>[
IconButton(
onPressed: () {
model.addNewOrder();
},
icon: Icon(Icons.add),
),
BadgeIconButton(
itemCount: model.ordersCount,
badgeColor: Color.fromRGBO(37, 134, 16, 1.0),
badgeTextColor: Colors.white,
icon: Icon(Icons.shopping_cart, size: 30.0,),
onPressed: () {}
),
]
),
body: Column(
children: [
Column(
children: [
_buildItemsTitle(),
Expanded(child: _buildOrderDetails(context, model)),
]
),
Card(child: _orderAmount(context, model),),
RaisedButton(
color: Theme.of(context).accentColor,
onPressed: (){},
child: Text('Checkout',
style: TextStyle(
fontSize: 20.0,
color: Colors.white
)
),
)
]
),
floatingActionButton: FloatingActionButton(
child: Text('Add Item',
textAlign: TextAlign.center,
),
onPressed: (){
Navigator.pushNamed(context, '/');
},
),
);
}
);
}
}
flutter
flutter
edited Nov 25 '18 at 12:19
KURRU HEM
asked Nov 24 '18 at 12:54
KURRU HEMKURRU HEM
277
277
Please add _buildOrderDetails and _buildItemsTitle functions.
– Aawaz Gyawali
Nov 24 '18 at 16:54
Add shrinkwrap: true in your listview.builder
– anmol.majhail
Nov 24 '18 at 18:44
@anmol.majhail. Shrinkwrap is also added in the listview.builder. But not working
– KURRU HEM
Nov 25 '18 at 12:20
Replace body: Column( with body: ListView(
– anmol.majhail
Nov 25 '18 at 14:00
@anmol.majhail. ListView is also not working.
– KURRU HEM
Nov 26 '18 at 3:13
add a comment |
Please add _buildOrderDetails and _buildItemsTitle functions.
– Aawaz Gyawali
Nov 24 '18 at 16:54
Add shrinkwrap: true in your listview.builder
– anmol.majhail
Nov 24 '18 at 18:44
@anmol.majhail. Shrinkwrap is also added in the listview.builder. But not working
– KURRU HEM
Nov 25 '18 at 12:20
Replace body: Column( with body: ListView(
– anmol.majhail
Nov 25 '18 at 14:00
@anmol.majhail. ListView is also not working.
– KURRU HEM
Nov 26 '18 at 3:13
Please add _buildOrderDetails and _buildItemsTitle functions.
– Aawaz Gyawali
Nov 24 '18 at 16:54
Please add _buildOrderDetails and _buildItemsTitle functions.
– Aawaz Gyawali
Nov 24 '18 at 16:54
Add shrinkwrap: true in your listview.builder
– anmol.majhail
Nov 24 '18 at 18:44
Add shrinkwrap: true in your listview.builder
– anmol.majhail
Nov 24 '18 at 18:44
@anmol.majhail. Shrinkwrap is also added in the listview.builder. But not working
– KURRU HEM
Nov 25 '18 at 12:20
@anmol.majhail. Shrinkwrap is also added in the listview.builder. But not working
– KURRU HEM
Nov 25 '18 at 12:20
Replace body: Column( with body: ListView(
– anmol.majhail
Nov 25 '18 at 14:00
Replace body: Column( with body: ListView(
– anmol.majhail
Nov 25 '18 at 14:00
@anmol.majhail. ListView is also not working.
– KURRU HEM
Nov 26 '18 at 3:13
@anmol.majhail. ListView is also not working.
– KURRU HEM
Nov 26 '18 at 3:13
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53458360%2funable-to-scroll-the-page-content-of-listview%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53458360%2funable-to-scroll-the-page-content-of-listview%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Please add _buildOrderDetails and _buildItemsTitle functions.
– Aawaz Gyawali
Nov 24 '18 at 16:54
Add shrinkwrap: true in your listview.builder
– anmol.majhail
Nov 24 '18 at 18:44
@anmol.majhail. Shrinkwrap is also added in the listview.builder. But not working
– KURRU HEM
Nov 25 '18 at 12:20
Replace body: Column( with body: ListView(
– anmol.majhail
Nov 25 '18 at 14:00
@anmol.majhail. ListView is also not working.
– KURRU HEM
Nov 26 '18 at 3:13