"lib/git@183.82.99.133:saisrinivas/gen_erp_2025.git" did not exist on "b76cf1af446ec0ceefd1b640aa4c38b5b3e2c357"
Commit 3ad2ea55 authored by Sai Srinivas's avatar Sai Srinivas
Browse files

ios Changes

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