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,
...@@ -203,14 +207,16 @@ class _PaymentdetailsState extends State<Paymentdetails> { ...@@ -203,14 +207,16 @@ 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,8 +267,9 @@ class _PaymentdetailsState extends State<Paymentdetails> { ...@@ -259,8 +267,9 @@ class _PaymentdetailsState extends State<Paymentdetails> {
items: items:
provider.paymentModeDropDown provider.paymentModeDropDown
.map( .map(
(paymentMode) => (paymentMode) => DropdownMenuItem<
DropdownMenuItem<PaymentModeList>( PaymentModeList
>(
value: paymentMode, value: paymentMode,
child: Text( child: Text(
paymentMode.name ?? '', paymentMode.name ?? '',
...@@ -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,
); );
Future.delayed(Duration(microseconds: 200), () {
if (provider.CollectionId != 0) { if (provider.CollectionId != 0) {
showOTPSheetSheet(context); 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");
}, },
...@@ -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", "Mobile Number",
"Alternate Mobile Number", "Alternate Mobile Number",
"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,7 +60,8 @@ class _PendingcomplaintsState extends State<Pendingcomplaints> { ...@@ -60,7 +60,8 @@ 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:
provider.technician_complaint_list.isNotEmpty
? Container( ? Container(
child: ListView.builder( child: ListView.builder(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
...@@ -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,14 +31,18 @@ class _ServiceengineerdashboardState extends State<Serviceengineerdashboard> { ...@@ -30,14 +31,18 @@ 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),
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
appBar: AppBar( appBar: AppBar(
...@@ -56,7 +61,7 @@ class _ServiceengineerdashboardState extends State<Serviceengineerdashboard> { ...@@ -56,7 +61,7 @@ class _ServiceengineerdashboardState extends State<Serviceengineerdashboard> {
), ),
), ),
InkResponse( InkResponse(
onTap: () => Navigator.pop(context,true), onTap: () => Navigator.pop(context, true),
child: Text( child: Text(
"Service Engineer", "Service Engineer",
style: TextStyle( style: TextStyle(
...@@ -168,9 +173,11 @@ class _ServiceengineerdashboardState extends State<Serviceengineerdashboard> { ...@@ -168,9 +173,11 @@ class _ServiceengineerdashboardState extends State<Serviceengineerdashboard> {
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: Text( child: Text(
"Collections & Visits", "Collections & Visits",
style: TextStyle(color: Color(0xFF818181), style: TextStyle(
color: Color(0xFF818181),
fontFamily: "JakartaMedium", fontFamily: "JakartaMedium",
fontSize: 14), fontSize: 14,
),
), ),
), ),
Container( Container(
...@@ -257,13 +264,15 @@ class _ServiceengineerdashboardState extends State<Serviceengineerdashboard> { ...@@ -257,13 +264,15 @@ class _ServiceengineerdashboardState extends State<Serviceengineerdashboard> {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Row( Row(
children: [ children: [
if([0,1].contains(index))...[ if ([0, 1].contains(index)) ...[
Text("₹",style: TextStyle( Text(
"₹",
style: TextStyle(
fontSize: 14, fontSize: 14,
color: Color(textColorCodes[index]), color: Color(textColorCodes[index]),
),), ),
),
], ],
Padding( Padding(
padding: EdgeInsets.only(top: 5), padding: EdgeInsets.only(top: 5),
...@@ -277,9 +286,10 @@ class _ServiceengineerdashboardState extends State<Serviceengineerdashboard> { ...@@ -277,9 +286,10 @@ class _ServiceengineerdashboardState extends State<Serviceengineerdashboard> {
), ),
], ],
), ),
Text(names[index],style: TextStyle( Text(
color: Color(0xFF818181) names[index],
),), style: TextStyle(color: Color(0xFF818181)),
),
], ],
), ),
), ),
...@@ -289,7 +299,12 @@ class _ServiceengineerdashboardState extends State<Serviceengineerdashboard> { ...@@ -289,7 +299,12 @@ class _ServiceengineerdashboardState extends State<Serviceengineerdashboard> {
), ),
InkResponse( InkResponse(
onTap: () { onTap: () {
Navigator.push(context, MaterialPageRoute(builder: (context) => Nearbygenerators(),)); Navigator.push(
context,
MaterialPageRoute(
builder: (context) => Nearbygenerators(),
),
);
}, },
child: Container( child: Container(
height: 60, height: 60,
...@@ -319,8 +334,6 @@ class _ServiceengineerdashboardState extends State<Serviceengineerdashboard> { ...@@ -319,8 +334,6 @@ class _ServiceengineerdashboardState extends State<Serviceengineerdashboard> {
), ),
), ),
), ),
),
),
); );
}, },
); );
......
...@@ -420,7 +420,7 @@ class ApiCalling { ...@@ -420,7 +420,7 @@ class ApiCalling {
check_out_pic, check_out_pic,
'check_out_pic', 'check_out_pic',
); );
if(res!=null){ if (res != null) {
res = jsonDecode(res); res = jsonDecode(res);
} }
...@@ -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");
...@@ -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;
...@@ -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,22 +2555,20 @@ print("send otp:${data}"); ...@@ -2563,22 +2555,20 @@ 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,
...@@ -2592,22 +2582,22 @@ print("send otp:${data}"); ...@@ -2592,22 +2582,22 @@ print("send otp:${data}");
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),
);
} 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<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;
...@@ -3308,7 +3294,9 @@ print("send otp:${data}"); ...@@ -3308,7 +3294,9 @@ print("send otp:${data}");
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,7 +4219,8 @@ print("send otp:${data}"); ...@@ -4231,7 +4219,8 @@ print("send otp:${data}");
} }
} }
static Future<crmProspectDetailsAddFollowUpAppointmentResponse?> crmProspectDetailsFollowupNextAppointmentAPI( static Future<crmProspectDetailsAddFollowUpAppointmentResponse?>
crmProspectDetailsFollowupNextAppointmentAPI(
empId, empId,
session, session,
nextapp, nextapp,
...@@ -4247,20 +4236,26 @@ print("send otp:${data}"); ...@@ -4247,20 +4236,26 @@ print("send otp:${data}");
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,7 +4266,8 @@ print("send otp:${data}"); ...@@ -4271,7 +4266,8 @@ print("send otp:${data}");
} }
} }
static Future<CommonResponse?> crmProspectDetailsFollowupNextAppointmentOtherCaseAPI( static Future<CommonResponse?>
crmProspectDetailsFollowupNextAppointmentOtherCaseAPI(
empId, empId,
session, session,
nextapp, nextapp,
...@@ -4292,21 +4288,25 @@ print("send otp:${data}"); ...@@ -4292,21 +4288,25 @@ print("send otp:${data}");
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