second commit

This commit is contained in:
Anbarasu
2026-05-27 10:35:09 +05:30
parent c53794c04c
commit 1435ac47b0
501 changed files with 52818 additions and 0 deletions

View File

@@ -0,0 +1,883 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:intl/intl.dart';
import 'package:shimmer/shimmer.dart';
import '../../../Controller/Orders/Tabs/Monthcontroller.dart';
import '../../../Helper/Constants/Assetconstants.dart';
import '../../../Helper/Constants/Colorconstants.dart';
import '../Deliverydetails/Deliverydetailsview.dart';
class MonthOrderView extends StatelessWidget {
MonthOrderView({super.key});
MonthOrderController monthOrderController = Get.put(MonthOrderController());
@override
Widget build(BuildContext context) {
return GetBuilder<MonthOrderController>(
initState: (_){
monthOrderController.shimmer.value = true;
monthOrderController.getOrders();
},
builder: (controller) {
return Scaffold(
backgroundColor: Colors.grey[100],
body: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(left: 10, top: 5),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(top: 5, right: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Container(
height: Get.height * 0.06,
width: Get.width * 0.94,
child: TextField(
// textAlign: TextAlign.center,
controller: controller.searchController,
// style: TextStyle(fontSize: 15),
onChanged: (data) {
controller.search(data);
controller.update();
},
decoration: InputDecoration(
contentPadding: EdgeInsets.only(
bottom: 10,
right: 45,
// left: 10
),
border: OutlineInputBorder(
borderRadius:
BorderRadius.circular(30),
borderSide: BorderSide(
color: ColorConstants.primaryColor,
)),
enabledBorder: OutlineInputBorder(
borderRadius:
BorderRadius.circular(30),
borderSide: BorderSide(
color: ColorConstants.primaryColor,
)),
focusedBorder: OutlineInputBorder(
borderRadius:
BorderRadius.circular(30),
borderSide: BorderSide(
color: ColorConstants.primaryColor,
)),
prefixIcon: Icon(
Icons.search,
color: ColorConstants.primaryColor,
),
// suffixIcon: popUp(),
hintText: 'Name'),
),
),
],
),
),
],
),
),
Expanded(
child:monthOrderController.orderAllList.length == 0&& !monthOrderController.shimmer.value
? Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: 92,
),
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): ListView.builder(
itemCount: controller.orderAllList.length,
itemBuilder: (BuildContext context, int index) {
return Container(
// height: Get.height * 0.21,
// width: Get.width * 0.9,
margin:
EdgeInsets.only(left: 10, right: 10, top: 5),
padding: EdgeInsets.only(
left: 10, right: 10, top: 10, bottom: 10),
decoration: BoxDecoration(
color: ColorConstants.secondaryColor,
borderRadius: BorderRadius.circular(10)),
child: InkWell(
onTap: (){
// Get.to(()=> DeliveryDetailsView(data: controller.orderAllList[index]));
},
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(top: 4),
child: Column(
children: [
Row(
children: [
Container(
height: Get.height * 0.06,
width: Get.width * 0.13,
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(
5),
border: Border.all(
color: ColorConstants
.primaryColor)),
child: Column(
mainAxisAlignment:
MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
controller.orderAllList[index].deliverydate == "" ? Text(''):
Text(
'${DateFormat("dd").format(DateFormat("yyyy-MM-dd'T'HH:mm:ss", "en_US").parse(controller.orderAllList[index].deliverydate!))}',
style: TextStyle(
color: Colors.black87,
fontWeight:
FontWeight.bold,
fontSize: 15,
),
),
controller.orderAllList[index].deliverydate == "" ? Text(''):
Text(
'${DateFormat("MMM").format(DateFormat("yyyy-MM-dd'T'HH:mm:ss", "en_US").parse(controller.orderAllList[index].deliverydate!))}',
style: TextStyle(
color: Colors.black87,
fontWeight:
FontWeight.bold,
fontSize: 15,
),
),
],
),
),
SizedBox(
width: 7,
),
Container(
height: Get.height * 0.06,
width: Get.width * 0.13,
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(
5),
border: Border.all(
color: ColorConstants
.primaryColor!)),
child: Column(
mainAxisAlignment:
MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Icon(
Icons.delivery_dining,
size: 25,
color: ColorConstants
.primaryColor,
),
controller.orderAllList[index].kms==null?Text(
'0.0',
style: TextStyle(
color: Colors.black87,
fontWeight:
FontWeight.bold,
fontSize: 12,
),
):Text(
'${controller.orderAllList[index].kms?.toString()}Km',
style: TextStyle(
color: Colors.black87,
fontWeight:
FontWeight.bold,
fontSize: 12,
),
),
],
),
),
],
),
SizedBox(
height: 10,
),
Container(
height: Get.height * 0.05,
width: Get.width * 0.28,
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(5),
border: Border.all(
color: Colors.grey[400]!)),
child: Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
SizedBox(width: 10,),
CircleAvatar(
radius: 10,
backgroundColor: ColorConstants.primaryColor1,
child: controller.orderAllList[index].paymenttype==42?Icon(Icons.mobile_friendly,color: ColorConstants.primaryColor,size: 12,):controller.orderAllList[index].paymenttype==43?Icon(Icons.money,color: ColorConstants.primaryColor,size: 12,):Icon(Icons.wallet,color: ColorConstants.primaryColor,size: 12,)),
SizedBox(width: 07,),
Text(
"${controller.orderAllList[index].deliverycharges}",
style: TextStyle(
color: Colors.black87,
fontWeight: FontWeight.bold,
fontSize: 15,
),
),
],
),
),
SizedBox(
height: 9,
),
controller.orderAllList[index].orderstatus =='cancelled'?Container(
height: Get.height*0.04,
width: Get.width*0.3,
decoration: BoxDecoration(color:Colors.red,borderRadius: BorderRadius.circular(10)),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(width: 5,),
Icon(Icons.cancel,
color: ColorConstants.secondaryColor, size: 18),
SizedBox(width: 6,),
Text(
'${controller.orderAllList[index].orderstatus }',
style: TextStyle(
color: ColorConstants.secondaryColor,
fontWeight: FontWeight.bold,
fontSize: 15)),
],
),
):Container(
height: Get.height*0.04,
width: Get.width*0.3,
decoration: BoxDecoration(color:controller.orderAllList[index].orderstatus =='completed'?Colors.green: Colors.grey[100],borderRadius: BorderRadius.circular(10)),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(width: 5,),
CircleAvatar(
backgroundColor:controller.orderAllList[index].orderstatus =='completed'?
ColorConstants.secondaryColor:
ColorConstants.primaryColor1,
radius: 10,
child: Icon(Icons.check,
color: Colors.grey, size: 15),
),
SizedBox(width: 6,),
Text(
'${controller.orderAllList[index].orderstatus }',
style: TextStyle(
color:controller.orderAllList[index].orderstatus =='completed'?
ColorConstants.secondaryColor: ColorConstants.primaryColor,
fontWeight: FontWeight.bold,
fontSize: 15)),
],
),
),
],
),
),
SizedBox(
width: 10,
),
Padding(
padding: const EdgeInsets.only(top: 7),
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Icon(
Icons.person,
color: Colors.grey[500],
size: 22,
),
SizedBox(
width: 4,
),
Padding(
padding: const EdgeInsets.only(
top: 2),
child: Container(
width: Get.width*0.35,
child: Text(
'${controller.orderAllList[index].pickupcustomer}',
style: TextStyle(
color: Colors.black87,
fontWeight:
FontWeight.normal,
fontSize: 14,
),
maxLines: 2,
),
),
),
],
),
SizedBox(
height: 10,
),
// Row(
// mainAxisAlignment:
// MainAxisAlignment.start,
// crossAxisAlignment:
// CrossAxisAlignment.start,
// children: [
// Icon(
// Icons.location_on,
// color: Colors.grey[500],
// size: 22,
// ),
// SizedBox(
// width: 4,
// ),
// Padding(
// padding: const EdgeInsets.only(
// top: 2),
// child: Container(
// width: Get.width*0.35,
// child: Text(
// '${controller.orderAllList[index].delivceryaddress}',
// style: TextStyle(
// color: Colors.black87,
// fontWeight:
// FontWeight.normal,
// fontSize: 14,
//
// ),
// maxLines: 2,
// ),
// ),
// ),
// ],
// ),
// SizedBox(
// height: 10,
// ),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Icon(
Icons.phone,
color: Colors.grey[500],
size: 22,
),
SizedBox(
width: 4,
),
Padding(
padding: const EdgeInsets.only(
top: 2),
child: Text(
'${controller.orderAllList[index].pickupcontactno}',
style: TextStyle(
color: Colors.black87,
fontWeight:
FontWeight.normal,
fontSize: 14,
),
),
),
],
),
SizedBox(
height: 10,
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Icon(
Icons.confirmation_num,
color: Colors.grey[500],
size: 22,
),
SizedBox(
width: 4,
),
Padding(
padding: const EdgeInsets.only(
top: 2),
child: Text(
'${controller.orderAllList[index].orderid}',
style: TextStyle(
color: Colors.black87,
fontWeight:
FontWeight.normal,
fontSize: 14,
),
),
),
],
),
SizedBox(
height: 10,
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Icon(
Icons.business_rounded,
color: Colors.grey[500],
size: 22,
),
SizedBox(
width: 4,
),
Padding(
padding: const EdgeInsets.only(
top: 2),
child: Text(
'${controller.orderAllList[index].tenantname}',
style: TextStyle(
color: Colors.black87,
fontWeight:
FontWeight.normal,
fontSize: 14,
),
),
),
],
),
],
),
),
Spacer(),
Column(
children: [
Container(
decoration: BoxDecoration(
color: ColorConstants.primaryColor,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(
Radius.circular(12.0)),
),
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 3.0, horizontal: 5),
child: Text(
'${DateFormat("hh.mm a").format(DateFormat("yyyy-MM-dd'T'HH:mm:ss", "en_US").parse(controller.orderAllList[index].deliverydate!))}',
style: TextStyle(
fontSize: 10.5,
color: Colors.white)),
)),
],
),
],
),
],
),
),
);
})
)
],
),
);
}
);
}
orderShimmerCard(BuildContext context) {
return ListView.builder(
itemCount: 6,
itemBuilder: (BuildContext context, int index) {
return Container(
height: Get.height * 0.21,
width: Get.width * 0.9,
margin:
EdgeInsets.only(left: 10, right: 10, top: 5),
padding: EdgeInsets.only(
left: 10, right: 10, top: 10, bottom: 10),
decoration: BoxDecoration(
color: ColorConstants.secondaryColor,
borderRadius: BorderRadius.circular(10)),
child: Shimmer.fromColors(
enabled: true,
highlightColor: ColorConstants.lightGreyBg!,
baseColor: Colors.grey[300]!,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(top: 4),
child: Column(
children: [
Row(
children: [
Container(
height: Get.height * 0.06,
width: Get.width * 0.13,
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(
5),
border: Border.all(
color: ColorConstants
.primaryColor!)),
child: Column(
mainAxisAlignment:
MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Text(
'',
style: TextStyle(
color: Colors.black87,
fontWeight:
FontWeight.bold,
fontSize: 15,
),
),
Text(
'',
style: TextStyle(
color: Colors.black87,
fontWeight:
FontWeight.bold,
fontSize: 15,
),
),
],
),
),
SizedBox(
width: 7,
),
Container(
height: Get.height * 0.06,
width: Get.width * 0.13,
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(
5),
border: Border.all(
color: ColorConstants
.primaryColor!)),
child: Column(
mainAxisAlignment:
MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Icon(
Icons.delivery_dining,
size: 25,
color: ColorConstants
.primaryColor,
),
Text(
'',
style: TextStyle(
color: Colors.black87,
fontWeight:
FontWeight.bold,
fontSize: 12,
),
),
],
),
),
],
),
SizedBox(
height: 10,
),
Container(
height: Get.height * 0.05,
width: Get.width * 0.28,
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(5),
border: Border.all(
color: Colors.grey[400]!)),
child: Row(
mainAxisAlignment:
MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Text(
"",
style: TextStyle(
color: Colors.black87,
fontWeight: FontWeight.bold,
fontSize: 15,
),
),
],
),
),
SizedBox(
height: 6,
),
Container(
height: Get.height*0.04,
width: Get.width*0.3,
decoration: BoxDecoration(color:Colors.grey[100],borderRadius: BorderRadius.circular(10)),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(width: 5,),
CircleAvatar(
backgroundColor:Colors.grey[100],
radius: 10,
child: Icon(Icons.check,
color: Colors.grey, size: 15),
),
SizedBox(width: 6,),
Text(
'',
style: TextStyle(
color:Colors.grey[100],
fontWeight: FontWeight.bold,
fontSize: 15)),
],
),
),
],
),
),
SizedBox(
width: 10,
),
Padding(
padding: const EdgeInsets.only(top: 7),
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Icon(
Icons.person,
color: Colors.grey[500],
size: 22,
),
SizedBox(
width: 4,
),
Padding(
padding: const EdgeInsets.only(
top: 2),
child: Text(
'',
style: TextStyle(
color: Colors.black87,
fontWeight:
FontWeight.normal,
fontSize: 14,
),
),
),
],
),
SizedBox(
height: 10,
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Icon(
Icons.phone,
color: Colors.grey[500],
size: 22,
),
SizedBox(
width: 4,
),
Padding(
padding: const EdgeInsets.only(
top: 2),
child: Text(
'',
style: TextStyle(
color: Colors.black87,
fontWeight:
FontWeight.normal,
fontSize: 14,
),
),
),
],
),
SizedBox(
height: 10,
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Icon(
Icons.confirmation_num,
color: Colors.grey[500],
size: 22,
),
SizedBox(
width: 4,
),
Padding(
padding: const EdgeInsets.only(
top: 2),
child: Text(
'',
style: TextStyle(
color: Colors.black87,
fontWeight:
FontWeight.normal,
fontSize: 14,
),
),
),
],
),
SizedBox(
height: 10,
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Icon(
Icons.business,
color: Colors.grey[500],
size: 22,
),
SizedBox(
width: 4,
),
Padding(
padding: const EdgeInsets.only(
top: 2),
child: Text(
'',
style: TextStyle(
color: Colors.black87,
fontWeight:
FontWeight.normal,
fontSize: 14,
),
),
),
],
),
],
),
),
Spacer(),
Column(
children: [
Container(
height: Get.height*0.02,
width: Get.width*0.1,
decoration: BoxDecoration(
color: Colors.grey[100],
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(
Radius.circular(12.0)),
),
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 3.0, horizontal: 5),
child: Text(
'',
style: TextStyle(
fontSize: 10.5,
color: Colors.white)),
)),
SizedBox(height: 80,),
Icon(Icons.cancel,size: 30,color: Colors.grey[100],)
],
),
],
),
],
),
),
);
});
}
}

View File

@@ -0,0 +1,206 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../Controller/Orders/Tabs/Summarycontroller.dart';
import '../../../Helper/Constants/Colorconstants.dart';
class OrderSummary extends StatelessWidget {
OrderSummary({super.key});
OrderSummaryController orderSummaryController = Get.put(OrderSummaryController());
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor : Colors.grey[100],
body: GetBuilder<OrderSummaryController>(
initState: (_){
orderSummaryController.shimmer.value = true;
orderSummaryController.getOrdersSummary();
},
builder: (controller) {
return controller.shimmer.value
? Center(child: CircularProgressIndicator(color: ColorConstants.primaryColor,))
:ListView(
scrollDirection: Axis.vertical,
children: [
Padding(
padding: const EdgeInsets.only(top: 10,left: 10,right: 10),
child: Column(
children: [
Container(
height: Get.height*0.10,
width: Get.width*0.94,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.2),
spreadRadius: 1,
blurRadius: 3,
offset: const Offset(0, 3),
),
],
),
child: Container(
padding: const EdgeInsets.all(10),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Center(child: Icon(Icons.pending, size: 54, color:ColorConstants.primaryColor1)),
const SizedBox(width: 5,),
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(height: 2,),
Text('Pending',style: TextStyle(fontWeight: FontWeight.bold,fontSize: 16,color: Colors.grey[600]),),
const SizedBox(height: 4,),
Text('${controller.getOrderSummary.pending}',style: TextStyle(fontWeight: FontWeight.bold,fontSize: 20,color: Colors.grey[600]),),
],
),
],
),
),
),
const SizedBox(height: 15,),
Container(
height: Get.height*0.10,
width: Get.width*0.94,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.2),
spreadRadius: 1,
blurRadius: 3,
offset: const Offset(0, 3),
),
],
),
child: Container(
padding: const EdgeInsets.all(10),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Center(child: Icon(Icons.check_circle, size: 46, color:ColorConstants.primaryColor1)),
const SizedBox(width: 10,),
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(height: 4,),
Text('Completed',style: TextStyle(fontWeight: FontWeight.bold,fontSize: 16,color: Colors.grey[600]),),
const SizedBox(height: 4,),
Row(
children: [
Text('${controller.getOrderSummary.delivered}',style: TextStyle(fontWeight: FontWeight.bold,fontSize: 20,color: Colors.grey[600]),),
],
),
],
),
],
),
),
),
const SizedBox(height: 15,),
Container(
height: Get.height*0.10,
width: Get.width*0.94,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.2),
spreadRadius: 1,
blurRadius: 3,
offset: const Offset(0, 3),
),
],
),
child: Container(
padding: const EdgeInsets.all(10),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Center(child: Icon(Icons.cancel, size: 48, color:ColorConstants.primaryColor1)),
const SizedBox(width: 10,),
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(height: 4,),
Text('Cancelled',style: TextStyle(fontWeight: FontWeight.bold,fontSize: 16,color: Colors.grey[600]),),
const SizedBox(height: 4,),
Row(
children: [
Text('${controller.getOrderSummary.cancelled}',style: TextStyle(fontWeight: FontWeight.bold,fontSize: 20,color: Colors.grey[600]),),
],
),
],
),
],
),
),
),
const SizedBox(height: 15,),
Container(
height: Get.height*0.10,
width: Get.width*0.94,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.2),
spreadRadius: 1,
blurRadius: 3,
offset: const Offset(0, 3),
),
],
),
child: Container(
padding: const EdgeInsets.all(10),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Center(child: Icon(Icons.location_city, size: 46, color:ColorConstants.primaryColor1)),
const SizedBox(width: 10,),
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(height: 4,),
Text('Amount',style: TextStyle(fontWeight: FontWeight.bold,fontSize: 16,color: Colors.grey[600]),),
const SizedBox(height: 4,),
Row(
children: [
Icon(Icons.currency_rupee_sharp,color: Colors.grey[600],size: 20),
Text('0.00',style: TextStyle(fontWeight: FontWeight.bold,fontSize: 20,color: Colors.grey[600]),),
],
),
],
),
],
),
),
),
],
),
),
]
);
}
)
);
}
}

View File

@@ -0,0 +1,612 @@
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:intl/intl.dart';
import 'package:shimmer/shimmer.dart';
import '../../../Controller/Orders/Tabs/Todaycontroller.dart';
import '../../../Helper/Constants/Assetconstants.dart';
import '../../../Helper/Constants/Colorconstants.dart';
import '../../../Helper/toast.dart';
class TodayOrderView extends StatefulWidget {
const TodayOrderView({super.key});
@override
State<TodayOrderView> createState() => _TodayOrderViewState();
}
class _TodayOrderViewState extends State<TodayOrderView> {
late TodayOrderController todayOrderController;
Timer? _refreshTimer;
final TodayOrderController controller = Get.put(TodayOrderController());
@override
void initState() {
super.initState();
todayOrderController.shimmer.value = true;
// Fetch once
todayOrderController.getOrders();
// Then refresh every 3 seconds
_refreshTimer = Timer.periodic(const Duration(seconds: 3), (timer) {
print('hi');
todayOrderController.getOrders();
});
}
@override
void dispose() {
_refreshTimer?.cancel();
super.dispose();
}
@override
Widget build(BuildContext context) {
return GetBuilder<TodayOrderController>(
builder: (controller) {
return Scaffold(
backgroundColor: Colors.grey[100],
body: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(left: 10, top: 5),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(top: 5, right: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Container(
height: Get.height * 0.06,
width: Get.width * 0.94,
child: TextField(
controller: controller.searchController,
onChanged: (data) {
controller.search(data);
controller.update();
},
decoration: InputDecoration(
contentPadding: EdgeInsets.only(
bottom: 10,
right: 45,
),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(30),
borderSide: BorderSide(
color: ColorConstants.primaryColor,
),
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(30),
borderSide: BorderSide(
color: ColorConstants.primaryColor,
),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(30),
borderSide: BorderSide(
color: ColorConstants.primaryColor,
),
),
prefixIcon: Icon(
Icons.search,
color: ColorConstants.primaryColor,
),
hintText: 'Name',
),
),
),
],
),
),
],
),
),
Expanded(
child: controller.orderAllList.isEmpty && !controller.shimmer.value
? Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(height: 92),
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)
: ListView.builder(
itemCount: controller.orderAllList.length,
itemBuilder: (BuildContext context, int index) {
return Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 5),
padding: EdgeInsets.only(left: 10, right: 10, top: 10, bottom: 10),
decoration: BoxDecoration(
color: ColorConstants.secondaryColor,
borderRadius: BorderRadius.circular(10),
),
child: InkWell(
onTap: () {
// Get.to(() => DeliveryDetailsView(data: controller.orderAllList[index]));
},
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(top: 4),
child: Column(
children: [
Row(
children: [
Container(
height: Get.height * 0.06,
width: Get.width * 0.13,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5),
border: Border.all(color: ColorConstants.primaryColor),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
controller.orderAllList[index].deliverydate == ""
? Text('')
: Text(
'${DateFormat("dd").format(DateFormat("yyyy-MM-dd'T'HH:mm:ss", "en_US").parse(controller.orderAllList[index].deliverydate!))}',
style: TextStyle(
color: Colors.black87,
fontWeight: FontWeight.bold,
fontSize: 15,
),
),
controller.orderAllList[index].deliverydate == ""
? Text('')
: Text(
'${DateFormat("MMM").format(DateFormat("yyyy-MM-dd'T'HH:mm:ss", "en_US").parse(controller.orderAllList[index].deliverydate!))}',
style: TextStyle(
color: Colors.black87,
fontWeight: FontWeight.bold,
fontSize: 15,
),
),
],
),
),
SizedBox(width: 7),
Container(
height: Get.height * 0.06,
width: Get.width * 0.13,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5),
border: Border.all(color: ColorConstants.primaryColor),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Icon(
Icons.delivery_dining,
size: 25,
color: ColorConstants.primaryColor,
),
controller.orderAllList[index].kms == null
? Text(
'0.0',
style: TextStyle(
color: Colors.black87,
fontWeight: FontWeight.bold,
fontSize: 12,
),
)
: Text(
'${controller.orderAllList[index].kms?.toString()}Km',
style: TextStyle(
color: Colors.black87,
fontWeight: FontWeight.bold,
fontSize: 12,
),
),
],
),
),
],
),
SizedBox(height: 10),
Container(
height: Get.height * 0.05,
width: Get.width * 0.28,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5),
border: Border.all(color: Colors.grey[400]!),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(width: 10),
CircleAvatar(
radius: 10,
backgroundColor: ColorConstants.primaryColor1,
child: controller.orderAllList[index].paymenttype == 42
? Icon(Icons.mobile_friendly, color: ColorConstants.primaryColor, size: 12)
: controller.orderAllList[index].paymenttype == 43
? Icon(Icons.money, color: ColorConstants.primaryColor, size: 12)
: Icon(Icons.wallet, color: ColorConstants.primaryColor, size: 12),
),
SizedBox(width: 7),
Text(
"${controller.orderAllList[index].deliverycharges}",
style: TextStyle(
color: Colors.black87,
fontWeight: FontWeight.bold,
fontSize: 15,
),
),
],
),
),
SizedBox(height: 9),
controller.orderAllList[index].orderstatus == 'cancelled'
? Container(
height: Get.height * 0.04,
width: Get.width * 0.3,
decoration: BoxDecoration(color: Colors.red, borderRadius: BorderRadius.circular(10)),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(width: 5),
Icon(Icons.cancel, color: ColorConstants.secondaryColor, size: 18),
SizedBox(width: 6),
Text(
'${controller.orderAllList[index].orderstatus}',
style: TextStyle(
color: ColorConstants.secondaryColor,
fontWeight: FontWeight.bold,
fontSize: 15,
),
),
],
),
)
: Container(
height: Get.height * 0.04,
width: Get.width * 0.3,
decoration: BoxDecoration(
color: controller.orderAllList[index].orderstatus == 'completed' ? Colors.green : Colors.grey[100],
borderRadius: BorderRadius.circular(10),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(width: 5),
CircleAvatar(
backgroundColor: controller.orderAllList[index].orderstatus == 'completed'
? ColorConstants.secondaryColor
: ColorConstants.primaryColor1,
radius: 10,
child: Icon(Icons.check, color: Colors.grey, size: 15),
),
SizedBox(width: 6),
Text(
'${controller.orderAllList[index].orderstatus}',
style: TextStyle(
color: controller.orderAllList[index].orderstatus == 'completed'
? ColorConstants.secondaryColor
: ColorConstants.primaryColor,
fontWeight: FontWeight.bold,
fontSize: 15,
),
),
],
),
),
],
),
),
SizedBox(width: 10),
Padding(
padding: const EdgeInsets.only(top: 7),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Icon(Icons.person, color: Colors.grey[500], size: 22),
SizedBox(width: 4),
Container(
width: Get.width * 0.35,
child: Text(
'${controller.orderAllList[index].pickupcustomer}',
style: TextStyle(
color: Colors.black87,
fontWeight: FontWeight.normal,
fontSize: 14,
),
maxLines: 2,
),
),
],
),
SizedBox(height: 10),
Row(
children: [
Icon(Icons.phone, color: Colors.grey[500], size: 22),
SizedBox(width: 4),
Text(
'${controller.orderAllList[index].pickupcontactno}',
style: TextStyle(
color: Colors.black87,
fontWeight: FontWeight.normal,
fontSize: 14,
),
),
],
),
SizedBox(height: 10),
Row(
children: [
Icon(Icons.confirmation_num, color: Colors.grey[500], size: 22),
SizedBox(width: 4),
Text(
'${controller.orderAllList[index].orderid}',
style: TextStyle(
color: Colors.black87,
fontWeight: FontWeight.normal,
fontSize: 14,
),
),
],
),
SizedBox(height: 10),
Row(
children: [
Icon(Icons.business_rounded, color: Colors.grey[500], size: 22),
SizedBox(width: 4),
Text(
'${controller.orderAllList[index].tenantname}',
style: TextStyle(
color: Colors.black87,
fontWeight: FontWeight.normal,
fontSize: 14,
),
),
],
),
],
),
),
Spacer(),
Column(
children: [
Container(
decoration: BoxDecoration(
color: ColorConstants.primaryColor,
borderRadius: BorderRadius.all(Radius.circular(12.0)),
),
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 3.0, horizontal: 5),
child: Text(
'${DateFormat("hh.mm a").format(DateFormat("yyyy-MM-dd'T'HH:mm:ss", "en_US").parse(controller.orderAllList[index].deliverydate!))}',
style: TextStyle(fontSize: 10.5, color: Colors.white),
),
),
),
],
),
],
),
],
),
),
);
},
),
),
],
),
);
},
);
}
Widget orderShimmerCard(BuildContext context) {
return ListView.builder(
itemCount: 6,
itemBuilder: (BuildContext context, int index) {
return Container(
height: Get.height * 0.21,
width: Get.width * 0.9,
margin: EdgeInsets.only(left: 10, right: 10, top: 5),
padding: EdgeInsets.only(left: 10, right: 10, top: 10, bottom: 10),
decoration: BoxDecoration(
color: ColorConstants.secondaryColor,
borderRadius: BorderRadius.circular(10),
),
child: Shimmer.fromColors(
enabled: true,
highlightColor: ColorConstants.lightGreyBg!,
baseColor: Colors.grey[300]!,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(top: 4),
child: Column(
children: [
Row(
children: [
Container(
height: Get.height * 0.06,
width: Get.width * 0.13,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5),
border: Border.all(color: ColorConstants.primaryColor!),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text('', style: TextStyle(color: Colors.black87, fontWeight: FontWeight.bold, fontSize: 15)),
Text('', style: TextStyle(color: Colors.black87, fontWeight: FontWeight.bold, fontSize: 15)),
],
),
),
SizedBox(width: 7),
Container(
height: Get.height * 0.06,
width: Get.width * 0.13,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5),
border: Border.all(color: ColorConstants.primaryColor!),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Icon(Icons.delivery_dining, size: 25, color: ColorConstants.primaryColor),
Text('', style: TextStyle(color: Colors.black87, fontWeight: FontWeight.bold, fontSize: 12)),
],
),
),
],
),
SizedBox(height: 10),
Container(
height: Get.height * 0.05,
width: Get.width * 0.28,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5),
border: Border.all(color: Colors.grey[400]!),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text("", style: TextStyle(color: Colors.black87, fontWeight: FontWeight.bold, fontSize: 15)),
],
),
),
SizedBox(height: 6),
Container(
height: Get.height * 0.04,
width: Get.width * 0.3,
decoration: BoxDecoration(color: Colors.grey[100], borderRadius: BorderRadius.circular(10)),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(width: 5),
CircleAvatar(backgroundColor: Colors.grey[100], radius: 10, child: Icon(Icons.check, color: Colors.grey, size: 15)),
SizedBox(width: 6),
Text('', style: TextStyle(color: Colors.grey[100], fontWeight: FontWeight.bold, fontSize: 15)),
],
),
),
],
),
),
SizedBox(width: 10),
Padding(
padding: const EdgeInsets.only(top: 7),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Icon(Icons.person, color: Colors.grey[500], size: 22),
SizedBox(width: 4),
Text('', style: TextStyle(color: Colors.black87, fontWeight: FontWeight.normal, fontSize: 14)),
],
),
SizedBox(height: 10),
Row(
children: [
Icon(Icons.phone, color: Colors.grey[500], size: 22),
SizedBox(width: 4),
Text('', style: TextStyle(color: Colors.black87, fontWeight: FontWeight.normal, fontSize: 14)),
],
),
SizedBox(height: 10),
Row(
children: [
Icon(Icons.confirmation_num, color: Colors.grey[500], size: 22),
SizedBox(width: 4),
Text('', style: TextStyle(color: Colors.black87, fontWeight: FontWeight.normal, fontSize: 14)),
],
),
SizedBox(height: 10),
Row(
children: [
Icon(Icons.business, color: Colors.grey[500], size: 22),
SizedBox(width: 4),
Text('', style: TextStyle(color: Colors.black87, fontWeight: FontWeight.normal, fontSize: 14)),
],
),
],
),
),
Spacer(),
Column(
children: [
Container(
height: Get.height * 0.02,
width: Get.width * 0.1,
decoration: BoxDecoration(
color: Colors.grey[100],
borderRadius: BorderRadius.all(Radius.circular(12.0)),
),
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 3.0, horizontal: 5),
child: Text('', style: TextStyle(fontSize: 10.5, color: Colors.white)),
),
),
SizedBox(height: 80),
Icon(Icons.cancel, size: 30, color: Colors.grey[100]),
],
),
],
),
],
),
),
);
},
);
}
}

View File

@@ -0,0 +1,883 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:intl/intl.dart';
import 'package:shimmer/shimmer.dart';
import '../../../Controller/Orders/Tabs/Weekcontroller.dart';
import '../../../Helper/Constants/Assetconstants.dart';
import '../../../Helper/Constants/Colorconstants.dart';
import '../Deliverydetails/Deliverydetailsview.dart';
class WeekOrderView extends StatelessWidget {
WeekOrderView({super.key});
WeekOrderController weekOrderController = Get.put(WeekOrderController());
@override
Widget build(BuildContext context) {
return GetBuilder<WeekOrderController>(
initState: (_){
weekOrderController.shimmer.value = true;
weekOrderController.getOrders();
},
builder: (controller) {
return Scaffold(
backgroundColor: Colors.grey[100],
body: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(left: 10, top: 5),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(top: 5, right: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Container(
height: Get.height * 0.06,
width: Get.width * 0.94,
child: TextField(
// textAlign: TextAlign.center,
controller: controller.searchController,
// style: TextStyle(fontSize: 15),
onChanged: (data) {
controller.search(data);
controller.update();
},
decoration: InputDecoration(
contentPadding: EdgeInsets.only(
bottom: 10,
right: 45,
// left: 10
),
border: OutlineInputBorder(
borderRadius:
BorderRadius.circular(30),
borderSide: BorderSide(
color: ColorConstants.primaryColor,
)),
enabledBorder: OutlineInputBorder(
borderRadius:
BorderRadius.circular(30),
borderSide: BorderSide(
color: ColorConstants.primaryColor,
)),
focusedBorder: OutlineInputBorder(
borderRadius:
BorderRadius.circular(30),
borderSide: BorderSide(
color: ColorConstants.primaryColor,
)),
prefixIcon: Icon(
Icons.search,
color: ColorConstants.primaryColor,
),
// suffixIcon: popUp(),
hintText: 'Name'),
),
),
],
),
),
],
),
),
Expanded(
child:weekOrderController.orderAllList.length == 0&& !weekOrderController.shimmer.value
? Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: 92,
),
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): ListView.builder(
itemCount: controller.orderAllList.length,
itemBuilder: (BuildContext context, int index) {
return Container(
// height: Get.height * 0.21,
// width: Get.width * 0.9,
margin:
EdgeInsets.only(left: 10, right: 10, top: 5),
padding: EdgeInsets.only(
left: 10, right: 10, top: 10, bottom: 10),
decoration: BoxDecoration(
color: ColorConstants.secondaryColor,
borderRadius: BorderRadius.circular(10)),
child: InkWell(
onTap: (){
// Get.to(()=> DeliveryDetailsView(data: controller.orderAllList[index]));
},
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(top: 4),
child: Column(
children: [
Row(
children: [
Container(
height: Get.height * 0.06,
width: Get.width * 0.13,
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(
5),
border: Border.all(
color: ColorConstants
.primaryColor)),
child: Column(
mainAxisAlignment:
MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
controller.orderAllList[index].deliverydate == "" ? Text(''):
Text(
'${DateFormat("dd").format(DateFormat("yyyy-MM-dd'T'HH:mm:ss", "en_US").parse(controller.orderAllList[index].deliverydate!))}',
style: TextStyle(
color: Colors.black87,
fontWeight:
FontWeight.bold,
fontSize: 15,
),
),
controller.orderAllList[index].deliverydate == "" ? Text(''):
Text(
'${DateFormat("MMM").format(DateFormat("yyyy-MM-dd'T'HH:mm:ss", "en_US").parse(controller.orderAllList[index].deliverydate!))}',
style: TextStyle(
color: Colors.black87,
fontWeight:
FontWeight.bold,
fontSize: 15,
),
),
],
),
),
SizedBox(
width: 7,
),
Container(
height: Get.height * 0.06,
width: Get.width * 0.13,
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(
5),
border: Border.all(
color: ColorConstants
.primaryColor!)),
child: Column(
mainAxisAlignment:
MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Icon(
Icons.delivery_dining,
size: 25,
color: ColorConstants
.primaryColor,
),
controller.orderAllList[index].kms==null?Text(
'0.0',
style: TextStyle(
color: Colors.black87,
fontWeight:
FontWeight.bold,
fontSize: 12,
),
):Text(
'${controller.orderAllList[index].kms?.toString()}Km',
style: TextStyle(
color: Colors.black87,
fontWeight:
FontWeight.bold,
fontSize: 12,
),
),
],
),
),
],
),
SizedBox(
height: 10,
),
Container(
height: Get.height * 0.05,
width: Get.width * 0.28,
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(5),
border: Border.all(
color: Colors.grey[400]!)),
child: Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
SizedBox(width: 10,),
CircleAvatar(
radius: 10,
backgroundColor: ColorConstants.primaryColor1,
child: controller.orderAllList[index].paymenttype==42?Icon(Icons.mobile_friendly,color: ColorConstants.primaryColor,size: 12,):controller.orderAllList[index].paymenttype==43?Icon(Icons.money,color: ColorConstants.primaryColor,size: 12,):Icon(Icons.wallet,color: ColorConstants.primaryColor,size: 12,)),
SizedBox(width: 07,),
Text(
"${controller.orderAllList[index].deliverycharges}",
style: TextStyle(
color: Colors.black87,
fontWeight: FontWeight.bold,
fontSize: 15,
),
),
],
),
),
SizedBox(
height: 9,
),
controller.orderAllList[index].orderstatus =='cancelled'?Container(
height: Get.height*0.04,
width: Get.width*0.3,
decoration: BoxDecoration(color:Colors.red,borderRadius: BorderRadius.circular(10)),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(width: 5,),
Icon(Icons.cancel,
color: ColorConstants.secondaryColor, size: 18),
SizedBox(width: 6,),
Text(
'${controller.orderAllList[index].orderstatus }',
style: TextStyle(
color: ColorConstants.secondaryColor,
fontWeight: FontWeight.bold,
fontSize: 15)),
],
),
):Container(
height: Get.height*0.04,
width: Get.width*0.3,
decoration: BoxDecoration(color:controller.orderAllList[index].orderstatus =='completed'?Colors.green: Colors.grey[100],borderRadius: BorderRadius.circular(10)),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(width: 5,),
CircleAvatar(
backgroundColor:controller.orderAllList[index].orderstatus =='completed'?
ColorConstants.secondaryColor:
ColorConstants.primaryColor1,
radius: 10,
child: Icon(Icons.check,
color: Colors.grey, size: 15),
),
SizedBox(width: 6,),
Text(
'${controller.orderAllList[index].orderstatus }',
style: TextStyle(
color:controller.orderAllList[index].orderstatus =='completed'?
ColorConstants.secondaryColor: ColorConstants.primaryColor,
fontWeight: FontWeight.bold,
fontSize: 15)),
],
),
),
],
),
),
SizedBox(
width: 10,
),
Padding(
padding: const EdgeInsets.only(top: 7),
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Icon(
Icons.person,
color: Colors.grey[500],
size: 22,
),
SizedBox(
width: 4,
),
Padding(
padding: const EdgeInsets.only(
top: 2),
child: Container(
width: Get.width*0.35,
child: Text(
'${controller.orderAllList[index].pickupcustomer}',
style: TextStyle(
color: Colors.black87,
fontWeight:
FontWeight.normal,
fontSize: 14,
),
maxLines: 2,
),
),
),
],
),
SizedBox(
height: 10,
),
// Row(
// mainAxisAlignment:
// MainAxisAlignment.start,
// crossAxisAlignment:
// CrossAxisAlignment.start,
// children: [
// Icon(
// Icons.location_on,
// color: Colors.grey[500],
// size: 22,
// ),
// SizedBox(
// width: 4,
// ),
// Padding(
// padding: const EdgeInsets.only(
// top: 2),
// child: Container(
// width: Get.width*0.35,
// child: Text(
// '${controller.orderAllList[index].delivceryaddress}',
// style: TextStyle(
// color: Colors.black87,
// fontWeight:
// FontWeight.normal,
// fontSize: 14,
//
// ),
// maxLines: 2,
// ),
// ),
// ),
// ],
// ),
// SizedBox(
// height: 10,
// ),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Icon(
Icons.phone,
color: Colors.grey[500],
size: 22,
),
SizedBox(
width: 4,
),
Padding(
padding: const EdgeInsets.only(
top: 2),
child: Text(
'${controller.orderAllList[index].pickupcontactno}',
style: TextStyle(
color: Colors.black87,
fontWeight:
FontWeight.normal,
fontSize: 14,
),
),
),
],
),
SizedBox(
height: 10,
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Icon(
Icons.confirmation_num,
color: Colors.grey[500],
size: 22,
),
SizedBox(
width: 4,
),
Padding(
padding: const EdgeInsets.only(
top: 2),
child: Text(
'${controller.orderAllList[index].orderid}',
style: TextStyle(
color: Colors.black87,
fontWeight:
FontWeight.normal,
fontSize: 14,
),
),
),
],
),
SizedBox(
height: 10,
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Icon(
Icons.business_rounded,
color: Colors.grey[500],
size: 22,
),
SizedBox(
width: 4,
),
Padding(
padding: const EdgeInsets.only(
top: 2),
child: Text(
'${controller.orderAllList[index].tenantname}',
style: TextStyle(
color: Colors.black87,
fontWeight:
FontWeight.normal,
fontSize: 14,
),
),
),
],
),
],
),
),
Spacer(),
Column(
children: [
Container(
decoration: BoxDecoration(
color: ColorConstants.primaryColor,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(
Radius.circular(12.0)),
),
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 3.0, horizontal: 5),
child: Text(
'${DateFormat("hh.mm a").format(DateFormat("yyyy-MM-dd'T'HH:mm:ss", "en_US").parse(controller.orderAllList[index].deliverydate!))}',
style: TextStyle(
fontSize: 10.5,
color: Colors.white)),
)),
],
),
],
),
],
),
),
);
})
)
],
),
);
}
);
}
orderShimmerCard(BuildContext context) {
return ListView.builder(
itemCount: 6,
itemBuilder: (BuildContext context, int index) {
return Container(
height: Get.height * 0.21,
width: Get.width * 0.9,
margin:
EdgeInsets.only(left: 10, right: 10, top: 5),
padding: EdgeInsets.only(
left: 10, right: 10, top: 10, bottom: 10),
decoration: BoxDecoration(
color: ColorConstants.secondaryColor,
borderRadius: BorderRadius.circular(10)),
child: Shimmer.fromColors(
enabled: true,
highlightColor: ColorConstants.lightGreyBg!,
baseColor: Colors.grey[300]!,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(top: 4),
child: Column(
children: [
Row(
children: [
Container(
height: Get.height * 0.06,
width: Get.width * 0.13,
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(
5),
border: Border.all(
color: ColorConstants
.primaryColor!)),
child: Column(
mainAxisAlignment:
MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Text(
'',
style: TextStyle(
color: Colors.black87,
fontWeight:
FontWeight.bold,
fontSize: 15,
),
),
Text(
'',
style: TextStyle(
color: Colors.black87,
fontWeight:
FontWeight.bold,
fontSize: 15,
),
),
],
),
),
SizedBox(
width: 7,
),
Container(
height: Get.height * 0.06,
width: Get.width * 0.13,
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(
5),
border: Border.all(
color: ColorConstants
.primaryColor!)),
child: Column(
mainAxisAlignment:
MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Icon(
Icons.delivery_dining,
size: 25,
color: ColorConstants
.primaryColor,
),
Text(
'',
style: TextStyle(
color: Colors.black87,
fontWeight:
FontWeight.bold,
fontSize: 12,
),
),
],
),
),
],
),
SizedBox(
height: 10,
),
Container(
height: Get.height * 0.05,
width: Get.width * 0.28,
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(5),
border: Border.all(
color: Colors.grey[400]!)),
child: Row(
mainAxisAlignment:
MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Text(
"",
style: TextStyle(
color: Colors.black87,
fontWeight: FontWeight.bold,
fontSize: 15,
),
),
],
),
),
SizedBox(
height: 6,
),
Container(
height: Get.height*0.04,
width: Get.width*0.3,
decoration: BoxDecoration(color:Colors.grey[100],borderRadius: BorderRadius.circular(10)),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(width: 5,),
CircleAvatar(
backgroundColor:Colors.grey[100],
radius: 10,
child: Icon(Icons.check,
color: Colors.grey, size: 15),
),
SizedBox(width: 6,),
Text(
'',
style: TextStyle(
color:Colors.grey[100],
fontWeight: FontWeight.bold,
fontSize: 15)),
],
),
),
],
),
),
SizedBox(
width: 10,
),
Padding(
padding: const EdgeInsets.only(top: 7),
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Icon(
Icons.person,
color: Colors.grey[500],
size: 22,
),
SizedBox(
width: 4,
),
Padding(
padding: const EdgeInsets.only(
top: 2),
child: Text(
'',
style: TextStyle(
color: Colors.black87,
fontWeight:
FontWeight.normal,
fontSize: 14,
),
),
),
],
),
SizedBox(
height: 10,
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Icon(
Icons.phone,
color: Colors.grey[500],
size: 22,
),
SizedBox(
width: 4,
),
Padding(
padding: const EdgeInsets.only(
top: 2),
child: Text(
'',
style: TextStyle(
color: Colors.black87,
fontWeight:
FontWeight.normal,
fontSize: 14,
),
),
),
],
),
SizedBox(
height: 10,
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Icon(
Icons.confirmation_num,
color: Colors.grey[500],
size: 22,
),
SizedBox(
width: 4,
),
Padding(
padding: const EdgeInsets.only(
top: 2),
child: Text(
'',
style: TextStyle(
color: Colors.black87,
fontWeight:
FontWeight.normal,
fontSize: 14,
),
),
),
],
),
SizedBox(
height: 10,
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Icon(
Icons.business,
color: Colors.grey[500],
size: 22,
),
SizedBox(
width: 4,
),
Padding(
padding: const EdgeInsets.only(
top: 2),
child: Text(
'',
style: TextStyle(
color: Colors.black87,
fontWeight:
FontWeight.normal,
fontSize: 14,
),
),
),
],
),
],
),
),
Spacer(),
Column(
children: [
Container(
height: Get.height*0.02,
width: Get.width*0.1,
decoration: BoxDecoration(
color: Colors.grey[100],
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(
Radius.circular(12.0)),
),
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 3.0, horizontal: 5),
child: Text(
'',
style: TextStyle(
fontSize: 10.5,
color: Colors.white)),
)),
SizedBox(height: 80,),
Icon(Icons.cancel,size: 30,color: Colors.grey[100],)
],
),
],
),
],
),
),
);
});
}
}