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,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user