second commit
This commit is contained in:
683
lib/View/Dashboard/Tabs/Cancelledview.dart
Normal file
683
lib/View/Dashboard/Tabs/Cancelledview.dart
Normal file
@@ -0,0 +1,683 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:shimmer/shimmer.dart';
|
||||
|
||||
import '../../../Controller/Dashboard/Tabs/Cancelledordercontroller.dart';
|
||||
import '../../../Helper/Constants/Assetconstants.dart';
|
||||
import '../../../Helper/Constants/Colorconstants.dart';
|
||||
import '../Orderdetails/Orderdetailsview.dart';
|
||||
|
||||
class CancelledView extends StatelessWidget {
|
||||
CancelledView({super.key});
|
||||
|
||||
CancelledOrderController completedOrderController = Get.put(CancelledOrderController()) ;
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.grey[100],
|
||||
body:Stack(
|
||||
children: [
|
||||
GetBuilder<CancelledOrderController>(
|
||||
initState: (_){
|
||||
completedOrderController.shimmer.value = true;
|
||||
completedOrderController.getCancelledOrder();
|
||||
},
|
||||
builder: (controller) {
|
||||
return
|
||||
controller.getCancelledOrderList.isEmpty &&
|
||||
!controller.shimmer.value
|
||||
? Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
const Image(
|
||||
height: 160,
|
||||
width: 160,
|
||||
image: AssetImage(AssetConstants.NoRecords),
|
||||
),
|
||||
|
||||
Text(
|
||||
"No orders at this moment",
|
||||
style: TextStyle(color: Colors.grey[600], fontSize: 18),
|
||||
),
|
||||
],
|
||||
)) :controller.shimmer.value
|
||||
? orderShimmerCard(context)
|
||||
:
|
||||
Container(
|
||||
padding: const EdgeInsets.only(left: 5, right: 5, top: 8),
|
||||
child: ListView.builder(
|
||||
padding: const EdgeInsets.only(bottom: 70),
|
||||
itemCount:
|
||||
controller.shimmer.value
|
||||
? 5
|
||||
:controller.getCancelledOrderList.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return InkWell(
|
||||
onTap: (){
|
||||
Get.to(()=>OrderDetailsView(data: controller.getCancelledOrderList[index],));
|
||||
|
||||
},
|
||||
child: Card(
|
||||
color: Colors.red[100]!.withAlpha(100),
|
||||
// Utility.getLightColors(controller.getOrderAllList[index].tenantname![0]).withAlpha(100),
|
||||
elevation: 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: SizedBox(
|
||||
height: 180,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Column(
|
||||
// mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment
|
||||
.spaceBetween,
|
||||
children: [
|
||||
Container(
|
||||
width:45,
|
||||
margin: const EdgeInsets.only(left: 8,right: 0,top: 12,bottom: 0),
|
||||
padding: const EdgeInsets.only(left: 5,right: 5,top: 5,bottom: 5),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white70,
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
// shape: BoxShape.circle
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
DateFormat("dd").format(DateFormat("yyyy-MM-dd'T'HH:mm:ss", "en_US").parse(controller.getCancelledOrderList[index].orderdate!)),
|
||||
|
||||
style: const TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight:
|
||||
FontWeight
|
||||
.w700),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 2,
|
||||
),
|
||||
Text(
|
||||
DateFormat("MMM").format(DateFormat("yyyy-MM-dd'T'HH:mm:ss", "en_US").parse(controller.getCancelledOrderList[index].orderdate!)),
|
||||
|
||||
style: const TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight:
|
||||
FontWeight
|
||||
.w700),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Column(
|
||||
children: [
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Container(
|
||||
width:45,
|
||||
margin: const EdgeInsets.only(left: 8,right: 0,top: 0,bottom: 5),
|
||||
padding: const EdgeInsets.only(left: 5,right: 5,top: 5,bottom: 5),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white70,
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
// shape: BoxShape.circle
|
||||
),
|
||||
// radius: 22,
|
||||
// backgroundColor: Colors.white70,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
DateFormat("hh:mm").format(DateFormat("yyyy-mm-dd'T'HH:mm:ss", "en_US").parse(controller.getCancelledOrderList[index].deliverydate??'')),
|
||||
style: const TextStyle(fontSize: 11,color: Colors.black,fontWeight: FontWeight.bold)),
|
||||
const SizedBox(height: 2,),
|
||||
Text(
|
||||
DateFormat("a").format(DateFormat("yyyy-mm-dd'T'HH:mm:ss", "en_US").parse(controller.getCancelledOrderList[index].deliverydate??'')),
|
||||
style: const TextStyle(fontSize: 11,color: Colors.black,fontWeight: FontWeight.bold)),
|
||||
const SizedBox(height: 2,),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 5,)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 12,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(5.0),
|
||||
child: Card(
|
||||
elevation: 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 7,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(left: 10),
|
||||
child: Column(
|
||||
children: [
|
||||
// Expanded(
|
||||
// flex: 3,
|
||||
// child: Row(
|
||||
// children: [
|
||||
// Expanded(
|
||||
// flex: 6,
|
||||
// child: Column(
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
// mainAxisAlignment: MainAxisAlignment.start,
|
||||
// children: [
|
||||
// const SizedBox(
|
||||
// height: 3,
|
||||
// ),
|
||||
// Row(
|
||||
// children: [
|
||||
// Icon(Icons.business,color: ColorConstants.primaryColor,size: 20),
|
||||
// const SizedBox(width: 5,),
|
||||
// SizedBox(
|
||||
// width: Get.width*0.30,
|
||||
// child: Text(
|
||||
// "${controller.getCompletedOrderList[index].tenantname}",
|
||||
// style: const TextStyle(
|
||||
// color: Colors.black87,
|
||||
// fontWeight: FontWeight.w500,
|
||||
// fontSize: 16),
|
||||
// maxLines: 1,
|
||||
// ),
|
||||
// ),
|
||||
// const Spacer(),
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.only(top: 10,right: 10),
|
||||
// child: Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.center,
|
||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||
// children: [
|
||||
// Container(
|
||||
// // height:Get.height*0.03,
|
||||
// // width: Get.width*0.3,
|
||||
// decoration: BoxDecoration(
|
||||
// color: ColorConstants.primaryColor,
|
||||
// borderRadius: BorderRadius.circular(12)),
|
||||
// // height:Get.height*0.03,
|
||||
// // width: Get.width*0.3,
|
||||
// child: Padding(
|
||||
// padding: const EdgeInsets.all(5.0),
|
||||
// child: Text(
|
||||
// "${controller.getCompletedOrderList[index].orderid}",
|
||||
// style: const TextStyle(
|
||||
// fontSize: 11, color: Colors.white),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
//
|
||||
// ],
|
||||
// ),
|
||||
// const SizedBox(
|
||||
// height: 3,
|
||||
// ),
|
||||
// Row(
|
||||
// children: [
|
||||
// Icon(
|
||||
// Icons.location_on_rounded,
|
||||
// size: 20,
|
||||
// color: ColorConstants.primaryColor,
|
||||
// ),
|
||||
// const SizedBox(
|
||||
// width: 5,
|
||||
// ),
|
||||
// Flexible(
|
||||
// child: (Text(
|
||||
// "${controller.getCompletedOrderList[index].pickupaddress}",
|
||||
// style: const TextStyle(
|
||||
// color: Colors.black87,
|
||||
// overflow: TextOverflow.visible,
|
||||
// fontSize: 14),
|
||||
// maxLines: 1,
|
||||
// )))
|
||||
// ],
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// )),
|
||||
|
||||
Expanded(
|
||||
flex: 4,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const SizedBox(
|
||||
height: 0,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Icon(Icons.person,color: ColorConstants.primaryColor,size: 20),
|
||||
const SizedBox(width: 5,),
|
||||
Expanded(
|
||||
child: Text(
|
||||
controller.getCancelledOrderList[index].deliverycustomer??'',
|
||||
style: const TextStyle(
|
||||
color: Colors.black87, fontSize: 16),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 4,)
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height:5,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.location_on_rounded,
|
||||
size: 20,
|
||||
color: ColorConstants.primaryColor,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(top: 5),
|
||||
child: Text(
|
||||
"${controller.getCancelledOrderList[index].deliveryaddress}.",
|
||||
style: const TextStyle(
|
||||
color: Colors.black87,
|
||||
overflow: TextOverflow.visible,
|
||||
fontSize: 14),
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
const SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height:5,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.phone,
|
||||
size: 20,
|
||||
color: ColorConstants.primaryColor,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 5),
|
||||
child: Text(
|
||||
"${controller.getCancelledOrderList[index].deliverycontactno}",
|
||||
style: const TextStyle(
|
||||
color: Colors.black87,
|
||||
overflow: TextOverflow.visible,
|
||||
fontSize: 14),
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height:5,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.confirmation_num,
|
||||
size: 20,
|
||||
color: ColorConstants.primaryColor,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 5),
|
||||
child: Text(
|
||||
"${controller.getCancelledOrderList[index].orderid}",
|
||||
style: const TextStyle(
|
||||
color: Colors.black87,
|
||||
overflow: TextOverflow.visible,
|
||||
fontSize: 14),
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
|
||||
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
);
|
||||
}
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
orderShimmerCard(BuildContext context) {
|
||||
return ListView.builder(
|
||||
itemCount: 6,
|
||||
itemBuilder: (_, __) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(3.0),
|
||||
child: Container(
|
||||
height: 190,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
color: Colors.white,
|
||||
child: Card(
|
||||
color: Colors.grey[300],
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(13),
|
||||
),
|
||||
child: Shimmer.fromColors(
|
||||
enabled: true,
|
||||
highlightColor: ColorConstants.lightGreyBg!,
|
||||
baseColor: Colors.grey[300]!,
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 15),
|
||||
child: Container(
|
||||
height: 45,
|
||||
width: 45,
|
||||
decoration: const BoxDecoration(
|
||||
// shape: BoxShape.circle,
|
||||
color: Colors.white,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.black,
|
||||
fontSize: 12),
|
||||
),
|
||||
Text(
|
||||
"",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.black,
|
||||
fontSize: 12),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 15),
|
||||
child: Container(
|
||||
height: 45,
|
||||
width: 45,
|
||||
decoration: const BoxDecoration(
|
||||
// shape: BoxShape.circle,
|
||||
color: Colors.white,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.black,
|
||||
fontSize: 12),
|
||||
),
|
||||
Text(
|
||||
'',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.black,
|
||||
fontSize: 11),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 12,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(5.0),
|
||||
child: Card(
|
||||
elevation: 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 7,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(left: 10),
|
||||
child: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 3,
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 7,
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 9,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.confirmation_num,
|
||||
size: 22,
|
||||
color: Colors.black38,
|
||||
),
|
||||
SizedBox(
|
||||
width: 6,
|
||||
),
|
||||
Text(
|
||||
"",
|
||||
style: TextStyle(
|
||||
color: Colors.grey,
|
||||
fontWeight:
|
||||
FontWeight.bold,
|
||||
fontSize: 17),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
SizedBox(),
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 3,
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 6,
|
||||
),
|
||||
Text(
|
||||
"",
|
||||
style: TextStyle(
|
||||
fontWeight:
|
||||
FontWeight.bold,
|
||||
fontSize: 18,
|
||||
color: Colors.black),
|
||||
),
|
||||
Text(
|
||||
"",
|
||||
style: TextStyle(
|
||||
fontWeight:
|
||||
FontWeight.bold,
|
||||
fontSize: 15,
|
||||
color: Colors.black),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
)),
|
||||
const SizedBox(
|
||||
height: 3,
|
||||
),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.start,
|
||||
children: [
|
||||
const SizedBox(
|
||||
width: 40,
|
||||
),
|
||||
Container(
|
||||
height: 28,
|
||||
width: 28,
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.green,
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.check,
|
||||
color: Colors.white,
|
||||
),
|
||||
)
|
||||
],
|
||||
)),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Column(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Text(
|
||||
"",
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
color: Colors.black),
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Text(
|
||||
"",
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
color: Colors.black),
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Text(
|
||||
"",
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
color: Colors.black),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
width: 5,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 3,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
683
lib/View/Dashboard/Tabs/Completedview.dart
Normal file
683
lib/View/Dashboard/Tabs/Completedview.dart
Normal file
@@ -0,0 +1,683 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:shimmer/shimmer.dart';
|
||||
|
||||
import '../../../Controller/Dashboard/Tabs/Completedordercontroller.dart';
|
||||
import '../../../Helper/Constants/Assetconstants.dart';
|
||||
import '../../../Helper/Constants/Colorconstants.dart';
|
||||
import '../Orderdetails/Orderdetailsview.dart';
|
||||
|
||||
class CompletedView extends StatelessWidget {
|
||||
CompletedView({super.key});
|
||||
|
||||
CompletedOrderController completedOrderController = Get.put(CompletedOrderController()) ;
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.grey[100],
|
||||
body:Stack(
|
||||
children: [
|
||||
GetBuilder<CompletedOrderController>(
|
||||
initState: (_){
|
||||
completedOrderController.shimmer.value = true;
|
||||
completedOrderController.getCompletedOrder();
|
||||
},
|
||||
builder: (controller) {
|
||||
return
|
||||
controller.getCompletedOrderList.isEmpty &&
|
||||
!controller.shimmer.value
|
||||
? Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
const Image(
|
||||
height: 160,
|
||||
width: 160,
|
||||
image: AssetImage(AssetConstants.NoRecords),
|
||||
),
|
||||
|
||||
Text(
|
||||
"No orders at this moment",
|
||||
style: TextStyle(color: Colors.grey[600], fontSize: 18),
|
||||
),
|
||||
],
|
||||
)) :controller.shimmer.value
|
||||
? orderShimmerCard(context)
|
||||
:
|
||||
Container(
|
||||
padding: const EdgeInsets.only(left: 5, right: 5, top: 8),
|
||||
child: ListView.builder(
|
||||
padding: const EdgeInsets.only(bottom: 70),
|
||||
itemCount:
|
||||
controller.shimmer.value
|
||||
? 5
|
||||
:controller.getCompletedOrderList.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return InkWell(
|
||||
onTap: (){
|
||||
Get.to(()=>OrderDetailsView(data: controller.getCompletedOrderList[index],));
|
||||
|
||||
},
|
||||
child: Card(
|
||||
color: Colors.red[100]!.withAlpha(100),
|
||||
// Utility.getLightColors(controller.getOrderAllList[index].tenantname![0]).withAlpha(100),
|
||||
elevation: 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: SizedBox(
|
||||
height: 180,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Column(
|
||||
// mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment
|
||||
.spaceBetween,
|
||||
children: [
|
||||
Container(
|
||||
width:45,
|
||||
margin: const EdgeInsets.only(left: 8,right: 0,top: 12,bottom: 0),
|
||||
padding: const EdgeInsets.only(left: 5,right: 5,top: 5,bottom: 5),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white70,
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
// shape: BoxShape.circle
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
DateFormat("dd").format(DateFormat("yyyy-MM-dd'T'HH:mm:ss", "en_US").parse(controller.getCompletedOrderList[index].orderdate!)),
|
||||
|
||||
style: const TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight:
|
||||
FontWeight
|
||||
.w700),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 2,
|
||||
),
|
||||
Text(
|
||||
DateFormat("MMM").format(DateFormat("yyyy-MM-dd'T'HH:mm:ss", "en_US").parse(controller.getCompletedOrderList[index].orderdate!)),
|
||||
|
||||
style: const TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight:
|
||||
FontWeight
|
||||
.w700),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Column(
|
||||
children: [
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Container(
|
||||
width:45,
|
||||
margin: const EdgeInsets.only(left: 8,right: 0,top: 0,bottom: 5),
|
||||
padding: const EdgeInsets.only(left: 5,right: 5,top: 5,bottom: 5),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white70,
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
// shape: BoxShape.circle
|
||||
),
|
||||
// radius: 22,
|
||||
// backgroundColor: Colors.white70,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
DateFormat("hh:mm").format(DateFormat("yyyy-mm-dd'T'HH:mm:ss", "en_US").parse(controller.getCompletedOrderList[index].deliverydate??'')),
|
||||
style: const TextStyle(fontSize: 11,color: Colors.black,fontWeight: FontWeight.bold)),
|
||||
const SizedBox(height: 2,),
|
||||
Text(
|
||||
DateFormat("a").format(DateFormat("yyyy-mm-dd'T'HH:mm:ss", "en_US").parse(controller.getCompletedOrderList[index].deliverydate??'')),
|
||||
style: const TextStyle(fontSize: 11,color: Colors.black,fontWeight: FontWeight.bold)),
|
||||
const SizedBox(height: 2,),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 5,)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 12,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(5.0),
|
||||
child: Card(
|
||||
elevation: 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 7,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(left: 10),
|
||||
child: Column(
|
||||
children: [
|
||||
// Expanded(
|
||||
// flex: 3,
|
||||
// child: Row(
|
||||
// children: [
|
||||
// Expanded(
|
||||
// flex: 6,
|
||||
// child: Column(
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
// mainAxisAlignment: MainAxisAlignment.start,
|
||||
// children: [
|
||||
// const SizedBox(
|
||||
// height: 3,
|
||||
// ),
|
||||
// Row(
|
||||
// children: [
|
||||
// Icon(Icons.business,color: ColorConstants.primaryColor,size: 20),
|
||||
// const SizedBox(width: 5,),
|
||||
// SizedBox(
|
||||
// width: Get.width*0.30,
|
||||
// child: Text(
|
||||
// "${controller.getCompletedOrderList[index].tenantname}",
|
||||
// style: const TextStyle(
|
||||
// color: Colors.black87,
|
||||
// fontWeight: FontWeight.w500,
|
||||
// fontSize: 16),
|
||||
// maxLines: 1,
|
||||
// ),
|
||||
// ),
|
||||
// const Spacer(),
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.only(top: 10,right: 10),
|
||||
// child: Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.center,
|
||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||
// children: [
|
||||
// Container(
|
||||
// // height:Get.height*0.03,
|
||||
// // width: Get.width*0.3,
|
||||
// decoration: BoxDecoration(
|
||||
// color: ColorConstants.primaryColor,
|
||||
// borderRadius: BorderRadius.circular(12)),
|
||||
// // height:Get.height*0.03,
|
||||
// // width: Get.width*0.3,
|
||||
// child: Padding(
|
||||
// padding: const EdgeInsets.all(5.0),
|
||||
// child: Text(
|
||||
// "${controller.getCompletedOrderList[index].orderid}",
|
||||
// style: const TextStyle(
|
||||
// fontSize: 11, color: Colors.white),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
//
|
||||
// ],
|
||||
// ),
|
||||
// const SizedBox(
|
||||
// height: 3,
|
||||
// ),
|
||||
// Row(
|
||||
// children: [
|
||||
// Icon(
|
||||
// Icons.location_on_rounded,
|
||||
// size: 20,
|
||||
// color: ColorConstants.primaryColor,
|
||||
// ),
|
||||
// const SizedBox(
|
||||
// width: 5,
|
||||
// ),
|
||||
// Flexible(
|
||||
// child: (Text(
|
||||
// "${controller.getCompletedOrderList[index].pickupaddress}",
|
||||
// style: const TextStyle(
|
||||
// color: Colors.black87,
|
||||
// overflow: TextOverflow.visible,
|
||||
// fontSize: 14),
|
||||
// maxLines: 1,
|
||||
// )))
|
||||
// ],
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// )),
|
||||
|
||||
Expanded(
|
||||
flex: 4,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const SizedBox(
|
||||
height: 0,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Icon(Icons.person,color: ColorConstants.primaryColor,size: 20),
|
||||
const SizedBox(width: 5,),
|
||||
Expanded(
|
||||
child: Text(
|
||||
controller.getCompletedOrderList[index].deliverycustomer??'',
|
||||
style: const TextStyle(
|
||||
color: Colors.black87, fontSize: 16),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 4,)
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height:5,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.location_on_rounded,
|
||||
size: 20,
|
||||
color: ColorConstants.primaryColor,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(top: 5),
|
||||
child: Text(
|
||||
"${controller.getCompletedOrderList[index].deliveryaddress}.",
|
||||
style: const TextStyle(
|
||||
color: Colors.black87,
|
||||
overflow: TextOverflow.visible,
|
||||
fontSize: 14),
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
const SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height:5,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.phone,
|
||||
size: 20,
|
||||
color: ColorConstants.primaryColor,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 5),
|
||||
child: Text(
|
||||
"${controller.getCompletedOrderList[index].deliverycontactno}",
|
||||
style: const TextStyle(
|
||||
color: Colors.black87,
|
||||
overflow: TextOverflow.visible,
|
||||
fontSize: 14),
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height:5,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.confirmation_num,
|
||||
size: 20,
|
||||
color: ColorConstants.primaryColor,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 5),
|
||||
child: Text(
|
||||
"${controller.getCompletedOrderList[index].orderid}",
|
||||
style: const TextStyle(
|
||||
color: Colors.black87,
|
||||
overflow: TextOverflow.visible,
|
||||
fontSize: 14),
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
|
||||
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
);
|
||||
}
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
orderShimmerCard(BuildContext context) {
|
||||
return ListView.builder(
|
||||
itemCount: 6,
|
||||
itemBuilder: (_, __) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(3.0),
|
||||
child: Container(
|
||||
height: 190,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
color: Colors.white,
|
||||
child: Card(
|
||||
color: Colors.grey[300],
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(13),
|
||||
),
|
||||
child: Shimmer.fromColors(
|
||||
enabled: true,
|
||||
highlightColor: ColorConstants.lightGreyBg!,
|
||||
baseColor: Colors.grey[300]!,
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 15),
|
||||
child: Container(
|
||||
height: 45,
|
||||
width: 45,
|
||||
decoration: const BoxDecoration(
|
||||
// shape: BoxShape.circle,
|
||||
color: Colors.white,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.black,
|
||||
fontSize: 12),
|
||||
),
|
||||
Text(
|
||||
"",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.black,
|
||||
fontSize: 12),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 15),
|
||||
child: Container(
|
||||
height: 45,
|
||||
width: 45,
|
||||
decoration: const BoxDecoration(
|
||||
// shape: BoxShape.circle,
|
||||
color: Colors.white,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.black,
|
||||
fontSize: 12),
|
||||
),
|
||||
Text(
|
||||
'',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.black,
|
||||
fontSize: 11),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 12,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(5.0),
|
||||
child: Card(
|
||||
elevation: 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 7,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(left: 10),
|
||||
child: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 3,
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 7,
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 9,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.confirmation_num,
|
||||
size: 22,
|
||||
color: Colors.black38,
|
||||
),
|
||||
SizedBox(
|
||||
width: 6,
|
||||
),
|
||||
Text(
|
||||
"",
|
||||
style: TextStyle(
|
||||
color: Colors.grey,
|
||||
fontWeight:
|
||||
FontWeight.bold,
|
||||
fontSize: 17),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
SizedBox(),
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 3,
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 6,
|
||||
),
|
||||
Text(
|
||||
"",
|
||||
style: TextStyle(
|
||||
fontWeight:
|
||||
FontWeight.bold,
|
||||
fontSize: 18,
|
||||
color: Colors.black),
|
||||
),
|
||||
Text(
|
||||
"",
|
||||
style: TextStyle(
|
||||
fontWeight:
|
||||
FontWeight.bold,
|
||||
fontSize: 15,
|
||||
color: Colors.black),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
)),
|
||||
const SizedBox(
|
||||
height: 3,
|
||||
),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.start,
|
||||
children: [
|
||||
const SizedBox(
|
||||
width: 40,
|
||||
),
|
||||
Container(
|
||||
height: 28,
|
||||
width: 28,
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.green,
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.check,
|
||||
color: Colors.white,
|
||||
),
|
||||
)
|
||||
],
|
||||
)),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Column(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Text(
|
||||
"",
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
color: Colors.black),
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Text(
|
||||
"",
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
color: Colors.black),
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Text(
|
||||
"",
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
color: Colors.black),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
width: 5,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 3,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
566
lib/View/Dashboard/Tabs/Createdview.dart
Normal file
566
lib/View/Dashboard/Tabs/Createdview.dart
Normal file
@@ -0,0 +1,566 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
import 'package:percent_indicator/circular_percent_indicator.dart';
|
||||
import '../../../Controller/Orders/Ordercontroller.dart';
|
||||
import '../../../Controller/products/product_controller.dart';
|
||||
import '../../../Globalwidgets/textwidget.dart';
|
||||
import '../../../Helper/Constants/Colorconstants.dart';
|
||||
import '../../../Helper/Logger.dart';
|
||||
import '../../../Model/Response/Summary/Getsummarysresponse.dart';
|
||||
import '../../../widgets/product_bottom_sheet.dart';
|
||||
import '../../Orders/Deliverydetails/delivery_detail_view.dart';
|
||||
import '../Dashboardview.dart';
|
||||
|
||||
|
||||
class OrderView extends StatelessWidget {
|
||||
const OrderView({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final OrderController controller = Get.put(OrderController());
|
||||
controller.getOrders('today');
|
||||
|
||||
return DefaultTabController(
|
||||
length: 4,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
automaticallyImplyLeading: false,
|
||||
title: Obx(() {
|
||||
return controller.searchMode.value
|
||||
? TextField(
|
||||
controller: controller.searchController,
|
||||
autofocus: true,
|
||||
decoration: InputDecoration(
|
||||
hintText: 'Search Orders',
|
||||
filled: true,
|
||||
fillColor: Colors.white,
|
||||
contentPadding: EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
suffixIcon: IconButton(
|
||||
icon: const Icon(Icons.close, color: ColorConstants.primaryColor),
|
||||
onPressed: () {
|
||||
controller.searchController.clear();
|
||||
controller.searchMode.value = false;
|
||||
controller.search('');
|
||||
},
|
||||
),
|
||||
),
|
||||
onChanged: (value) {
|
||||
controller.search(value);
|
||||
},
|
||||
)
|
||||
: const TextWidget(
|
||||
text: 'Orders',
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 20,
|
||||
);
|
||||
}),
|
||||
|
||||
actions: [
|
||||
/// Search icon — hidden when searchMode is ON
|
||||
Obx(() {
|
||||
if (controller.currentTabIndex.value == 3) {
|
||||
return SizedBox();
|
||||
}
|
||||
|
||||
return controller.searchMode.value
|
||||
? SizedBox() // <- Hides extra close icon
|
||||
: IconButton(
|
||||
icon: const Icon(Icons.search, color: ColorConstants.primaryColor),
|
||||
onPressed: () {
|
||||
controller.searchMode.value = true;
|
||||
},
|
||||
);
|
||||
}),
|
||||
],
|
||||
|
||||
bottom: TabBar(
|
||||
indicatorColor: ColorConstants.primaryColor,
|
||||
labelColor: ColorConstants.primaryColor,
|
||||
unselectedLabelColor: ColorConstants.darkGreyColor,
|
||||
onTap: (index) {
|
||||
controller.currentTabIndex.value = index;
|
||||
|
||||
switch (index) {
|
||||
case 0: controller.getOrders('today'); break;
|
||||
case 1: controller.getOrders('week'); break;
|
||||
case 2: controller.getOrders('month'); break;
|
||||
case 3: controller.getSummary(); break;
|
||||
}
|
||||
|
||||
controller.searchMode.value = false;
|
||||
controller.searchController.clear();
|
||||
controller.update();
|
||||
},
|
||||
tabs: const [
|
||||
Tab(text: 'Today'),
|
||||
Tab(text: 'This Week'),
|
||||
Tab(text: 'This Month'),
|
||||
Tab(text: 'Summary'),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
body: Column(
|
||||
children: [
|
||||
SizedBox(height: 10,),
|
||||
Expanded(
|
||||
child: TabBarView(
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
children: [
|
||||
/// Today Tab
|
||||
OrderListView(controller: controller),
|
||||
/// Week Tab
|
||||
OrderListView(controller: controller),
|
||||
/// Month Tab
|
||||
OrderListView(controller: controller),
|
||||
/// Summary Tab
|
||||
GetBuilder<OrderController>(
|
||||
builder: (_) {
|
||||
return OrderInsightsGrid(
|
||||
total: controller.orderSummaryDetails.total ?? 0,
|
||||
pending: controller.orderSummaryDetails.pending ?? 0,
|
||||
delivered: controller.orderSummaryDetails.delivered ?? 0,
|
||||
cancelled: controller.orderSummaryDetails.cancelled ?? 0,
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// Widget to display the list of orders
|
||||
class OrderListView extends StatelessWidget {
|
||||
final OrderController controller;
|
||||
|
||||
OrderListView({super.key, required this.controller});
|
||||
|
||||
final ProductController productController = Get.put(ProductController());
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GetBuilder<OrderController>(
|
||||
builder: (controller) {
|
||||
if (controller.isOrdersLoading.value) {
|
||||
return const Center(child: ShimmerListView(height: 180));
|
||||
}
|
||||
final displayList = controller.searchMode.value ?
|
||||
controller.searchOrderList :
|
||||
controller.orderAllList;
|
||||
logger.i('orderAllList : ${controller.orderAllList}');
|
||||
logger.i('SearchList : ${controller.searchOrderList}');
|
||||
logger.i('DisplayList : ${displayList}');
|
||||
return Column(
|
||||
children: [
|
||||
// Visibility(
|
||||
// visible: controller.currentTabIndex.value != 3 && controller.orderAllList.isNotEmpty,
|
||||
// child: Padding(
|
||||
// padding: const EdgeInsets.all(12.0),
|
||||
// child: TextField(
|
||||
// controller: controller.searchController,
|
||||
// decoration: InputDecoration(
|
||||
// hintText: 'Search Orders',
|
||||
// filled: true,
|
||||
// fillColor: ColorConstants.secondaryColor,
|
||||
// border: OutlineInputBorder(
|
||||
// borderRadius: BorderRadius.circular(8.0),
|
||||
// ),
|
||||
// enabledBorder: OutlineInputBorder(
|
||||
// borderSide: BorderSide(color: Colors.grey.shade300),
|
||||
// borderRadius: BorderRadius.circular(8.0),
|
||||
// ),
|
||||
// focusedBorder: OutlineInputBorder(
|
||||
// borderSide: BorderSide(
|
||||
// color: ColorConstants.primaryColor, width: 2),
|
||||
// borderRadius: BorderRadius.circular(8.0),
|
||||
// ),
|
||||
// suffixIcon: Visibility(
|
||||
// visible: controller.searchController.text.isNotEmpty,
|
||||
// child: IconButton(
|
||||
// icon: const Icon(
|
||||
// Icons.cancel,
|
||||
// color: ColorConstants.primaryColor,
|
||||
// ),
|
||||
// onPressed: () {
|
||||
// controller.searchController.clear();
|
||||
// controller.search(controller.searchController.text);
|
||||
// controller.searchMode.value = false;
|
||||
// FocusScope.of(context).unfocus();
|
||||
// },
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// onChanged: (value) {
|
||||
// controller.search(value);
|
||||
// },
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
Expanded(
|
||||
child: displayList.isEmpty && !controller.isOrdersLoading.value
|
||||
? emptyOrdersWidget()
|
||||
: ListView.builder(
|
||||
itemCount: displayList.length,
|
||||
itemBuilder: (context, index) {
|
||||
final order = displayList[index];
|
||||
logger.i('FinalOrder : ${order.orderid}');
|
||||
return OrderListItem(
|
||||
order: order,
|
||||
controller: controller,
|
||||
index: index,
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// Order List Items
|
||||
class OrderListItem extends StatelessWidget {
|
||||
final DeliveriesDetails order;
|
||||
final int index;
|
||||
final dynamic controller;
|
||||
|
||||
OrderListItem({
|
||||
Key? key,
|
||||
required this.order,
|
||||
required this.index,
|
||||
required this.controller,
|
||||
}) : super(key: key);
|
||||
|
||||
final ProductController productController = Get.put(ProductController());
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// final currentOrder = controller.orderAllList[index];
|
||||
|
||||
logger.i('Current Order List : ${order.orderid}');
|
||||
|
||||
final date = order.deliverydate != ""
|
||||
? DateFormat("yyyy-MM-dd'T'HH:mm:ss", "en_US").parse(order.deliverydate!)
|
||||
: null;
|
||||
|
||||
final formattedDate = date != null ? DateFormat("dd MMM yyyy").format(date) : "--";
|
||||
final time = date != null ? DateFormat("hh:mm a").format(date) : "--:--";
|
||||
logger.i('Current Order : ${order.actualkms}');
|
||||
|
||||
return Card(
|
||||
margin: const EdgeInsets.symmetric(horizontal: 12, vertical: 5),
|
||||
elevation: 0,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
|
||||
child: InkWell(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
onTap: () async {
|
||||
final orderId = order.orderheaderid ?? 0;
|
||||
print("order id :${orderId}");
|
||||
// Fetch products for this order
|
||||
await productController.getProductDetails(orderId);
|
||||
|
||||
|
||||
Get.to(() => OrderDetailsPage(
|
||||
productDetails: productController.productDetail,
|
||||
orderDetails: order,
|
||||
)
|
||||
);
|
||||
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// Order ID, Date, and Info Icon Row
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Order ID: ${order.orderid}",
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
formattedDate,
|
||||
style: const TextStyle(
|
||||
color: Colors.grey,
|
||||
fontSize: 13,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 5),
|
||||
Container(
|
||||
height: 10,
|
||||
width: 1,
|
||||
color: Colors.grey,
|
||||
),
|
||||
const SizedBox(width: 5),
|
||||
Text(
|
||||
time,
|
||||
style: const TextStyle(
|
||||
color: Colors.grey,
|
||||
fontSize: 13,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
IconButton(
|
||||
padding: EdgeInsets.zero,
|
||||
icon: const Icon(Icons.info_outline, size: 20),
|
||||
onPressed: () async {
|
||||
final orderId = order.orderheaderid ?? 1;
|
||||
await productController.getProductDetails(orderId);
|
||||
if (context.mounted) {
|
||||
ProductBottomSheet.show(context, productController.productDetail, isAmountReceived: true);
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
const SizedBox(height: 12),
|
||||
|
||||
// Distance Row
|
||||
Row(
|
||||
children: [
|
||||
const Icon(Icons.delivery_dining, size: 20, color: Colors.orange),
|
||||
const SizedBox(width: 6),
|
||||
Text(
|
||||
"${order.actualkms != null && order.actualkms != 'null' ? order.actualkms : '0.0'} Km",
|
||||
style: const TextStyle(fontWeight: FontWeight.w500),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
const SizedBox(height: 12),
|
||||
|
||||
// Rider and Customer Info
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Icon(Icons.person, size: 20, color: Colors.teal),
|
||||
const SizedBox(width: 6),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Rider: ${order.ridername ?? "Unknown"}",
|
||||
style: const TextStyle(fontSize: 14, fontWeight: FontWeight.w500),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
"Customer: ${order.deliverycustomer ?? "Unknown"}",
|
||||
style: const TextStyle(fontSize: 14, color: Colors.grey),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
const SizedBox(height: 10),
|
||||
|
||||
|
||||
// Payment and Status Row
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
const Icon(Icons.wallet, size: 20, color: Colors.green),
|
||||
const SizedBox(width: 6),
|
||||
Text(
|
||||
"₹ ${order.orderamount ?? 0}",
|
||||
style: const TextStyle(fontWeight: FontWeight.w600),
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6),
|
||||
decoration: BoxDecoration(
|
||||
color: _getStatusColor(order.orderstatus),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: Text(
|
||||
order.orderstatus?.toUpperCase() ?? "-",
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 13,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Color _getStatusColor(String? status) {
|
||||
switch (status) {
|
||||
case 'delivered':
|
||||
return Colors.green;
|
||||
case 'cancelled':
|
||||
return Colors.red;
|
||||
default:
|
||||
return Colors.orange;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
class OrderInsightsGrid extends StatelessWidget {
|
||||
final int total;
|
||||
final int pending;
|
||||
final int delivered;
|
||||
final int cancelled;
|
||||
|
||||
OrderInsightsGrid({
|
||||
super.key,
|
||||
required this.total,
|
||||
required this.pending,
|
||||
required this.delivered,
|
||||
required this.cancelled,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: GridView.count(
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
crossAxisCount: 2,
|
||||
mainAxisSpacing: 16,
|
||||
crossAxisSpacing: 16,
|
||||
childAspectRatio: .70,
|
||||
children: [
|
||||
_buildInsightCard(
|
||||
label: "Total Orders",
|
||||
count: total,
|
||||
icon: Icons.list_alt,
|
||||
color: Colors.blue,
|
||||
showChart: false,
|
||||
),
|
||||
_buildInsightCard(
|
||||
label: "Pending",
|
||||
count: pending,
|
||||
percent: total > 0 ? pending / total : 0.0,
|
||||
icon: Icons.schedule,
|
||||
color: Colors.orange,
|
||||
),
|
||||
_buildInsightCard(
|
||||
label: "Delivered",
|
||||
count: delivered,
|
||||
percent: total > 0 ? delivered / total : 0.0,
|
||||
icon: Icons.check_circle,
|
||||
color: Colors.green,
|
||||
),
|
||||
_buildInsightCard(
|
||||
label: "Cancelled",
|
||||
count: cancelled,
|
||||
percent: total > 0 ? cancelled / total : 0.0,
|
||||
icon: Icons.cancel,
|
||||
color: Colors.red,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildInsightCard({
|
||||
required String label,
|
||||
required int count,
|
||||
double percent = 1.0,
|
||||
required IconData icon,
|
||||
required Color color,
|
||||
bool showChart = true,
|
||||
}) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
if (showChart)
|
||||
SizedBox(
|
||||
height: 60,
|
||||
width: 60,
|
||||
child: CircularPercentIndicator(
|
||||
radius: 30,
|
||||
lineWidth: 5,
|
||||
percent: percent.clamp(0.0, 1.0),
|
||||
center: Icon(icon, color: color, size: 24),
|
||||
backgroundColor: color.withOpacity(0.1),
|
||||
progressColor: color,
|
||||
animation: true,
|
||||
),
|
||||
)
|
||||
else
|
||||
Icon(icon, color: color, size: 32),
|
||||
const SizedBox(height: 12),
|
||||
TextWidget(
|
||||
text: "$count",
|
||||
fontWeight: FontWeight.w700,
|
||||
color: color,
|
||||
fontSize: 20,
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
TextWidget(
|
||||
text: label,
|
||||
fontSize: 16,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
if (showChart)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 4),
|
||||
child: TextWidget(
|
||||
text: "${(percent * 100).toStringAsFixed(1)}%",
|
||||
fontSize: 14,
|
||||
color: ColorConstants.darkGreyColor?.withOpacity(0.5),
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
681
lib/View/Dashboard/Tabs/Ongoingview.dart
Normal file
681
lib/View/Dashboard/Tabs/Ongoingview.dart
Normal file
@@ -0,0 +1,681 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:shimmer/shimmer.dart';
|
||||
import '../../../Controller/Dashboard/Tabs/Ongoingordercontroller.dart';
|
||||
import '../../../Helper/Constants/Assetconstants.dart';
|
||||
import '../../../Helper/Constants/Colorconstants.dart';
|
||||
import '../../../Helper/utility.dart';
|
||||
import '../Orderdetails/Orderdetailsview.dart';
|
||||
|
||||
class OnGoingView extends StatelessWidget {
|
||||
OnGoingView({super.key});
|
||||
|
||||
OnGoingOrderController onGoingOrderController = Get.put(OnGoingOrderController());
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.grey[100],
|
||||
body:Stack(
|
||||
children: [
|
||||
GetBuilder<OnGoingOrderController>(
|
||||
initState: (_){
|
||||
onGoingOrderController.shimmer.value = true;
|
||||
onGoingOrderController.getCurrentOrder();
|
||||
},
|
||||
builder: (controller) {
|
||||
return
|
||||
controller.getCurrentOrderList.isEmpty &&
|
||||
!controller.shimmer.value
|
||||
? Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
const Image(
|
||||
height: 160,
|
||||
width: 160,
|
||||
image: AssetImage(AssetConstants.NoRecords),
|
||||
),
|
||||
|
||||
Text(
|
||||
"No orders at this moment",
|
||||
style: TextStyle(color: Colors.grey[600], fontSize: 18),
|
||||
),
|
||||
],
|
||||
)) :controller.shimmer.value
|
||||
? orderShimmerCard(context)
|
||||
:
|
||||
Container(
|
||||
padding: const EdgeInsets.only(left: 5, right: 5, top: 8),
|
||||
child: ListView.builder(
|
||||
padding: const EdgeInsets.only(bottom: 70),
|
||||
itemCount:
|
||||
controller.shimmer.value
|
||||
? 5
|
||||
:controller.getCurrentOrderList.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return InkWell(
|
||||
onTap: (){
|
||||
Get.to(()=>OrderDetailsView(data: controller.getCurrentOrderList[index],));
|
||||
},
|
||||
child: Card(
|
||||
color: Colors.red[100]!.withAlpha(100),
|
||||
// Utility.getLightColors(controller.getOrderAllList[index].tenantname![0]).withAlpha(100),
|
||||
elevation: 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: SizedBox(
|
||||
height: 180,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Column(
|
||||
// mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment
|
||||
.spaceBetween,
|
||||
children: [
|
||||
Container(
|
||||
width:45,
|
||||
margin: const EdgeInsets.only(left: 8,right: 0,top: 12,bottom: 0),
|
||||
padding: const EdgeInsets.only(left: 5,right: 5,top: 5,bottom: 5),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white70,
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
// shape: BoxShape.circle
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
DateFormat("dd").format(DateFormat("yyyy-MM-dd'T'HH:mm:ss", "en_US").parse(controller.getCurrentOrderList[index].orderdate!)),
|
||||
|
||||
style: const TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight:
|
||||
FontWeight
|
||||
.w700),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 2,
|
||||
),
|
||||
Text(
|
||||
DateFormat("MMM").format(DateFormat("yyyy-MM-dd'T'HH:mm:ss", "en_US").parse(controller.getCurrentOrderList[index].orderdate!)),
|
||||
|
||||
style: const TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight:
|
||||
FontWeight
|
||||
.w700),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Column(
|
||||
children: [
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Container(
|
||||
width:45,
|
||||
margin: const EdgeInsets.only(left: 8,right: 0,top: 0,bottom: 5),
|
||||
padding: const EdgeInsets.only(left: 5,right: 5,top: 5,bottom: 5),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white70,
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
// shape: BoxShape.circle
|
||||
),
|
||||
// radius: 22,
|
||||
// backgroundColor: Colors.white70,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
DateFormat("hh:mm").format(DateFormat("yyyy-mm-dd'T'HH:mm:ss", "en_US").parse(controller.getCurrentOrderList[index].deliverydate??'')),
|
||||
style: const TextStyle(fontSize: 11,color: Colors.black,fontWeight: FontWeight.bold)),
|
||||
const SizedBox(height: 2,),
|
||||
Text(
|
||||
DateFormat("a").format(DateFormat("yyyy-mm-dd'T'HH:mm:ss", "en_US").parse(controller.getCurrentOrderList[index].deliverydate??'')),
|
||||
style: const TextStyle(fontSize: 11,color: Colors.black,fontWeight: FontWeight.bold)),
|
||||
const SizedBox(height: 2,),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 5,)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 12,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(5.0),
|
||||
child: Card(
|
||||
elevation: 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 7,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(left: 10),
|
||||
child: Column(
|
||||
children: [
|
||||
// Expanded(
|
||||
// flex: 3,
|
||||
// child: Row(
|
||||
// children: [
|
||||
// Expanded(
|
||||
// flex: 6,
|
||||
// child: Column(
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
// mainAxisAlignment: MainAxisAlignment.start,
|
||||
// children: [
|
||||
// const SizedBox(
|
||||
// height: 3,
|
||||
// ),
|
||||
// Row(
|
||||
// children: [
|
||||
// Icon(Icons.business,color: ColorConstants.primaryColor,size: 20),
|
||||
// const SizedBox(width: 5,),
|
||||
// SizedBox(
|
||||
// width: Get.width*0.30,
|
||||
// child: Text(
|
||||
// "${controller.getCurrentOrderList[index].tenantname}",
|
||||
// style: const TextStyle(
|
||||
// color: Colors.black87,
|
||||
// fontWeight: FontWeight.w500,
|
||||
// fontSize: 16),
|
||||
// maxLines: 1,
|
||||
// ),
|
||||
// ),
|
||||
// const Spacer(),
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.only(top: 10,right: 10),
|
||||
// child: Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.center,
|
||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||
// children: [
|
||||
// Container(
|
||||
// // height:Get.height*0.03,
|
||||
// // width: Get.width*0.3,
|
||||
// decoration: BoxDecoration(
|
||||
// color: ColorConstants.primaryColor,
|
||||
// borderRadius: BorderRadius.circular(12)),
|
||||
// // height:Get.height*0.03,
|
||||
// // width: Get.width*0.3,
|
||||
// child: Padding(
|
||||
// padding: const EdgeInsets.all(5.0),
|
||||
// child: Text(
|
||||
// "${controller.getCurrentOrderList[index].orderid}",
|
||||
// style: const TextStyle(
|
||||
// fontSize: 11, color: Colors.white),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
//
|
||||
// ],
|
||||
// ),
|
||||
// const SizedBox(
|
||||
// height: 3,
|
||||
// ),
|
||||
// Row(
|
||||
// children: [
|
||||
// Icon(
|
||||
// Icons.location_on_rounded,
|
||||
// size: 20,
|
||||
// color: ColorConstants.primaryColor,
|
||||
// ),
|
||||
// const SizedBox(
|
||||
// width: 5,
|
||||
// ),
|
||||
// Flexible(
|
||||
// child: (Text(
|
||||
// "${controller.getCurrentOrderList[index].pickupaddress}",
|
||||
// style: const TextStyle(
|
||||
// color: Colors.black87,
|
||||
// overflow: TextOverflow.visible,
|
||||
// fontSize: 14),
|
||||
// maxLines: 1,
|
||||
// )))
|
||||
// ],
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// )),
|
||||
|
||||
Expanded(
|
||||
flex: 4,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const SizedBox(
|
||||
height: 0,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Icon(Icons.person,color: ColorConstants.primaryColor,size: 20),
|
||||
const SizedBox(width: 5,),
|
||||
Expanded(
|
||||
child: Text(
|
||||
controller.getCurrentOrderList[index].deliverycustomer??'',
|
||||
style: const TextStyle(
|
||||
color: Colors.black87, fontSize: 16),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 4,)
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height:5,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.location_on_rounded,
|
||||
size: 20,
|
||||
color: ColorConstants.primaryColor,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(top: 5),
|
||||
child: Text(
|
||||
"${controller.getCurrentOrderList[index].deliveryaddress}.",
|
||||
style: const TextStyle(
|
||||
color: Colors.black87,
|
||||
overflow: TextOverflow.visible,
|
||||
fontSize: 14),
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
const SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height:5,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.phone,
|
||||
size: 20,
|
||||
color: ColorConstants.primaryColor,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 5),
|
||||
child: Text(
|
||||
"${controller.getCurrentOrderList[index].deliverycontactno}",
|
||||
style: const TextStyle(
|
||||
color: Colors.black87,
|
||||
overflow: TextOverflow.visible,
|
||||
fontSize: 14),
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height:5,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.confirmation_num,
|
||||
size: 20,
|
||||
color: ColorConstants.primaryColor,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 5),
|
||||
child: Text(
|
||||
"${controller.getCurrentOrderList[index].orderid}",
|
||||
style: const TextStyle(
|
||||
color: Colors.black87,
|
||||
overflow: TextOverflow.visible,
|
||||
fontSize: 14),
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
|
||||
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
);
|
||||
}
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
orderShimmerCard(BuildContext context) {
|
||||
return ListView.builder(
|
||||
itemCount: 6,
|
||||
itemBuilder: (_, __) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(3.0),
|
||||
child: Container(
|
||||
height: 190,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
color: Colors.white,
|
||||
child: Card(
|
||||
color: Colors.grey[300],
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(13),
|
||||
),
|
||||
child: Shimmer.fromColors(
|
||||
enabled: true,
|
||||
highlightColor: ColorConstants.lightGreyBg!,
|
||||
baseColor: Colors.grey[300]!,
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 15),
|
||||
child: Container(
|
||||
height: 45,
|
||||
width: 45,
|
||||
decoration: const BoxDecoration(
|
||||
// shape: BoxShape.circle,
|
||||
color: Colors.white,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.black,
|
||||
fontSize: 12),
|
||||
),
|
||||
Text(
|
||||
"",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.black,
|
||||
fontSize: 12),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 15),
|
||||
child: Container(
|
||||
height: 45,
|
||||
width: 45,
|
||||
decoration: const BoxDecoration(
|
||||
// shape: BoxShape.circle,
|
||||
color: Colors.white,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.black,
|
||||
fontSize: 12),
|
||||
),
|
||||
Text(
|
||||
'',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.black,
|
||||
fontSize: 11),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 12,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(5.0),
|
||||
child: Card(
|
||||
elevation: 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 7,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(left: 10),
|
||||
child: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 3,
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 7,
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 9,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.confirmation_num,
|
||||
size: 22,
|
||||
color: Colors.black38,
|
||||
),
|
||||
SizedBox(
|
||||
width: 6,
|
||||
),
|
||||
Text(
|
||||
"",
|
||||
style: TextStyle(
|
||||
color: Colors.grey,
|
||||
fontWeight:
|
||||
FontWeight.bold,
|
||||
fontSize: 17),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
SizedBox(),
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 3,
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 6,
|
||||
),
|
||||
Text(
|
||||
"",
|
||||
style: TextStyle(
|
||||
fontWeight:
|
||||
FontWeight.bold,
|
||||
fontSize: 18,
|
||||
color: Colors.black),
|
||||
),
|
||||
Text(
|
||||
"",
|
||||
style: TextStyle(
|
||||
fontWeight:
|
||||
FontWeight.bold,
|
||||
fontSize: 15,
|
||||
color: Colors.black),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
)),
|
||||
const SizedBox(
|
||||
height: 3,
|
||||
),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.start,
|
||||
children: [
|
||||
const SizedBox(
|
||||
width: 40,
|
||||
),
|
||||
Container(
|
||||
height: 28,
|
||||
width: 28,
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.green,
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.check,
|
||||
color: Colors.white,
|
||||
),
|
||||
)
|
||||
],
|
||||
)),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Column(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Text(
|
||||
"",
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
color: Colors.black),
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Text(
|
||||
"",
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
color: Colors.black),
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Text(
|
||||
"",
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
color: Colors.black),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
width: 5,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 3,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user