Commit 3ad2ea55 authored by Sai Srinivas's avatar Sai Srinivas
Browse files

ios Changes

parent 38d17dba
......@@ -31,7 +31,7 @@ class Paymentdetails extends StatefulWidget {
class _PaymentdetailsState extends State<Paymentdetails> {
Dropdowntheme ddtheme = Dropdowntheme();
List<FocusNode> focusNodes = List.generate(7, (index) => FocusNode(),);
List<FocusNode> focusNodes = List.generate(7, (index) => FocusNode());
@override
void initState() {
// TODO: implement initState
......@@ -70,7 +70,7 @@ class _PaymentdetailsState extends State<Paymentdetails> {
},
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
bottom: Platform.isIOS ? false : true,
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar(context, "Payment Details"),
......@@ -87,8 +87,14 @@ class _PaymentdetailsState extends State<Paymentdetails> {
);
},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 10),
margin: EdgeInsets.symmetric(horizontal: 10, vertical: 10),
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20),
......@@ -129,7 +135,9 @@ class _PaymentdetailsState extends State<Paymentdetails> {
],
),
items: [
...provider.contactsDropDown.map((contacts) {
...provider.contactsDropDown.map((
contacts,
) {
return DropdownMenuItem<Contacts>(
value: contacts,
child: Column(
......@@ -156,15 +164,12 @@ class _PaymentdetailsState extends State<Paymentdetails> {
);
}).toList(),
DropdownMenuItem<Contacts>(
onTap: () {
},
onTap: () {},
value: null,
// No value associated with the button
enabled: false,
// To disable selecting this item
child: InkWell(
onTap: () {
_addContactSheet(context);
},
......@@ -175,9 +180,8 @@ class _PaymentdetailsState extends State<Paymentdetails> {
color: AppColors.app_blue,
width: 0.5,
),
borderRadius: BorderRadius.circular(
12,
),
borderRadius:
BorderRadius.circular(12),
),
padding: const EdgeInsets.symmetric(
vertical: 5,
......@@ -202,15 +206,17 @@ class _PaymentdetailsState extends State<Paymentdetails> {
],
// value: provider.selectContact,
value:
provider.contactsDropDown.contains(
provider.selectContact
)
? provider.selectContact
: null,
provider.contactsDropDown.contains(
provider.selectContact,
)
? provider.selectContact
: null,
// The selected value is now the entire 'Contacts' object
onChanged: (Contacts? value) {
if (value != null) {
if (provider.contactsDropDown.isNotEmpty) {
if (provider
.contactsDropDown
.isNotEmpty) {
provider.selectContact =
value; // Set the selected contact
provider.contact =
......@@ -227,8 +233,10 @@ class _PaymentdetailsState extends State<Paymentdetails> {
},
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
menuItemStyleData:
ddtheme.menuItemStyleData,
dropdownStyleData:
ddtheme.dropdownStyleData,
),
),
],
......@@ -259,18 +267,19 @@ class _PaymentdetailsState extends State<Paymentdetails> {
items:
provider.paymentModeDropDown
.map(
(paymentMode) =>
DropdownMenuItem<PaymentModeList>(
value: paymentMode,
child: Text(
paymentMode.name ?? '',
style: const TextStyle(
fontSize: 14,
),
overflow:
TextOverflow.ellipsis,
),
(paymentMode) => DropdownMenuItem<
PaymentModeList
>(
value: paymentMode,
child: Text(
paymentMode.name ?? '',
style: const TextStyle(
fontSize: 14,
),
overflow:
TextOverflow.ellipsis,
),
),
)
.toList(),
value: provider.selectPaymentMode,
......@@ -287,15 +296,18 @@ class _PaymentdetailsState extends State<Paymentdetails> {
provider.paymentModeID = value?.id;
print(
"hfjkshfg" +
provider.paymentModeID.toString(),
provider.paymentModeID
.toString(),
);
}
}
},
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
menuItemStyleData:
ddtheme.menuItemStyleData,
dropdownStyleData:
ddtheme.dropdownStyleData,
),
),
],
......@@ -315,7 +327,12 @@ class _PaymentdetailsState extends State<Paymentdetails> {
borderRadius: BorderRadius.circular(14),
),
child: Padding(
padding: const EdgeInsets.fromLTRB(10.0, 0.0, 10, 0),
padding: const EdgeInsets.fromLTRB(
10.0,
0.0,
10,
0,
),
child: TextFormField(
controller: provider.Amountcontroller,
keyboardType: TextInputType.text,
......@@ -347,7 +364,12 @@ class _PaymentdetailsState extends State<Paymentdetails> {
borderRadius: BorderRadius.circular(14),
),
child: Padding(
padding: const EdgeInsets.fromLTRB(10.0, 0.0, 10, 0),
padding: const EdgeInsets.fromLTRB(
10.0,
0.0,
10,
0,
),
child: TextFormField(
controller: provider.Referencecontroller,
keyboardType: TextInputType.text,
......@@ -396,9 +418,12 @@ class _PaymentdetailsState extends State<Paymentdetails> {
if (provider.imagePicked == 1 &&
provider.imagePath != null) ...[
Padding(
padding: const EdgeInsets.symmetric(vertical: 4.0),
padding: const EdgeInsets.symmetric(
vertical: 4.0,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Text(
"${provider.imagePath}",
......@@ -434,15 +459,15 @@ class _PaymentdetailsState extends State<Paymentdetails> {
floatingActionButton: InkWell(
onTap: () {
print("clicked");
if(provider.contactID==null){
toast(context, "Please Select Contact");
return;
if (provider.contactID == null) {
toast(context, "Please Select Contact");
return;
}
if(provider.paymentModeID==null){
if (provider.paymentModeID == null) {
toast(context, "Please Select Payment Type");
return;
}
if(provider.image_picked==0){
if (provider.image_picked == 0) {
toast(context, "Please add attachment");
return;
}
......@@ -451,9 +476,11 @@ class _PaymentdetailsState extends State<Paymentdetails> {
provider.Referencecontroller.text,
provider.Amountcontroller.text,
);
if (provider.CollectionId != 0) {
showOTPSheetSheet(context);
}
Future.delayed(Duration(microseconds: 200), () {
if (provider.CollectionId != 0) {
showOTPSheetSheet(context);
}
});
},
child: Container(
alignment: Alignment.center,
......@@ -684,7 +711,6 @@ class _PaymentdetailsState extends State<Paymentdetails> {
provider.enteredOtp = enteredCode;
// clearText = true;
provider.OTPVerifyAPI(context);
Navigator.pop(context, true);
debugPrint("Completed");
},
......@@ -722,7 +748,7 @@ class _PaymentdetailsState extends State<Paymentdetails> {
bottom: 5.0,
),
child: InkResponse(
onTap: () {
onTap: () {
provider.ResendOtpAPI(context);
},
child: Center(
......@@ -784,7 +810,6 @@ class _PaymentdetailsState extends State<Paymentdetails> {
}
Future<void> _addContactSheet(BuildContext context) {
final controllersNames = [
"Name",
"Designation",
......@@ -878,7 +903,7 @@ class _PaymentdetailsState extends State<Paymentdetails> {
),
child: TextFormField(
controller: controllers[index],
focusNode:focusNodes[index],
focusNode: focusNodes[index],
maxLength:
[
......@@ -890,15 +915,20 @@ class _PaymentdetailsState extends State<Paymentdetails> {
? 10
: 998895646546561356,
maxLines: 1,
keyboardType: [
"Mobile Number",
"Alternate Mobile Number",
"Mobile Number",
].contains(
controllersNames[index],
)?TextInputType.numberWithOptions():TextInputType.text,
textInputAction:index==5?TextInputAction.done: TextInputAction.next,
keyboardType:
[
"Mobile Number",
"Alternate Mobile Number",
"Mobile Number",
].contains(
controllersNames[index],
)
? TextInputType.numberWithOptions()
: TextInputType.text,
textInputAction:
index == 5
? TextInputAction.done
: TextInputAction.next,
decoration: InputDecoration(
counterText: "",
hintText: "${hintTextNames[index]}",
......@@ -923,7 +953,9 @@ class _PaymentdetailsState extends State<Paymentdetails> {
provider.AddContactAPIFunction(
context,
widget.accountName,
widget.genId==""? widget.referenceID:widget.genId ,
widget.genId == ""
? widget.referenceID
: widget.genId,
provider.nameController.text,
provider.designationController.text,
provider.mobController.text,
......@@ -980,6 +1012,6 @@ class _PaymentdetailsState extends State<Paymentdetails> {
);
});
});
},);
});
}
}
......@@ -40,7 +40,7 @@ class _PendingcomplaintsState extends State<Pendingcomplaints> {
onWillPop: () => onBackPressed(context),
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
bottom: Platform.isIOS ? false : true,
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
......@@ -60,211 +60,212 @@ class _PendingcomplaintsState extends State<Pendingcomplaints> {
child: SvgPicture.asset("assets/svg/scanner.svg"),
),
),
body: provider.technician_complaint_list.isNotEmpty
? Container(
child: ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: provider.technician_complaint_list.length,
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
itemBuilder: (context, index) {
return Container(
body:
provider.technician_complaint_list.isNotEmpty
? Container(
child: ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: provider.technician_complaint_list.length,
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
margin: EdgeInsets.symmetric(vertical: 5),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
flex: 1,
child: SvgPicture.asset(
"assets/svg/se_block_head.svg",
),
),
SizedBox(width: 5),
Expanded(
flex: 4,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
"${provider.technician_complaint_list[index].contactName}",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontFamily: "JakartaMedium",
),
),
Text(
"${provider.technician_complaint_list[index].companyName}",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Color(0xFF818181),
fontSize: 14,
),
),
],
),
),
Spacer(),
Expanded(
flex: 1,
child: InkResponse(
onTap: () {
launch(
'tel://${provider.technician_complaint_list[index].mobileNo}',
);
},
child: SvgPicture.asset(
"assets/svg/se_call_customer.svg",
color: Color(0xFF0D9C00),
height: 20,
width: 20,
),
),
),
Expanded(
flex: 1,
child: InkResponse(
onTap: () {
_showOptionsSheet(
context,
provider
.technician_complaint_list[index]
.companyName,
provider
.technician_complaint_list[index]
.genId,
provider
.technician_complaint_list[index]
.complaintId,
);
},
child: SvgPicture.asset(
"assets/svg/ic_more.svg",
height: 30,
),
),
),
],
itemBuilder: (context, index) {
return Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
Divider(
thickness: 0.5,
color: Color(0xFFD7D7D7),
margin: EdgeInsets.symmetric(vertical: 5),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20),
),
...List.generate(4, (j) {
final textheads = [
"Complaint ID",
"Product Name",
"Engine Number",
"Address",
];
final textSubheads = [
provider
.technician_complaint_list[index]
.complaintId,
provider
.technician_complaint_list[index]
.productName,
provider
.technician_complaint_list[index]
.engineNo,
provider
.technician_complaint_list[index]
.address,
];
return Container(
padding: EdgeInsets.symmetric(
vertical: 3,
),
child: Row(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment:
CrossAxisAlignment.start,
CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
flex: 1,
child: Text(
textheads[j].toString(),
style: TextStyle(
fontFamily: "JakartaMedium",
child: SvgPicture.asset(
"assets/svg/se_block_head.svg",
),
),
SizedBox(width: 5),
Expanded(
flex: 4,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
"${provider.technician_complaint_list[index].contactName}",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontFamily: "JakartaMedium",
),
),
Text(
"${provider.technician_complaint_list[index].companyName}",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Color(0xFF818181),
fontSize: 14,
),
),
],
),
),
Spacer(),
Expanded(
flex: 1,
child: InkResponse(
onTap: () {
launch(
'tel://${provider.technician_complaint_list[index].mobileNo}',
);
},
child: SvgPicture.asset(
"assets/svg/se_call_customer.svg",
color: Color(0xFF0D9C00),
height: 20,
width: 20,
),
),
),
Expanded(
flex: 2,
child: Text(
textSubheads[j].toString(),
style: TextStyle(
color: Color(0xFF818181),
flex: 1,
child: InkResponse(
onTap: () {
_showOptionsSheet(
context,
provider
.technician_complaint_list[index]
.companyName,
provider
.technician_complaint_list[index]
.genId,
provider
.technician_complaint_list[index]
.complaintId,
);
},
child: SvgPicture.asset(
"assets/svg/ic_more.svg",
height: 30,
),
),
),
],
),
);
}),
InkResponse(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => Visitdetails(
complaintID:
provider
.technician_complaint_list[index]
.complaintId,
Divider(
thickness: 0.5,
color: Color(0xFFD7D7D7),
),
...List.generate(4, (j) {
final textheads = [
"Complaint ID",
"Product Name",
"Engine Number",
"Address",
];
final textSubheads = [
provider
.technician_complaint_list[index]
.complaintId,
provider
.technician_complaint_list[index]
.productName,
provider
.technician_complaint_list[index]
.engineNo,
provider
.technician_complaint_list[index]
.address,
];
return Container(
padding: EdgeInsets.symmetric(
vertical: 3,
),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Expanded(
flex: 1,
child: Text(
textheads[j].toString(),
style: TextStyle(
fontFamily: "JakartaMedium",
),
),
),
),
);
},
child: Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Text(
"View Details",
style: TextStyle(
color: AppColors.app_blue,
fontFamily: "JakartaMedium",
Expanded(
flex: 2,
child: Text(
textSubheads[j].toString(),
style: TextStyle(
color: Color(0xFF818181),
),
),
),
],
),
);
}),
InkResponse(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => Visitdetails(
complaintID:
provider
.technician_complaint_list[index]
.complaintId,
),
),
);
},
child: Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Text(
"View Details",
style: TextStyle(
color: AppColors.app_blue,
fontFamily: "JakartaMedium",
),
),
SizedBox(width: 5),
SvgPicture.asset(
"assets/svg/next_button.svg",
),
],
),
SizedBox(width: 5),
SvgPicture.asset(
"assets/svg/next_button.svg",
),
],
),
),
],
),
],
),
);
},
),
)
: Emptywidget(context),
);
},
),
)
: Emptywidget(context),
),
),
);
......@@ -299,7 +300,9 @@ class _PendingcomplaintsState extends State<Pendingcomplaints> {
right: 15,
top: 10,
),
padding: EdgeInsets.only( bottom: MediaQuery.of(context).viewInsets.bottom,),
padding: EdgeInsets.only(
bottom: MediaQuery.of(context).viewInsets.bottom,
),
child: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
......@@ -357,7 +360,7 @@ class _PendingcomplaintsState extends State<Pendingcomplaints> {
MaterialPageRoute(
builder:
(context) => Paymentdetails(
accountName: "Account",
accountName: "Generator",
name: companyName,
genId: genId,
referenceID: complaintId,
......
......@@ -7,6 +7,7 @@ import 'package:generp/Utils/app_colors.dart';
import 'package:generp/Utils/commonWidgets.dart';
import 'package:provider/provider.dart';
import 'package:generp/screens/screensExports.dart';
class Serviceengineerdashboard extends StatefulWidget {
const Serviceengineerdashboard({super.key});
......@@ -30,294 +31,306 @@ class _ServiceengineerdashboardState extends State<Serviceengineerdashboard> {
@override
Widget build(BuildContext context) {
return Platform.isAndroid
? WillPopScope(
onWillPop: () => onBackPressed(context),
child: SafeArea(top: false, bottom: true, child: _scaffold(context)),
)
: _scaffold(context);
}
Widget _scaffold(BuildContext context) {
return Consumer<Serviceengineerdashboardprovider>(
builder: (context, provider, child) {
return WillPopScope(
onWillPop: () => onBackPressed(context),
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
appBar: AppBar(
automaticallyImplyLeading: false,
elevation: 2.0,
title: SizedBox(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
InkResponse(
onTap: () => Navigator.pop(context, true),
child: SvgPicture.asset(
"assets/svg/app_bar_back.svg",
height: 25,
),
),
InkResponse(
onTap: () => Navigator.pop(context,true),
child: Text(
"Service Engineer",
style: TextStyle(
fontSize: 16,
height: 1.1,
fontFamily: "JakartaSemiBold",
color: AppColors.semi_black,
),
),
return Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
appBar: AppBar(
automaticallyImplyLeading: false,
elevation: 2.0,
title: SizedBox(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
InkResponse(
onTap: () => Navigator.pop(context, true),
child: SvgPicture.asset(
"assets/svg/app_bar_back.svg",
height: 25,
),
),
InkResponse(
onTap: () => Navigator.pop(context, true),
child: Text(
"Service Engineer",
style: TextStyle(
fontSize: 16,
height: 1.1,
fontFamily: "JakartaSemiBold",
color: AppColors.semi_black,
),
Spacer(),
Container(
height: 25,
width: 45,
decoration: BoxDecoration(
color: Color(0xFFFFF6E2),
borderRadius: BorderRadius.circular(20),
),
),
Spacer(),
Container(
height: 25,
width: 45,
decoration: BoxDecoration(
color: Color(0xFFFFF6E2),
borderRadius: BorderRadius.circular(20),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SvgPicture.asset(
'assets/svg/engineer_rating.svg',
height: 15,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SvgPicture.asset(
'assets/svg/engineer_rating.svg',
height: 15,
),
SizedBox(width: 5),
Text(
provider.avgRating.toString(),
style: TextStyle(fontSize: 14),
),
],
SizedBox(width: 5),
Text(
provider.avgRating.toString(),
style: TextStyle(fontSize: 14),
),
),
],
),
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(
bottom: Radius.circular(30), // Adjust the radius as needed
],
),
),
),
],
),
body: Container(
child: SingleChildScrollView(
child: Column(
children: [
Container(
margin: EdgeInsets.only(top: 0, bottom: 15),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.vertical(
bottom: Radius.circular(16),
),
),
child: Column(
children: [
InkResponse(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => Pendingcomplaints(),
),
);
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 15,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 15,
),
decoration: BoxDecoration(
color: Color(0xFFFFEFEF),
borderRadius: BorderRadius.circular(16),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Text(
"${provider.pendingComplaints}",
style: TextStyle(
fontSize: 30,
color: Color(0xFFED3424),
),
),
Text("Pending Complaints"),
],
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(
bottom: Radius.circular(30), // Adjust the radius as needed
),
),
),
body: Container(
child: SingleChildScrollView(
child: Column(
children: [
Container(
margin: EdgeInsets.only(top: 0, bottom: 15),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.vertical(
bottom: Radius.circular(16),
),
),
child: Column(
children: [
InkResponse(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => Pendingcomplaints(),
),
);
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 15,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 15,
),
decoration: BoxDecoration(
color: Color(0xFFFFEFEF),
borderRadius: BorderRadius.circular(16),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Text(
"${provider.pendingComplaints}",
style: TextStyle(
fontSize: 30,
color: Color(0xFFED3424),
),
),
),
Text("Pending Complaints"),
],
),
],
),
),
),
],
),
],
),
),
Container(
padding: EdgeInsets.only(left: 15),
alignment: Alignment.topLeft,
child: Text(
"Collections & Visits",
style: TextStyle(color: Color(0xFF818181),
fontFamily: "JakartaMedium",
fontSize: 14),
),
),
],
),
),
Container(
padding: EdgeInsets.only(left: 15),
alignment: Alignment.topLeft,
child: Text(
"Collections & Visits",
style: TextStyle(
color: Color(0xFF818181),
fontFamily: "JakartaMedium",
fontSize: 14,
),
Container(
margin: EdgeInsets.symmetric(horizontal: 10, vertical: 15),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
),
),
Container(
margin: EdgeInsets.symmetric(horizontal: 10, vertical: 15),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: GridView.builder(
padding: EdgeInsets.symmetric(
vertical: 15,
horizontal: 10,
),
itemCount: 4,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
crossAxisSpacing: 10,
mainAxisSpacing: 10,
childAspectRatio: 22 / 10,
),
itemBuilder: (context, index) {
final numbers = [
provider.monthlyPaymentCollectionAmount,
provider.paymentCollectionWalletBalanceAmount,
provider.thisMonthsVisits,
provider.todayVisits,
];
final names = [
"Month Collection",
"P.C. Wallet",
"Month Visits",
"Today Visits",
];
final List<int> colorCodes = [
0xFFE7FFE5,
0xFFFFFCD5,
0xFFF3EDFF,
0xFFFFF6F0,
];
final List<int> textColorCodes = [
0xFF0D9C00,
0xFF605C00,
0xFF493272,
0xFF91481B,
];
return InkResponse(
onTap: () {
var route;
switch (index) {
case 0:
route = Monthlycollection();
break;
case 1:
route = Pcwallet();
break;
case 2:
route = Todaymontlyvisists(visitType: "Month");
break;
case 3:
route = Todaymontlyvisists(visitType: "Today");
break;
}
child: GridView.builder(
padding: EdgeInsets.symmetric(
vertical: 15,
horizontal: 10,
),
itemCount: 4,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
crossAxisSpacing: 10,
mainAxisSpacing: 10,
childAspectRatio: 22 / 10,
),
itemBuilder: (context, index) {
final numbers = [
provider.monthlyPaymentCollectionAmount,
provider.paymentCollectionWalletBalanceAmount,
provider.thisMonthsVisits,
provider.todayVisits,
];
final names = [
"Month Collection",
"P.C. Wallet",
"Month Visits",
"Today Visits",
];
final List<int> colorCodes = [
0xFFE7FFE5,
0xFFFFFCD5,
0xFFF3EDFF,
0xFFFFF6F0,
];
final List<int> textColorCodes = [
0xFF0D9C00,
0xFF605C00,
0xFF493272,
0xFF91481B,
];
return InkResponse(
onTap: () {
var route;
switch (index) {
case 0:
route = Monthlycollection();
break;
case 1:
route = Pcwallet();
break;
case 2:
route = Todaymontlyvisists(visitType: "Month");
break;
case 3:
route = Todaymontlyvisists(visitType: "Today");
break;
}
Navigator.push(
context,
MaterialPageRoute(builder: (context) => route),
);
},
child: Container(
padding: EdgeInsets.only(
left: 15,
top: 5,
bottom: 5,
),
decoration: BoxDecoration(
color: Color(colorCodes[index]),
borderRadius: BorderRadius.circular(12),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
Navigator.push(
context,
MaterialPageRoute(builder: (context) => route),
);
},
child: Container(
padding: EdgeInsets.only(
left: 15,
top: 5,
bottom: 5,
),
decoration: BoxDecoration(
color: Color(colorCodes[index]),
borderRadius: BorderRadius.circular(12),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
children: [
Row(
children: [
if([0,1].contains(index))...[
Text("₹",style: TextStyle(
if ([0, 1].contains(index)) ...[
Text(
"₹",
style: TextStyle(
fontSize: 14,
color: Color(textColorCodes[index]),
),),
],
Padding(
padding: EdgeInsets.only(top: 5),
child: Text(
"${numbers[index].toString()}",
style: TextStyle(
fontSize: 27,
color: Color(textColorCodes[index]),
),
),
),
],
),
],
Padding(
padding: EdgeInsets.only(top: 5),
child: Text(
"${numbers[index].toString()}",
style: TextStyle(
fontSize: 27,
color: Color(textColorCodes[index]),
),
),
),
Text(names[index],style: TextStyle(
color: Color(0xFF818181)
),),
],
),
),
);
},
Text(
names[index],
style: TextStyle(color: Color(0xFF818181)),
),
],
),
),
);
},
),
),
InkResponse(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => Nearbygenerators(),
),
);
},
child: Container(
height: 60,
margin: EdgeInsets.symmetric(horizontal: 10, vertical: 0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20),
),
InkResponse(
onTap: () {
Navigator.push(context, MaterialPageRoute(builder: (context) => Nearbygenerators(),));
},
child: Container(
height: 60,
margin: EdgeInsets.symmetric(horizontal: 10, vertical: 0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20),
),
child: Row(
children: [
Expanded(
flex: 1,
child: SvgPicture.asset(
"assets/svg/find_generator.svg",
),
),
Expanded(
flex: 4,
child: Text("Find Nearby Generators"),
),
],
child: Row(
children: [
Expanded(
flex: 1,
child: SvgPicture.asset(
"assets/svg/find_generator.svg",
),
),
),
Expanded(
flex: 4,
child: Text("Find Nearby Generators"),
),
],
),
],
),
),
),
],
),
),
),
......
......@@ -366,8 +366,8 @@ class ApiCalling {
};
var res;
// if (check_in_pic != null) {
res = await postImage(data, employeeChekInUrl, {}, check_in_pic);
res = jsonDecode(res);
res = await postImage(data, employeeChekInUrl, {}, check_in_pic);
res = jsonDecode(res);
// } else {
// // res = await post(data, employeeChekInUrl, {});
// // res = jsonDecode(res.body);
......@@ -413,16 +413,16 @@ class ApiCalling {
// return null;
// }
// if (check_out_pic != null) {
res = await postImageNew(
data,
{},
employeeCheckOutUrl,
check_out_pic,
'check_out_pic',
);
if(res!=null){
res = jsonDecode(res);
}
res = await postImageNew(
data,
{},
employeeCheckOutUrl,
check_out_pic,
'check_out_pic',
);
if (res != null) {
res = jsonDecode(res);
}
// } else {
// res = await post(data, employeeCheckOutUrl, {});
......@@ -562,7 +562,7 @@ class ApiCalling {
session,
gen_hash_id,
location,
attachment
attachment,
) async {
try {
Map<String, String> data = {
......@@ -582,7 +582,7 @@ class ApiCalling {
);
res = jsonDecode(res);
return TagLocationResponse.fromJson(res);
}else{
} else {
res = await post(data, genTrackerTagLocationUrl, {});
if (res != null) {
// debugPrint(res.body);
......@@ -988,7 +988,7 @@ class ApiCalling {
// debugPrint("Null Response");
// return null;
// }
print("send otp:${data}");
print("send otp:${data}");
if (payment_proof != null) {
res = await postImageNew(
data,
......@@ -1000,9 +1000,7 @@ print("send otp:${data}");
print("Add Payment $res");
res = jsonDecode(res);
} else {
print("Add Payment $res");
res = await post(data, technicianAddPaymentCollectionUrl, {});
res = jsonDecode(res.body);
......@@ -1044,12 +1042,9 @@ print("send otp:${data}");
return null;
}
}
static Future<Technicianaddpaymentresendotpresponse?>
TechnicianPaymentOTPResendAPI(
empId,
session,
payment_collection_id,
) async {
TechnicianPaymentOTPResendAPI(empId, session, payment_collection_id) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
......@@ -1195,7 +1190,7 @@ print("send otp:${data}");
'type': (type).toString(),
'account_id': (account_id).toString(),
};
print(data);
print("add: $data");
final res = await post(data, technicianAddContactUrl, {});
if (res != null) {
debugPrint(res.body);
......@@ -1323,8 +1318,8 @@ print("send otp:${data}");
};
final res = await post(data, addPaymentRequestionViewUrl, {});
if (res != null) {
print("add view:${data}");
debugPrint(res.body);
// print("add view:${data}");
// debugPrint(res.body);
return addPaymentRequestionResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
......@@ -1397,8 +1392,8 @@ print("send otp:${data}");
bank_ifsc_code,
acc_holder_name,
bank_upi_id,
approval_assignee_emp_id,
attachment,
approval_assignee_emp_id,
attachment,
) async {
try {
Map<String, String> data = {
......@@ -1624,11 +1619,8 @@ print("send otp:${data}");
}
}
static Future<paymentRequestionBankDetailsResponse?> paymentRequestionBankDetailsAPI(
empId,
session,
account_id,
) async {
static Future<paymentRequestionBankDetailsResponse?>
paymentRequestionBankDetailsAPI(empId, session, account_id) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
......@@ -1639,7 +1631,9 @@ print("send otp:${data}");
if (res != null) {
print("Bank Detaols ${data}");
debugPrint(res.body);
return paymentRequestionBankDetailsResponse.fromJson(jsonDecode(res.body));
return paymentRequestionBankDetailsResponse.fromJson(
jsonDecode(res.body),
);
} else {
debugPrint("Null Response");
return null;
......@@ -1730,7 +1724,7 @@ print("send otp:${data}");
'approved_amount': approved_amount,
'proposed_payment_account_id': proposed_payment_account_id,
};
// print(data);
// print(data);
final res = await post(data, approveRejectPaymentRequestSubmitUrl, {});
if (res != null) {
print(data);
......@@ -1753,7 +1747,7 @@ print("send otp:${data}");
session,
mode,
payment_reference_number,
payment_amount,
payment_amount,
payment_request_id,
payment_account_id,
processing_remarks,
......@@ -1951,8 +1945,6 @@ print("send otp:${data}");
}
}
static Future<DistrictsResponse?> commonAddAccountViewDistrictAPI(
empId,
session,
......@@ -2238,7 +2230,11 @@ print("send otp:${data}");
static Future<orderDashboardResponse?> ordersDashboardAPI(
empId,
session,mode,from,to,teamemployee
session,
mode,
from,
to,
teamemployee,
) async {
try {
Map<String, String> data = {
......@@ -2550,12 +2546,8 @@ print("send otp:${data}");
}
}
static Future<ordersDetailsEditOrderViewResponse?> ordersDetailsEditOrderViewAPI(
empId,
session,
order_id,
) async {
static Future<ordersDetailsEditOrderViewResponse?>
ordersDetailsEditOrderViewAPI(empId, session, order_id) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
......@@ -2563,51 +2555,49 @@ print("send otp:${data}");
'order_id': order_id.toString(),
};
var res = await post(data, ordersOrderDetailsEditOrderUrl, {});
if(res!=null){
return ordersDetailsEditOrderViewResponse.fromJson(jsonDecode(res.body));
}else{
if (res != null) {
return ordersDetailsEditOrderViewResponse.fromJson(
jsonDecode(res.body),
);
} else {
debugPrint("Null Response");
}
} catch (e) {
debugPrint('hello bev=bug $e ');
return null;
}
}
static Future<CommonResponse?> ordersDetailsEditOrderSubmitAPI(
empId,
session,
order_id,
attachment_file,
dispatch_state_id,
district,
sub_locality,
dispatch_pincode,
dispatch_address,
unloading,
freight,
erection,
note
attachment_file,
dispatch_state_id,
district,
sub_locality,
dispatch_pincode,
dispatch_address,
unloading,
freight,
erection,
note,
) async {
try {
Map<String, String> data = {
'emp_id':empId.toString(),
'session_id':session.toString(),
'order_id':order_id.toString(),
'dispatch_state_id':dispatch_state_id.toString(),
'district':district.toString(),
'sub_locality':sub_locality.toString(),
'dispatch_pincode':dispatch_pincode.toString(),
'dispatch_address':dispatch_address.toString(),
'unloading':unloading.toString(),
'freight':freight.toString(),
'erection':erection.toString(),
'note':note.toString(),
'emp_id': empId.toString(),
'session_id': session.toString(),
'order_id': order_id.toString(),
'dispatch_state_id': dispatch_state_id.toString(),
'district': district.toString(),
'sub_locality': sub_locality.toString(),
'dispatch_pincode': dispatch_pincode.toString(),
'dispatch_address': dispatch_address.toString(),
'unloading': unloading.toString(),
'freight': freight.toString(),
'erection': erection.toString(),
'note': note.toString(),
};
var res;
print("Edit Order:$data");
......@@ -2631,51 +2621,47 @@ print("send otp:${data}");
}
}
static Future<ordersDetailsDispatchOrderViewResponse?> ordersDetailsDispatchOrderViewAPI(
empId,
session,
order_id,
) async {
static Future<ordersDetailsDispatchOrderViewResponse?>
ordersDetailsDispatchOrderViewAPI(empId, session, order_id) async {
try {
Map<String, String> data = {
'emp_id':empId.toString(),
'session_id':session.toString(),
'order_id':order_id.toString(),
'emp_id': empId.toString(),
'session_id': session.toString(),
'order_id': order_id.toString(),
};
final res = await post(data, ordersOrderDetailsDispatchProductsUrl, {});
if(res!=null){
return ordersDetailsDispatchOrderViewResponse.fromJson(jsonDecode(res.body));
}else{
debugPrint("Null Response");
}
final res = await post(data, ordersOrderDetailsDispatchProductsUrl, {});
if (res != null) {
return ordersDetailsDispatchOrderViewResponse.fromJson(
jsonDecode(res.body),
);
} else {
debugPrint("Null Response");
}
} catch (e) {
debugPrint('hello bev=bug $e ');
return null;
}
}
static Future<ordersPdiIdByEngNumberResponse?> ordersPdiIdByEngNumberUrlAPI(
empId,
session,
engine_number,
engine_number,
) async {
try {
Map<String, String> data = {
'emp_id':empId.toString(),
'session_id':session.toString(),
'engine_number':engine_number.toString(),
'emp_id': empId.toString(),
'session_id': session.toString(),
'engine_number': engine_number.toString(),
};
final res = await post(data, ordersPdiIdByEngNumberUrl, {});
if(res!=null){
return ordersPdiIdByEngNumberResponse.fromJson(jsonDecode(res.body));
}else{
debugPrint("Null Response");
}
final res = await post(data, ordersPdiIdByEngNumberUrl, {});
if (res != null) {
return ordersPdiIdByEngNumberResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
}
} catch (e) {
debugPrint('hello bev=bug $e ');
return null;
......@@ -3307,8 +3293,10 @@ print("send otp:${data}");
static Future<crmDashboardResponse?> crmDashboardAPI(
empId,
session,
mode,
from,to,teamemployee
mode,
from,
to,
teamemployee,
) async {
try {
Map<String, String> data = {
......@@ -3361,7 +3349,7 @@ print("send otp:${data}");
static Future<crmUniversalSearchResponse?> crmUniversalSearchAPI(
empId,
session,
q
q,
) async {
try {
Map<String, String> data = {
......@@ -4231,36 +4219,43 @@ print("send otp:${data}");
}
}
static Future<crmProspectDetailsAddFollowUpAppointmentResponse?> crmProspectDetailsFollowupNextAppointmentAPI(
empId,
session,
nextapp,
orderstatus,
lead_id,
followup_feedback,
followup_type,
followupintime,
loc,
followup_status,
) async {
static Future<crmProspectDetailsAddFollowUpAppointmentResponse?>
crmProspectDetailsFollowupNextAppointmentAPI(
empId,
session,
nextapp,
orderstatus,
lead_id,
followup_feedback,
followup_type,
followupintime,
loc,
followup_status,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'nextapp':nextapp.toString(),
'orderstatus':orderstatus.toString(),
'lead_id':lead_id.toString(),
'followup_feedback':followup_feedback.toString(),
'followup_type':followup_type.toString(),
'followupintime':followupintime.toString(),
'loc':loc.toString(),
'followup_status':followup_status.toString(),
};
final res = await post(data, crmProspectDetailsFollowupNextAppointmentUrl, {});
'nextapp': nextapp.toString(),
'orderstatus': orderstatus.toString(),
'lead_id': lead_id.toString(),
'followup_feedback': followup_feedback.toString(),
'followup_type': followup_type.toString(),
'followupintime': followupintime.toString(),
'loc': loc.toString(),
'followup_status': followup_status.toString(),
};
final res = await post(
data,
crmProspectDetailsFollowupNextAppointmentUrl,
{},
);
if (res != null) {
print("Filter:${data}");
debugPrint(res.body);
return crmProspectDetailsAddFollowUpAppointmentResponse.fromJson(jsonDecode(res.body));
return crmProspectDetailsAddFollowUpAppointmentResponse.fromJson(
jsonDecode(res.body),
);
} else {
debugPrint("Null Response");
return null;
......@@ -4271,42 +4266,47 @@ print("send otp:${data}");
}
}
static Future<CommonResponse?> crmProspectDetailsFollowupNextAppointmentOtherCaseAPI(
empId,
session,
nextapp,
orderstatus,
lead_id,
followup_feedback,
followup_type,
followupintime,
loc,
followup_status,
appointmentset,
app_date,
sms,
app_note,
in_t,
) async {
static Future<CommonResponse?>
crmProspectDetailsFollowupNextAppointmentOtherCaseAPI(
empId,
session,
nextapp,
orderstatus,
lead_id,
followup_feedback,
followup_type,
followupintime,
loc,
followup_status,
appointmentset,
app_date,
sms,
app_note,
in_t,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'nextapp':nextapp.toString(),
'orderstatus':orderstatus.toString(),
'lead_id':lead_id.toString(),
'followup_feedback':followup_feedback.toString(),
'followup_type':followup_type.toString(),
'followupintime':followupintime.toString(),
'loc':loc.toString(),
'followup_status':followup_status.toString(),
'appointmentset':appointmentset.toString(),
'app_date':app_date.toString(),
'sms':sms.toString(),
'app_note':app_note.toString(),
'in_t':in_t.toString(),
};
final res = await post(data, crmProspectDetailsFollowupNextAppointmentUrl, {});
'nextapp': nextapp.toString(),
'orderstatus': orderstatus.toString(),
'lead_id': lead_id.toString(),
'followup_feedback': followup_feedback.toString(),
'followup_type': followup_type.toString(),
'followupintime': followupintime.toString(),
'loc': loc.toString(),
'followup_status': followup_status.toString(),
'appointmentset': appointmentset.toString(),
'app_date': app_date.toString(),
'sms': sms.toString(),
'app_note': app_note.toString(),
'in_t': in_t.toString(),
};
final res = await post(
data,
crmProspectDetailsFollowupNextAppointmentUrl,
{},
);
if (res != null) {
print("Filter:${data}");
debugPrint(res.body);
......@@ -4325,14 +4325,14 @@ print("send otp:${data}");
empId,
session,
emp_loc,
radius
radius,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'emp_loc': (emp_loc).toString(),
'radius':radius.toString()
'radius': radius.toString(),
};
final res = await post(data, crmNearbyOpenLeadsUrl, {});
if (res != null) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment