Commit 185e0896 authored by Sai Srinivas's avatar Sai Srinivas
Browse files

changes by mohit

parent ee5b7a8e
...@@ -57,31 +57,48 @@ class _AllpaymentrequesitionlistsbymodesState ...@@ -57,31 +57,48 @@ class _AllpaymentrequesitionlistsbymodesState
bool shouldShowButtons = false; bool shouldShowButtons = false;
final numberFormat = NumberFormat.decimalPattern(); final numberFormat = NumberFormat.decimalPattern();
final ScrollController _scrollController = ScrollController();
@override @override
void initState() { void initState() {
// TODO: implement initState
super.initState(); super.initState();
_connectivity.initialise(); _connectivity.initialise();
_connectivity.myStream.listen((source) { _connectivity.myStream.listen((source) {
setState(() => _source = source); setState(() => _source = source);
}); });
WidgetsBinding.instance.addPostFrameCallback((timeStamp) { WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
cf = Commondaterangefilter(); cf = Commondaterangefilter();
var provider = Provider.of<Requestionlistprovider>( var provider = Provider.of<Requestionlistprovider>(
context, context,
listen: false, listen: false,
); );
final now = DateTime.now();
final range = DateTimeRange(
start: DateTime(now.year, now.month, now.day),
end: DateTime(now.year, now.month, now.day),
);
final dateRange = cf.getFormattedDateRange(range);
// print(dateRange);
provider.paymentRequestionListsAPIFunction(context, widget.mode, "", ""); provider.paymentRequestionListsAPIFunction(context, widget.mode, "", "");
_scrollController.addListener(() {
if (_scrollController.position.pixels >=
_scrollController.position.maxScrollExtent - 200 &&
!provider.isLoadingMore &&
provider.hasMoreData) {
provider.paymentRequestionListsAPIFunction(
context,
widget.mode,
"",
"",
append: true,
);
}
});
}); });
} }
@override
void dispose() {
_scrollController.dispose();
_connectivity.disposeStream();
super.dispose();
}
//'Requested', //'Requested',
// 'Level 1 Approved', // 'Level 1 Approved',
// 'Level 2 Approved', // 'Level 2 Approved',
...@@ -174,12 +191,12 @@ class _AllpaymentrequesitionlistsbymodesState ...@@ -174,12 +191,12 @@ class _AllpaymentrequesitionlistsbymodesState
return 18.0; return 18.0;
} }
@override // @override
void dispose() { // void dispose() {
// TODO: implement dispose // // TODO: implement dispose
super.dispose(); // super.dispose();
_connectivity.disposeStream(); // _connectivity.disposeStream();
} // }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
...@@ -320,387 +337,316 @@ class _AllpaymentrequesitionlistsbymodesState ...@@ -320,387 +337,316 @@ class _AllpaymentrequesitionlistsbymodesState
0xFFFFFFFF, 0xFFFFFFFF,
), ),
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
body: body: provider.isLoading && requestLists.isEmpty
provider.isLoading ? Center(
? Center( child: CircularProgressIndicator.adaptive(
child: CircularProgressIndicator.adaptive( valueColor: AlwaysStoppedAnimation<Color>(AppColors.app_blue),
valueColor: AlwaysStoppedAnimation<Color>( ),
AppColors.app_blue, )
: requestLists.isNotEmpty
? RefreshIndicator(
onRefresh: () async {
provider.resetPagination();
await provider.paymentRequestionListsAPIFunction(
context,
widget.mode,
"",
"",
);
},
child: Scrollbar(
controller: _scrollController, // attach here
thumbVisibility: false,
child: ListView.builder(
controller: _scrollController,
physics: const AlwaysScrollableScrollPhysics(),
itemCount:
requestLists.length + (provider.hasMoreData ? 1 : 0),
itemBuilder: (context, index) {
// loader row for pagination
if (index == requestLists.length) {
return provider.isLoadingMore
? const Padding(
padding: EdgeInsets.all(16),
child: Center(
child: CircularProgressIndicator(),
), ),
), )
) : const SizedBox.shrink();
: requestLists.isNotEmpty }
? SizedBox(
child: Scrollbar( // Your swipe logic untouched
thumbVisibility: false, final request = requestLists[index];
child: ListView.builder( shouldShowSwipeButtons(request.status);
itemCount: requestLists.length,
shrinkWrap: true, return InkResponse(
physics: AlwaysScrollableScrollPhysics(), onTap: () async {
itemBuilder: (context, index) { HapticFeedback.selectionClick();
shouldShowSwipeButtons(requestLists[index].status); var res = await Navigator.push(
if (requestLists.isEmpty) { context,
return SizedBox( MaterialPageRoute(
child: Center(child: Text("No Data Available")), builder:
); (context) => Paymentrequestionlistdetails(
} pageName: widget.pageTitleName,
return InkResponse( mode: widget.mode,
onTap: () async { paymentRequestId:
HapticFeedback.selectionClick(); requestLists[index].id,
var res = await Navigator.push( ),
context, settings: RouteSettings(
MaterialPageRoute( name: "Paymentrequestionlistdetails",
builder: ),
(context) => Paymentrequestionlistdetails( ),
pageName: widget.pageTitleName, );
mode: widget.mode, if (routeSettingName ==
paymentRequestId: "Paymentrequestionlistdetails") {
requestLists[index].id, print("croos refresh");
), provider.paymentRequestionListsAPIFunction(
settings: RouteSettings( context,
name: "Paymentrequestionlistdetails", widget.mode,
"",
"",
);
}
},
child: Container(
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: ClipRRect(
borderRadius: BorderRadius.circular(20),
child: Slidable(
startActionPane:
shouldShowButtons
? ActionPane(
motion: const ScrollMotion(),
dragDismissible: false,
// dismissible: DismissiblePane(onDismissed: () {}),
children: [
if (shouldShowButtons &&
![
"admin",
"self",
].contains(widget.mode)) ...[
SlidableAction(
onPressed: (context) {
_showLevelRejectionSheet(
context,
requestLists[index].id,
);
},
backgroundColor: Color(
0xFFFFE5E5,
), ),
foregroundColor: Color(
0xFFEF3739,
),
icon: Icons.clear,
label: 'Reject',
), ),
); ],
if (routeSettingName ==
"Paymentrequestionlistdetails") {
print("croos refresh");
provider.paymentRequestionListsAPIFunction(
context,
widget.mode,
"",
"",
);
}
},
child: Container(
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: ClipRRect(
borderRadius: BorderRadius.circular(20),
child: Slidable(
startActionPane:
shouldShowButtons
? ActionPane(
motion: const ScrollMotion(),
dragDismissible: false,
// dismissible: DismissiblePane(onDismissed: () {}),
children: [
if (shouldShowButtons &&
![
"admin",
"self",
].contains(widget.mode)) ...[
SlidableAction(
onPressed: (context) {
_showLevelRejectionSheet(
context,
requestLists[index].id,
);
},
backgroundColor: Color(
0xFFFFE5E5,
),
foregroundColor: Color(
0xFFEF3739,
),
icon: Icons.clear,
label: 'Reject',
),
],
if (widget.mode == "process") ...[ if (widget.mode == "process") ...[
SlidableAction( SlidableAction(
onPressed: (context) { onPressed: (context) {
detailsProvider detailsProvider
.approveRejectPaymentRequestAPIFunction( .approveRejectPaymentRequestAPIFunction(
context, context,
requestLists[index] requestLists[index]
.id, .id,
); );
detailsProvider.preValues(); detailsProvider.preValues();
_showAddPaymentSheet( _showAddPaymentSheet(
context, context,
requestLists[index].id, requestLists[index].id,
); );
}, },
backgroundColor: Color( backgroundColor: Color(
0xFFFFF8E5, 0xFFFFF8E5,
), ),
foregroundColor: Color( foregroundColor: Color(
0xFFFFB600, 0xFFFFB600,
), ),
icon: Icons.add, icon: Icons.add,
label: 'Add Payment', label: 'Add Payment',
), ),
], ],
], ],
) )
: null, : null,
endActionPane: endActionPane:
shouldShowButtons shouldShowButtons
? ActionPane( ? ActionPane(
motion: const ScrollMotion(), motion: const ScrollMotion(),
key: ValueKey( key: ValueKey(
requestLists[index].id, requestLists[index].id,
), ),
dragDismissible: false, dragDismissible: false,
// dismissible: DismissiblePane( // dismissible: DismissiblePane(
// //
// onDismissed: () {}, // onDismissed: () {},
// closeOnCancel: true, // closeOnCancel: true,
// resizeDuration: Duration(milliseconds: 300),), // resizeDuration: Duration(milliseconds: 300),),
children: [ children: [
if ([ if ([
"apr_lvl1", "apr_lvl1",
"apr_lvl2", "apr_lvl2",
"self_apr_lvl2", "self_apr_lvl2",
].contains(widget.mode)) ...[ ].contains(widget.mode)) ...[
SlidableAction( SlidableAction(
onPressed: (context) { onPressed: (context) {
detailsProvider detailsProvider
.paymentRequesitionDetails( .paymentRequesitionDetails(
context, context,
requestLists[index] requestLists[index]
.id, .id,
); );
detailsProvider.preValues(); detailsProvider.preValues();
detailsProvider detailsProvider
.approveRejectPaymentRequestAPIFunction( .approveRejectPaymentRequestAPIFunction(
context, context,
requestLists[index] requestLists[index]
.id, .id,
); );
_showLevelApprovalSheet( _showLevelApprovalSheet(
context, context,
requestLists[index].id, requestLists[index].id,
); );
}, },
backgroundColor: Color( backgroundColor: Color(
0xFFE9FFE8, 0xFFE9FFE8,
), ),
foregroundColor: Color( foregroundColor: Color(
0xFF4CB443, 0xFF4CB443,
), ),
icon: Icons.check, icon: Icons.check,
label: 'Approve', label: 'Approve',
), ),
], ],
], ],
) )
: null, : null,
child: Container( child: Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
horizontal: 10, horizontal: 10,
vertical: 10, vertical: 10,
), ),
child: Column( child: Column(
children: [ children: [
Row( Row(
children: [ children: [
Expanded( Expanded(
flex: 1, flex: 1,
child: Container( child: Container(
height: 50, height: 50,
width: 50, width: 50,
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
decoration: BoxDecoration( decoration: BoxDecoration(
color: getDecorationColor( color: getDecorationColor(
requestLists[index].status, requestLists[index].status,
), ),
shape: BoxShape.circle, shape: BoxShape.circle,
), ),
child: Center( child: Center(
child: Text( child: Text(
getText( getText(
requestLists[index] requestLists[index]
.status, .status,
), ),
style: TextStyle( style: TextStyle(
color: getTextColor( color: getTextColor(
requestLists[index] requestLists[index]
.status, .status,
), ),
fontSize: getSize( fontSize: getSize(
requestLists[index] requestLists[index]
.status, .status,
),
fontFamily: "JakartaBold",
),
),
),
), ),
fontFamily: "JakartaBold",
), ),
SizedBox(width: 10), ),
Expanded( ),
flex: 4, ),
child: SizedBox( ),
child: Column( SizedBox(width: 10),
crossAxisAlignment: Expanded(
CrossAxisAlignment.start, flex: 4,
children: [ child: SizedBox(
Text( child: Column(
requestLists[index] crossAxisAlignment:
.accountName!, CrossAxisAlignment.start,
maxLines: 1, children: [
overflow: Text(
TextOverflow.ellipsis, requestLists[index]
style: TextStyle( .accountName!,
fontFamily: maxLines: 1,
"JakartaRegular", overflow:
fontSize: 14, TextOverflow.ellipsis,
color: style: TextStyle(
AppColors fontFamily:
.semi_black, "JakartaRegular",
), fontSize: 14,
), color:
Text( AppColors
"${requestLists[index].date}", .semi_black,
style: TextStyle(
fontFamily:
"JakartaRegular",
fontSize: 14,
color:
AppColors.app_blue,
),
),
],
),
), ),
), ),
Expanded( Text(
flex: 3, "${requestLists[index].date}",
child: Text( style: TextStyle(
maxLines: 1, fontFamily:
"₹ ${requestLists[index].amount!}", "JakartaRegular",
textAlign: TextAlign.right, fontSize: 14,
style: TextStyle( color:
fontFamily: "JakartaMedium", AppColors.app_blue,
fontSize: 14,
color: AppColors.app_blue,
),
), ),
), ),
], ],
), ),
], ),
), ),
), Expanded(
flex: 3,
child: Text(
maxLines: 1,
"₹ ${requestLists[index].amount!}",
textAlign: TextAlign.right,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
),
],
), ),
), ],
), ),
); ),
}, ),
),
),
)
: Emptywidget(context),
);
},
);
}
Future<void> _showOptionsSheet(BuildContext context) {
return showModalBottomSheet(
useSafeArea: true,
isDismissible: true,
isScrollControlled: true,
showDragHandle: true,
backgroundColor: Colors.white,
enableDrag: true,
context: context,
builder: (context) {
return StatefulBuilder(
builder: (context, setState) {
return SafeArea(
child: Consumer<Requestionlistprovider>(
builder: (context, provider, child) {
return Container(
margin: EdgeInsets.only(
bottom: 15,
left: 15,
right: 15,
top: 10,
),
padding: EdgeInsets.only(
bottom: MediaQuery.of(context).viewInsets.bottom,
),
child: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
SizedBox(height: 15),
...List.generate(5, (index) {
final assetnames = [
"se_locate_customer",
"se_locate_customer",
"se_update_complaint",
"se_payment_details",
"se_payment_details",
];
final Headingnames = [
"Copy to Clipboard",
"Download CSV",
"Download XLSX",
"Download PDF",
"Print Data",
];
return ListTile(
onTap: () {
HapticFeedback.selectionClick();
switch (index) {
case 0:
provider.copyToClipboard(context);
break;
case 1:
provider.downloadCSV(context);
break;
case 2:
provider.downloadXLS(context);
break;
case 3:
provider.downloadPDF(context);
break;
case 4:
provider.printData(context);
break;
}
},
leading: SvgPicture.asset(
"assets/svg/${assetnames[index]}.svg",
),
title: Text(
Headingnames[index],
style: TextStyle(fontFamily: "JakartaMedium"),
),
trailing: SvgPicture.asset(
"assets/svg/arrow_right_new.svg",
),
);
}),
],
), ),
), ),
); );
}, },
), ),
); ),
}, )
: Emptywidget(context),
); );
}, },
); );
} }
Future<void> _showLevelApprovalSheet(BuildContext context, paymentID) { Future<void> _showLevelApprovalSheet(BuildContext context, paymentID) {
return showModalBottomSheet( return showModalBottomSheet(
useSafeArea: true, useSafeArea: true,
......
...@@ -28,41 +28,45 @@ class Paymentlistpaymentrequisition extends StatefulWidget { ...@@ -28,41 +28,45 @@ class Paymentlistpaymentrequisition extends StatefulWidget {
class _PaymentlistpaymentrequisitionState class _PaymentlistpaymentrequisitionState
extends State<Paymentlistpaymentrequisition> { extends State<Paymentlistpaymentrequisition> {
late Commondaterangefilter cf; late Commondaterangefilter cf;
final ScrollController _scrollController = ScrollController();
Map _source = {ConnectivityResult.mobile: true}; Map _source = {ConnectivityResult.mobile: true};
final MyConnectivity _connectivity = MyConnectivity.instance; final MyConnectivity _connectivity = MyConnectivity.instance;
@override @override
void initState() { void initState() {
// TODO: implement initState
super.initState(); super.initState();
_connectivity.initialise(); _connectivity.initialise();
_connectivity.myStream.listen((source) { _connectivity.myStream.listen((source) {
setState(() => _source = source); setState(() => _source = source);
}); });
WidgetsBinding.instance.addPostFrameCallback((timeStamp) { WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
cf = Commondaterangefilter(); cf = Commondaterangefilter();
var provider = Provider.of<Paymentrequisitionpaymentslistprovider>( var provider = Provider.of<Paymentrequisitionpaymentslistprovider>(
context, context,
listen: false, listen: false,
); );
final now = DateTime.now(); provider.resetPagination();
final range = DateTimeRange(
start: DateTime(now.year, now.month, now.day),
end: DateTime(now.year, now.month, now.day),
);
final dateRange = cf.getFormattedDateRange(range);
provider.paymentsListAPI(context, '', ''); provider.paymentsListAPI(context, '', '');
_scrollController.addListener(() {
if (_scrollController.position.pixels >=
_scrollController.position.maxScrollExtent - 200) {
provider.loadMore(context, '', '');
}
});
}); });
} }
@override @override
void dispose() { void dispose() {
// TODO: implement dispose _scrollController.dispose();
super.dispose();
_connectivity.disposeStream(); _connectivity.disposeStream();
super.dispose();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
switch (_source.keys.toList()[0]) { switch (_source.keys.toList()[0]) {
...@@ -145,144 +149,152 @@ class _PaymentlistpaymentrequisitionState ...@@ -145,144 +149,152 @@ class _PaymentlistpaymentrequisitionState
0xFFFFFFFF 0xFFFFFFFF
), ),
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
body: body: provider.isLoading
provider.isLoading ? Center(
? Center( child: CircularProgressIndicator.adaptive(
child: CircularProgressIndicator.adaptive( valueColor: AlwaysStoppedAnimation<Color>(
valueColor: AlwaysStoppedAnimation<Color>( AppColors.app_blue,
AppColors.app_blue, ),
), ),
), )
: requestLists.isNotEmpty
? Scrollbar(
controller: _scrollController,
thumbVisibility: false,
child: ListView.builder(
controller: _scrollController,
itemCount: requestLists.length +
(provider.hasMoreData ? 1 : 0),
itemBuilder: (context, index) {
if (index == requestLists.length) {
return provider.isLoadingMore
? const Padding(
padding: EdgeInsets.all(16),
child: Center(
child: CircularProgressIndicator()),
) )
: requestLists.isNotEmpty : const SizedBox.shrink();
? SizedBox( }
child: Scrollbar(
thumbVisibility: false,
child: ListView.builder( final payment = requestLists[index];
itemCount: requestLists.length, return InkResponse(
shrinkWrap: true, onTap: () async {
physics: AlwaysScrollableScrollPhysics(), HapticFeedback.selectionClick();
itemBuilder: (context, index) { var res = await Navigator.push(
return InkResponse( context,
onTap: () async { MaterialPageRoute(
HapticFeedback.selectionClick(); builder:
var res = await Navigator.push( (context) =>
context, Paymentdetailspaymentrequisition(
MaterialPageRoute( pageName:
builder: widget.pageTitleName,
(context) => paymentRequestId:
Paymentdetailspaymentrequisition( requestLists[index].id,
pageName: ),
widget.pageTitleName, settings: RouteSettings(
paymentRequestId: name:
requestLists[index].id, "Paymentdetailspaymentrequisition",
), ),
settings: RouteSettings( ),
name: );
"Paymentdetailspaymentrequisition", if (routeSettingName ==
), "Paymentdetailspaymentrequisition") {
), print("pld");
);
if (routeSettingName ==
"Paymentdetailspaymentrequisition") {
print("pld");
provider.paymentsListAPI(context, '', ''); provider.paymentsListAPI(context, '', '');
} }
}, },
child: Container( child: Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
horizontal: 10, horizontal: 10,
vertical: 10, vertical: 10,
), ),
margin: EdgeInsets.symmetric( margin: EdgeInsets.symmetric(
horizontal: 10, horizontal: 10,
vertical: 5, vertical: 5,
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(16),
),
child: Column(
children: [
Row(
children: [
Expanded(
flex: 1,
child: Container(
height: 50,
width: 50,
padding: EdgeInsets.all(3.0),
decoration: BoxDecoration(
color: AppColors.requested_bg_color,
shape: BoxShape.circle
),
child: SvgPicture.asset(
"assets/svg/finance/rupee_ic.svg",
fit: BoxFit.scaleDown,
),
), ),
child: Column( ),
children: [ SizedBox(width: 10),
Row( Expanded(
children: [ flex: 4,
Expanded( child: SizedBox(
flex: 1, child: Column(
child: Container( crossAxisAlignment:
height: 50, CrossAxisAlignment.start,
width: 50, children: [
padding: EdgeInsets.all(3.0), Text(
decoration: BoxDecoration( requestLists[index]
color: AppColors.requested_bg_color, .receipientAccount!,
shape: BoxShape.circle maxLines: 1,
), overflow: TextOverflow.ellipsis,
child: SvgPicture.asset( style: TextStyle(
"assets/svg/finance/rupee_ic.svg", fontFamily: "JakartaRegular",
fit: BoxFit.scaleDown, fontSize: 14,
), color: AppColors.semi_black,
),
),
SizedBox(width: 10),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
requestLists[index]
.receipientAccount!,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontFamily: "JakartaRegular",
fontSize: 14,
color: AppColors.semi_black,
),
),
Text(
"${requestLists[index].paymentDate}",
style: TextStyle(
fontFamily: "JakartaRegular",
fontSize: 14,
color: AppColors.app_blue,
),
),
],
),
),
), ),
SizedBox(width: 10), ),
Expanded( Text(
flex: 3, "${requestLists[index].paymentDate}",
child: Text( style: TextStyle(
"₹${requestLists[index].amount}", fontFamily: "JakartaRegular",
maxLines: 1, fontSize: 14,
textAlign: TextAlign.right, color: AppColors.app_blue,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
), ),
),
],
),
),
),
SizedBox(width: 10),
Expanded(
flex: 3,
child: Text(
"₹${requestLists[index].amount}",
maxLines: 1,
textAlign: TextAlign.right,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
),
], ],
), ),
], ],
),
),
);
},
),
), ),
) ),
: Emptywidget(context), );
},
),
)
: Emptywidget(context),
); );
}, },
); );
......
...@@ -29,24 +29,41 @@ class Paymentreceiptlist extends StatefulWidget { ...@@ -29,24 +29,41 @@ class Paymentreceiptlist extends StatefulWidget {
class _PaymentreceiptlistState extends State<Paymentreceiptlist> { class _PaymentreceiptlistState extends State<Paymentreceiptlist> {
Map _source = {ConnectivityResult.mobile: true}; Map _source = {ConnectivityResult.mobile: true};
final MyConnectivity _connectivity = MyConnectivity.instance; final MyConnectivity _connectivity = MyConnectivity.instance;
final ScrollController _scrollController = ScrollController();
@override @override
void initState() { void initState() {
// TODO: implement initState
super.initState(); super.initState();
_connectivity.initialise(); _connectivity.initialise();
_connectivity.myStream.listen((source) { _connectivity.myStream.listen((source) {
setState(() => _source = source); setState(() => _source = source);
}); });
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
WidgetsBinding.instance.addPostFrameCallback((_) {
var provider = Provider.of<Paymentreceiptsprovider>( var provider = Provider.of<Paymentreceiptsprovider>(
context, context,
listen: false, listen: false,
); );
provider.resetPagination();
provider.paymentsListAPI(context, '', ''); provider.paymentsListAPI(context, '', '');
_scrollController.addListener(() {
if (_scrollController.position.pixels >=
_scrollController.position.maxScrollExtent - 200) {
provider.loadMore(context, '', '');
}
});
}); });
} }
@override
void dispose() {
_scrollController.dispose();
_connectivity.disposeStream();
super.dispose();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
switch (_source.keys.toList()[0]) { switch (_source.keys.toList()[0]) {
...@@ -77,6 +94,7 @@ class _PaymentreceiptlistState extends State<Paymentreceiptlist> { ...@@ -77,6 +94,7 @@ class _PaymentreceiptlistState extends State<Paymentreceiptlist> {
Widget _scaffold(BuildContext context) { Widget _scaffold(BuildContext context) {
return Consumer<Paymentreceiptsprovider>( return Consumer<Paymentreceiptsprovider>(
builder: (context, provider, child) { builder: (context, provider, child) {
final receipts = provider.receiptsList;
final requestLists = provider.receiptsList; final requestLists = provider.receiptsList;
return Scaffold( return Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
...@@ -129,137 +147,146 @@ class _PaymentreceiptlistState extends State<Paymentreceiptlist> { ...@@ -129,137 +147,146 @@ class _PaymentreceiptlistState extends State<Paymentreceiptlist> {
0xFFFFFFFF, 0xFFFFFFFF,
), ),
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
body: body: provider.isLoading
provider.isLoading ? Center(
? Center( child: CircularProgressIndicator.adaptive(
child: CircularProgressIndicator.adaptive( valueColor: AlwaysStoppedAnimation<Color>(
valueColor: AlwaysStoppedAnimation<Color>( AppColors.app_blue,
AppColors.app_blue, ),
),
)
: receipts.isNotEmpty
? Scrollbar(
controller: _scrollController,
child: ListView.builder(
controller: _scrollController,
itemCount:
receipts.length + (provider.hasMoreData ? 1 : 0),
itemBuilder: (context, index) {
if (index == receipts.length) {
return provider.isLoadingMore
? const Padding(
padding: EdgeInsets.all(16),
child: Center(
child: CircularProgressIndicator()),
)
: const SizedBox.shrink();
}
final receipt = receipts[index];
return InkResponse(
onTap: () async {
HapticFeedback.selectionClick();
var res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => Paymentreceiptdetails(
pageName: widget.pageTitleName,
paymentRequestId:
requestLists[index].id,
),
settings: RouteSettings(
name: "Paymentreceiptdetails",
),
), ),
);
if (routeSettingName == "Paymentreceiptdetails") {
debugPrint("prd");
provider.paymentsListAPI(context, '', '');
}
// if (res == true) {
// provider.paymentsListAPI(context, '', '');
// }
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
), ),
) margin: EdgeInsets.symmetric(
: requestLists.isNotEmpty horizontal: 10,
? SizedBox( vertical: 5,
child: Scrollbar( ),
child: ListView.builder( decoration: BoxDecoration(
itemCount: requestLists.length, color: Colors.white,
shrinkWrap: true, borderRadius: BorderRadius.circular(16),
physics: AlwaysScrollableScrollPhysics(), ),
itemBuilder: (context, index) { child: Column(
return InkResponse( children: [
onTap: () async { Row(
HapticFeedback.selectionClick(); children: [
var res = await Navigator.push( Expanded(
context, flex: 1,
MaterialPageRoute( child: Container(
builder: height: 50,
(context) => Paymentreceiptdetails( width: 50,
pageName: widget.pageTitleName, padding: EdgeInsets.all(3.0),
paymentRequestId: decoration: BoxDecoration(
requestLists[index].id, color: AppColors.requested_bg_color,
), shape: BoxShape.circle,
settings: RouteSettings( ),
name: "Paymentreceiptdetails", child: SvgPicture.asset(
), "assets/svg/finance/rupee_ic.svg",
fit: BoxFit.scaleDown,
), ),
);
if (routeSettingName == "Paymentreceiptdetails") {
debugPrint("prd");
provider.paymentsListAPI(context, '', '');
}
// if (res == true) {
// provider.paymentsListAPI(context, '', '');
// }
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
), ),
child: Column( ),
children: [ SizedBox(width: 10),
Row( Expanded(
children: [ flex: 4,
Expanded( child: SizedBox(
flex: 1, child: Column(
child: Container( crossAxisAlignment:
height: 50, CrossAxisAlignment.start,
width: 50, children: [
padding: EdgeInsets.all(3.0), Text(
decoration: BoxDecoration( requestLists[index]
color: AppColors.requested_bg_color, .receipientAccount!,
shape: BoxShape.circle, maxLines: 1,
), overflow: TextOverflow.ellipsis,
child: SvgPicture.asset( style: TextStyle(
"assets/svg/finance/rupee_ic.svg", fontFamily: "JakartaRegular",
fit: BoxFit.scaleDown, fontSize: 14,
), color: AppColors.semi_black,
),
),
SizedBox(width: 10),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
requestLists[index]
.receipientAccount!,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontFamily: "JakartaRegular",
fontSize: 14,
color: AppColors.semi_black,
),
),
Text(
"${requestLists[index].receiptDate}",
style: TextStyle(
fontFamily: "JakartaRegular",
fontSize: 14,
color: AppColors.grey_semi,
),
),
],
),
),
), ),
SizedBox(width: 10), ),
Expanded( Text(
flex: 3, "${requestLists[index].receiptDate}",
child: Text( style: TextStyle(
"₹${requestLists[index].amount}", fontFamily: "JakartaRegular",
textAlign: TextAlign.right, fontSize: 14,
maxLines: 1, color: AppColors.grey_semi,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
), ),
], ),
), ],
], ),
), ),
), ),
); SizedBox(width: 10),
}, Expanded(
), flex: 3,
child: Text(
"₹${requestLists[index].amount}",
textAlign: TextAlign.right,
maxLines: 1,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
),
],
),
],
), ),
) ),
: Emptywidget(context), );
},
),
)
: Emptywidget(context),
); );
}, },
); );
......
...@@ -66,7 +66,7 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> { ...@@ -66,7 +66,7 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> {
], ],
), ),
), ),
backgroundColor: const Color(0xffF6F6F8), backgroundColor: AppColors.scaffold_bg_color,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Column( child: Column(
children: [ children: [
......
...@@ -2,24 +2,27 @@ import 'package:dotted_line/dotted_line.dart'; ...@@ -2,24 +2,27 @@ import 'package:dotted_line/dotted_line.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
import '../../Notifiers/hrmProvider/leaveApplicationDetailsProvider.dart'; import '../../Notifiers/hrmProvider/leaveApplicationDetailsProvider.dart';
import '../../Notifiers/HomeScreenNotifier.dart';
import '../../Utils/app_colors.dart'; import '../../Utils/app_colors.dart';
import '../finance/FileViewer.dart';
/// Screen for leave application details /// Screen for leave application details
class LeaveApplicationDetailScreen extends StatefulWidget { class LeaveApplicationDetailScreen extends StatefulWidget {
final String leaveRequestId; final String leaveRequestId;
final String mode; final String mode;
const LeaveApplicationDetailScreen({super.key, required this.leaveRequestId, required this.mode}); const LeaveApplicationDetailScreen({
super.key,
required this.leaveRequestId,
required this.mode,
});
@override @override
State<LeaveApplicationDetailScreen> createState() => _LeaveApplicationDetailScreenState(); State<LeaveApplicationDetailScreen> createState() =>
_LeaveApplicationDetailScreenState();
} }
class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScreen> { class _LeaveApplicationDetailScreenState
extends State<LeaveApplicationDetailScreen> {
bool _actionSubmitted = false; bool _actionSubmitted = false;
@override @override
...@@ -30,12 +33,19 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr ...@@ -30,12 +33,19 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr
// Scale factors based on screen size // Scale factors based on screen size
final scaleFactor = screenWidth / 360; // Base width for scaling final scaleFactor = screenWidth / 360; // Base width for scaling
final textScaleFactor = MediaQuery.of(context).textScaleFactor.clamp(1.0, 1.2); final textScaleFactor = MediaQuery.of(
context,
).textScaleFactor.clamp(1.0, 1.2);
return SafeArea( return SafeArea(
top: false, top: false,
child: ChangeNotifierProvider( child: ChangeNotifierProvider(
create: (_) => LeaveApplicationDetailsProvider()..fetchLeaveApplicationDetails(context, widget.leaveRequestId), create:
(_) =>
LeaveApplicationDetailsProvider()..fetchLeaveApplicationDetails(
context,
widget.leaveRequestId,
),
child: Consumer<LeaveApplicationDetailsProvider>( child: Consumer<LeaveApplicationDetailsProvider>(
builder: (context, provider, child) { builder: (context, provider, child) {
return Scaffold( return Scaffold(
...@@ -74,7 +84,9 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr ...@@ -74,7 +84,9 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr
body: Builder( body: Builder(
builder: (context) { builder: (context) {
if (provider.isLoading) { if (provider.isLoading) {
return const Center(child: CircularProgressIndicator(color: Colors.blue)); return const Center(
child: CircularProgressIndicator(color: Colors.blue),
);
} }
if (provider.response?.requestDetails == null) { if (provider.response?.requestDetails == null) {
return const Center(child: Text("No details found")); return const Center(child: Text("No details found"));
...@@ -89,7 +101,9 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr ...@@ -89,7 +101,9 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr
children: [ children: [
Card( Card(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16 * scaleFactor), borderRadius: BorderRadius.circular(
16 * scaleFactor,
),
), ),
elevation: 0, elevation: 0,
child: Padding( child: Padding(
...@@ -99,14 +113,18 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr ...@@ -99,14 +113,18 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr
children: [ children: [
/// Header with status /// Header with status
Container( Container(
margin: EdgeInsets.only(bottom: 0.5 * scaleFactor), margin: EdgeInsets.only(
bottom: 0.5 * scaleFactor,
),
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
horizontal: 2.5 * scaleFactor, horizontal: 2.5 * scaleFactor,
vertical: 12 * scaleFactor, vertical: 12 * scaleFactor,
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(12 * scaleFactor), borderRadius: BorderRadius.circular(
12 * scaleFactor,
),
), ),
child: Row( child: Row(
children: [ children: [
...@@ -132,14 +150,18 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr ...@@ -132,14 +150,18 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr
/// Middle text /// Middle text
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Text( Text(
details.leaveType ?? "-", details.leaveType ?? "-",
style: TextStyle( style: TextStyle(
decoration: TextDecoration.underline, decoration:
decorationStyle: TextDecorationStyle.dotted, TextDecoration.underline,
decorationColor: AppColors.grey_thick, decorationStyle:
TextDecorationStyle.dotted,
decorationColor:
AppColors.grey_thick,
height: 1.2, height: 1.2,
fontFamily: "JakartaRegular", fontFamily: "JakartaRegular",
fontSize: 14, fontSize: 14,
...@@ -166,8 +188,12 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr ...@@ -166,8 +188,12 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr
horizontal: 12 * scaleFactor, horizontal: 12 * scaleFactor,
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6 * scaleFactor), borderRadius: BorderRadius.circular(
color: _getStatusBackgroundColor(details.status), 6 * scaleFactor,
),
color: _getStatusBackgroundColor(
details.status,
),
), ),
child: Center( child: Center(
child: Text( child: Text(
...@@ -175,7 +201,9 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr ...@@ -175,7 +201,9 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr
style: TextStyle( style: TextStyle(
fontSize: 13, fontSize: 13,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: _getStatusTextColor(details.status), color: _getStatusTextColor(
details.status,
),
), ),
), ),
), ),
...@@ -189,26 +217,89 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr ...@@ -189,26 +217,89 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr
padding: EdgeInsets.all(8.0 * scaleFactor), padding: EdgeInsets.all(8.0 * scaleFactor),
child: Column( child: Column(
children: [ children: [
_buildSectionHeader("Leave Details", scaleFactor), _buildSectionHeader(
_buildDetailTile("Application ID", details.id, scaleFactor), "Leave Details",
_buildDetailTile("Applied Date", details.appliedDate, scaleFactor), scaleFactor,
_buildDetailTile("Leave Type", details.leaveType, scaleFactor), ),
_buildDateRangeTile("Leave Period", details.fromDate, details.toDate, scaleFactor), _buildDetailTile(
_buildTimeRangeTile("Time Period", details.fromTime, details.toTime, scaleFactor), "Application ID",
_buildDetailTile("Reason", details.reason, scaleFactor), details.id,
scaleFactor,
),
_buildDetailTile(
"Applied Date",
details.appliedDate,
scaleFactor,
),
_buildDetailTile(
"Leave Type",
details.leaveType,
scaleFactor,
),
_buildDateRangeTile(
"Leave Period",
details.fromDate,
details.toDate,
scaleFactor,
),
_buildTimeRangeTile(
"Time Period",
details.fromTime,
details.toTime,
scaleFactor,
),
_buildDetailTile(
"Reason",
details.reason,
scaleFactor,
),
/// Approval Details /// Approval Details
_buildSectionHeader("Approval Details", scaleFactor), _buildSectionHeader(
_buildDetailTile("Requested To", details.requestedTo, scaleFactor), "Approval Details",
_buildDetailTile("Approved By", details.approvedBy, scaleFactor), scaleFactor,
_buildDetailTile("Approved Date", details.approvedDate, scaleFactor), ),
_buildDetailTile("Approval Remarks", details.approvalRemarks, scaleFactor), _buildDetailTile(
"Requested To",
details.requestedTo,
scaleFactor,
),
_buildDetailTile(
"Approved By",
details.approvedBy,
scaleFactor,
),
_buildDetailTile(
"Approved Date",
details.approvedDate,
scaleFactor,
),
_buildDetailTile(
"Approval Remarks",
details.approvalRemarks,
scaleFactor,
),
/// Additional Information /// Additional Information
_buildSectionHeader("Additional Information", scaleFactor), _buildSectionHeader(
_buildDetailTile("Status", details.status, scaleFactor), "Additional Information",
_buildDetailTile("From Time", details.fromTime, scaleFactor), scaleFactor,
_buildDetailTile("To Time", details.toTime, scaleFactor), ),
_buildDetailTile(
"Status",
details.status,
scaleFactor,
),
_buildDetailTile(
"From Time",
details.fromTime,
scaleFactor,
),
_buildDetailTile(
"To Time",
details.toTime,
scaleFactor,
),
], ],
), ),
), ),
...@@ -222,129 +313,158 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr ...@@ -222,129 +313,158 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr
); );
}, },
), ),
bottomNavigationBar: (widget.mode == "teamleader" bottomNavigationBar:
&& !_actionSubmitted (widget.mode == "teamleader" &&
&& provider.response?.requestDetails?.status != "Approved" !_actionSubmitted &&
&& provider.response?.requestDetails?.status != "Rejected") provider.response?.requestDetails?.status !=
? Container( "Approved" &&
decoration: const BoxDecoration( provider.response?.requestDetails?.status !=
gradient: LinearGradient( "Rejected")
begin: Alignment.topCenter, ? Container(
end: Alignment.bottomCenter, decoration: const BoxDecoration(
colors: [ gradient: LinearGradient(
Color(0xffFFFFFF), begin: Alignment.topCenter,
Color(0x00FFFFFF), end: Alignment.bottomCenter,
], colors: [Color(0xffFFFFFF), Color(0x00FFFFFF)],
),
),
padding: EdgeInsets.symmetric(horizontal: 10 * scaleFactor, vertical: 6 * scaleFactor),
height: 61 * scaleFactor,
child: Column(
children: [
Row(
children: [
/// Reject Button
Expanded(
child: InkWell(
onTap: () {
showRemarkSheet(
context: context,
actionType: "Reject",
onSubmit: (remark) {
provider.leaveRequestRejectApprove(
context,
mode: widget.mode,
type: "Rejected",
remarks: remark,
id: provider.response!.requestDetails!.id!,
);
},
).then((_) {
provider.fetchLeaveApplicationDetails(context, widget.leaveRequestId);
});
},
child: Container(
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8 * scaleFactor),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SvgPicture.asset("assets/svg/finance/level_reject_ic.svg"),
SizedBox(width: 6 * scaleFactor),
Text(
"Reject",
style: TextStyle(
color: Colors.black87,
fontSize: 14 * scaleFactor,
fontFamily: "JakartaMedium",
),
),
],
),
),
), ),
), ),
padding: EdgeInsets.symmetric(
/// Vertical Divider horizontal: 10 * scaleFactor,
Container( vertical: 6 * scaleFactor,
width: 1,
height: 45 * scaleFactor,
color: Colors.grey.shade300,
), ),
height: 61 * scaleFactor,
child: Column(
children: [
Row(
children: [
/// Reject Button
Expanded(
child: InkWell(
onTap: () {
showRemarkSheet(
context: context,
actionType: "Reject",
onSubmit: (remark) {
provider.leaveRequestRejectApprove(
context,
mode: widget.mode,
type: "Rejected",
remarks: remark,
id:
provider
.response!
.requestDetails!
.id!,
);
},
).then((_) {
provider.fetchLeaveApplicationDetails(
context,
widget.leaveRequestId,
);
});
},
child: Container(
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(
8 * scaleFactor,
),
),
child: Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
SvgPicture.asset(
"assets/svg/finance/level_reject_ic.svg",
),
SizedBox(width: 6 * scaleFactor),
Text(
"Reject",
style: TextStyle(
color: Colors.black87,
fontSize: 14 * scaleFactor,
fontFamily: "JakartaMedium",
),
),
],
),
),
),
),
/// Approve Button /// Vertical Divider
Expanded( Container(
child: InkWell( width: 1,
onTap: () { height: 45 * scaleFactor,
showRemarkSheet( color: Colors.grey.shade300,
context: context, ),
actionType: "Approve",
onSubmit: (remark) async { /// Approve Button
await provider.leaveRequestRejectApprove( Expanded(
context, child: InkWell(
mode: widget.mode, onTap: () {
type: "Approved", showRemarkSheet(
remarks: remark, context: context,
id: provider.response!.requestDetails!.id!, actionType: "Approve",
); onSubmit: (remark) async {
}, await provider
).then((_) { .leaveRequestRejectApprove(
provider.fetchLeaveApplicationDetails(context, widget.leaveRequestId); context,
}); mode: widget.mode,
}, type: "Approved",
child: Container( remarks: remark,
alignment: Alignment.center, id:
decoration: BoxDecoration( provider
borderRadius: BorderRadius.circular(8 * scaleFactor), .response!
), .requestDetails!
child: Row( .id!,
mainAxisAlignment: MainAxisAlignment.center, );
children: [ },
SvgPicture.asset("assets/svg/finance/level_approve_ic.svg"), ).then((_) {
SizedBox(width: 6 * scaleFactor), provider.fetchLeaveApplicationDetails(
Text( context,
"Approve", widget.leaveRequestId,
style: TextStyle( );
color: Colors.black87, });
fontSize: 14 * scaleFactor, },
fontFamily: "JakartaMedium", child: Container(
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(
8 * scaleFactor,
),
),
child: Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
SvgPicture.asset(
"assets/svg/finance/level_approve_ic.svg",
),
SizedBox(width: 6 * scaleFactor),
Text(
"Approve",
style: TextStyle(
color: Colors.black87,
fontSize: 14 * scaleFactor,
fontFamily: "JakartaMedium",
),
),
],
),
), ),
), ),
], ),
), ],
), ),
), SizedBox(height: 2 * scaleFactor),
],
), ),
], )
), : const SizedBox.shrink(),
SizedBox(height: 2 * scaleFactor) floatingActionButtonLocation:
], FloatingActionButtonLocation.centerDocked,
),
)
: const SizedBox.shrink(),
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
); );
}, },
), ),
...@@ -380,7 +500,9 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr ...@@ -380,7 +500,9 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr
bool validateFields() { bool validateFields() {
String? newRemarkError = String? newRemarkError =
remarkController.text.trim().isEmpty ? "Remark required" : null; remarkController.text.trim().isEmpty
? "Remark required"
: null;
if (remarkError != newRemarkError) { if (remarkError != newRemarkError) {
updateState(() { updateState(() {
...@@ -390,23 +512,30 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr ...@@ -390,23 +512,30 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr
return newRemarkError == null; return newRemarkError == null;
} }
Widget errorText(String? msg) => msg == null Widget errorText(String? msg) =>
? const SizedBox() msg == null
: Padding( ? const SizedBox()
padding: EdgeInsets.only(top: 4 * scaleFactor, left: 4 * scaleFactor), : Padding(
child: Text( padding: EdgeInsets.only(
msg, top: 4 * scaleFactor,
style: TextStyle( left: 4 * scaleFactor,
color: Colors.red, ),
fontSize: 12 * scaleFactor, child: Text(
fontFamily: "JakartaMedium", msg,
), style: TextStyle(
), color: Colors.red,
); fontSize: 12 * scaleFactor,
fontFamily: "JakartaMedium",
),
),
);
return SafeArea( return SafeArea(
child: Container( child: Container(
margin: EdgeInsets.symmetric(horizontal: 15 * scaleFactor, vertical: 10 * scaleFactor), margin: EdgeInsets.symmetric(
horizontal: 15 * scaleFactor,
vertical: 10 * scaleFactor,
),
padding: EdgeInsets.only( padding: EdgeInsets.only(
bottom: MediaQuery.of(context).viewInsets.bottom, bottom: MediaQuery.of(context).viewInsets.bottom,
), ),
...@@ -461,8 +590,8 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr ...@@ -461,8 +590,8 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr
), ),
border: InputBorder.none, border: InputBorder.none,
contentPadding: EdgeInsets.symmetric( contentPadding: EdgeInsets.symmetric(
horizontal: 12 * scaleFactor, horizontal: 12 * scaleFactor,
vertical: 12 * scaleFactor vertical: 12 * scaleFactor,
), ),
), ),
), ),
...@@ -480,7 +609,9 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr ...@@ -480,7 +609,9 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr
height: 45 * scaleFactor, height: 45 * scaleFactor,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0x12AAAAAA), color: Color(0x12AAAAAA),
borderRadius: BorderRadius.circular(12 * scaleFactor), borderRadius: BorderRadius.circular(
12 * scaleFactor,
),
), ),
child: Center( child: Center(
child: Text( child: Text(
...@@ -510,7 +641,9 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr ...@@ -510,7 +641,9 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr
} }
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar( SnackBar(
content: Text("Request submitted successfully"), content: Text(
"Request submitted successfully",
),
backgroundColor: Colors.green, backgroundColor: Colors.green,
behavior: SnackBarBehavior.floating, behavior: SnackBarBehavior.floating,
), ),
...@@ -521,7 +654,9 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr ...@@ -521,7 +654,9 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr
height: 45 * scaleFactor, height: 45 * scaleFactor,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.blue, color: Colors.blue,
borderRadius: BorderRadius.circular(12 * scaleFactor), borderRadius: BorderRadius.circular(
12 * scaleFactor,
),
), ),
child: Center( child: Center(
child: Text( child: Text(
...@@ -538,7 +673,7 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr ...@@ -538,7 +673,7 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr
), ),
], ],
), ),
SizedBox(height: 2 * scaleFactor) SizedBox(height: 2 * scaleFactor),
], ],
), ),
), ),
...@@ -591,7 +726,12 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr ...@@ -591,7 +726,12 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr
} }
/// For date range display /// For date range display
Widget _buildDateRangeTile(String label, String? fromDate, String? toDate, double scaleFactor) { Widget _buildDateRangeTile(
String label,
String? fromDate,
String? toDate,
double scaleFactor,
) {
return Padding( return Padding(
padding: EdgeInsets.symmetric(vertical: 6 * scaleFactor), padding: EdgeInsets.symmetric(vertical: 6 * scaleFactor),
child: Row( child: Row(
...@@ -631,8 +771,14 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr ...@@ -631,8 +771,14 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr
} }
/// For time range display /// For time range display
Widget _buildTimeRangeTile(String label, String? fromTime, String? toTime, double scaleFactor) { Widget _buildTimeRangeTile(
if ((fromTime == null || fromTime.isEmpty) && (toTime == null || toTime.isEmpty)) { String label,
String? fromTime,
String? toTime,
double scaleFactor,
) {
if ((fromTime == null || fromTime.isEmpty) &&
(toTime == null || toTime.isEmpty)) {
return const SizedBox.shrink(); return const SizedBox.shrink();
} }
...@@ -684,10 +830,7 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr ...@@ -684,10 +830,7 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr
children: [ children: [
Text( Text(
title, title,
style: TextStyle( style: TextStyle(fontSize: 14, fontFamily: "JakartaSemiBold"),
fontSize: 14,
fontFamily: "JakartaSemiBold",
),
), ),
SizedBox(width: 10 * scaleFactor), SizedBox(width: 10 * scaleFactor),
Expanded( Expanded(
...@@ -729,4 +872,4 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr ...@@ -729,4 +872,4 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr
return AppColors.requested_text_color; return AppColors.requested_text_color;
} }
} }
} }
\ No newline at end of file
...@@ -16,222 +16,286 @@ class TourExpensesListScreen extends StatefulWidget { ...@@ -16,222 +16,286 @@ class TourExpensesListScreen extends StatefulWidget {
} }
class _TourExpensesListScreenState extends State<TourExpensesListScreen> { class _TourExpensesListScreenState extends State<TourExpensesListScreen> {
final ScrollController _scrollController = ScrollController();
int _currentPage = 1;
bool _isLoadingMore = false;
bool _hasMoreItems = true;
@override
void initState() {
super.initState();
_scrollController.addListener(_scrollListener);
// fetch first page only once
Future.microtask(() {
final provider =
Provider.of<TourExpensesProvider>(context, listen: false);
provider.fetchTourExpenses(context, "1");
});
}
@override
void dispose() {
_scrollController.removeListener(_scrollListener);
_scrollController.dispose();
super.dispose();
}
void _scrollListener() {
if (_scrollController.position.pixels ==
_scrollController.position.maxScrollExtent) {
_loadMoreItems(context);
}
}
void _loadMoreItems(BuildContext context) {
if (_isLoadingMore || !_hasMoreItems) return;
final provider = Provider.of<TourExpensesProvider>(context, listen: false);
setState(() {
_isLoadingMore = true;
_currentPage++;
});
provider
.fetchTourExpenses(context, _currentPage.toString(), append: true)
.then((_) {
setState(() {
_isLoadingMore = false;
final newItems = provider.response?.tourList ?? [];
if (newItems.length < _currentPage * 10) {
// assuming API gives 10 items per page
_hasMoreItems = false;
}
});
}).catchError((_) {
setState(() {
_isLoadingMore = false;
_currentPage--; // rollback
});
});
}
void _refreshList(BuildContext context) {
final provider = Provider.of<TourExpensesProvider>(context, listen: false);
setState(() {
_currentPage = 1;
_hasMoreItems = true;
_isLoadingMore = false;
});
provider.fetchTourExpenses(context, "1");
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SafeArea( return SafeArea(
top: false, top: false,
child: ChangeNotifierProvider( child: Consumer<TourExpensesProvider>(
create: (_) => TourExpensesProvider()..fetchTourExpenses(context, "1"), builder: (context, provider, child) {
child: Consumer<TourExpensesProvider>( return Scaffold(
builder: (context, provider, child) { appBar: AppBar(
return Scaffold( automaticallyImplyLeading: false,
appBar: AppBar( backgroundColor: Colors.white,
automaticallyImplyLeading: false, title: Row(
backgroundColor: Colors.white, children: [
title: Row( InkResponse(
children: [ onTap: () => Navigator.pop(context, true),
InkResponse( child: SvgPicture.asset(
onTap: () => Navigator.pop(context, true), "assets/svg/appbar_back_button.svg",
child: SvgPicture.asset( height: 25,
"assets/svg/appbar_back_button.svg",
height: 25,
),
), ),
const SizedBox(width: 10), ),
const Text( const SizedBox(width: 10),
"Tour Expenses", const Text(
style: TextStyle( "Tour Expenses",
fontSize: 18, style: TextStyle(
fontFamily: "Plus Jakarta Sans", fontSize: 18,
fontWeight: FontWeight.w600, fontFamily: "Plus Jakarta Sans",
color: Colors.black87, fontWeight: FontWeight.w600,
), color: Colors.black87,
), ),
], ),
), ],
), ),
),
backgroundColor: const Color(0xFFF6F6F8),
body: _buildBody(provider),
bottomNavigationBar: _buildBottomBar(context),
);
},
),
);
}
backgroundColor: const Color(0xFFF6F6F8), Widget _buildBody(TourExpensesProvider provider) {
if (provider.isLoading && _currentPage == 1) {
body: Column( return const Center(
children: [ child: CircularProgressIndicator(color: Colors.blue));
Expanded( }
child: Builder( if (provider.errorMessage != null) {
builder: (context) { return Center(
if (provider.isLoading) { child: Column(
return const Center( mainAxisAlignment: MainAxisAlignment.center,
child: CircularProgressIndicator(color: Colors.blue)); children: [
} Text(provider.errorMessage!),
if (provider.errorMessage != null) { const SizedBox(height: 16),
return Center(child: Text(provider.errorMessage!)); ElevatedButton(
} onPressed: () => _refreshList(context),
if (provider.response?.tourList == null || child: const Text("Retry"),
provider.response!.tourList!.isEmpty) { ),
return const Center(child: Text("No Tour Expenses Found")); ],
} ),
);
final list = provider.response!.tourList!; }
return ListView.builder( if (provider.response?.tourList == null ||
padding: const EdgeInsets.all(12), provider.response!.tourList!.isEmpty) {
itemCount: list.length, return const Center(child: Text("No Tour Expenses Found"));
itemBuilder: (context, index) { }
final TourList item = list[index];
return InkWell( final list = provider.response!.tourList!;
onTap: () { return RefreshIndicator(
/// navigation flow onRefresh: () async {
Navigator.push( _refreshList(context);
context, },
MaterialPageRoute( child: ListView.builder(
builder: (context) => TourExpensesDetailsScreen( controller: _scrollController,
tourBillId: item.id.toString(), padding: const EdgeInsets.all(12),
), itemCount: list.length + (_hasMoreItems ? 1 : 0),
), itemBuilder: (context, index) {
); if (index >= list.length) {
}, return Padding(
child: Container( padding: const EdgeInsets.symmetric(vertical: 16),
margin: const EdgeInsets.symmetric(vertical: 6), child: Center(
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 12), child: _isLoadingMore
decoration: BoxDecoration( ? const CircularProgressIndicator(color: Colors.blue)
color: Colors.white, : !_hasMoreItems
borderRadius: BorderRadius.circular(16), ? const Text("No more items to load")
), : const SizedBox.shrink(),
child: Row( ),
children: [ );
/// Left Avatar Circle }
Container(
height: 46,
width: 46,
decoration: BoxDecoration(
color: _getAvatarColor(item.approvalStatus),
shape: BoxShape.circle,
),
child: Center(
child: Text(
getText(item.approvalStatus),
style: TextStyle(
fontSize: 15,
fontFamily: "Plus Jakarta Sans",
fontWeight: FontWeight.w500,
color: _getAvatarTxtColor(item.approvalStatus),
),
),
),
),
const SizedBox(width: 12),
/// Middle Section final TourList item = list[index];
Expanded( return _buildItem(context, item);
child: Column( },
crossAxisAlignment: CrossAxisAlignment.start, ),
children: [ );
Text( }
item.placeOfVisit ?? "-",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontFamily: "JakartaRegular",
fontSize: 14,
color: AppColors.semi_black,
),
),
Text(
item.appliedDate ?? "-",
style: TextStyle(
fontFamily: "JakartaRegular",
fontSize: 14,
color: AppColors.grey_semi,
),
),
],
),
),
/// Right Section (Applied Amount) Widget _buildItem(BuildContext context, TourList item) {
Text( return InkWell(
"₹${item.appliedAmount ?? '0'}", onTap: () {
style: const TextStyle( Navigator.push(
fontFamily: "JakartaMedium", context,
fontSize: 14, MaterialPageRoute(
color: Color(0xff1487c9), builder: (context) =>
) TourExpensesDetailsScreen(tourBillId: item.id.toString()),
), ),
], );
), },
), child: Container(
); margin: const EdgeInsets.symmetric(vertical: 6),
}, padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 12),
); decoration: BoxDecoration(
}, color: Colors.white,
), borderRadius: BorderRadius.circular(16),
),
child: Row(
children: [
Container(
height: 46,
width: 46,
decoration: BoxDecoration(
color: _getAvatarColor(item.approvalStatus),
shape: BoxShape.circle,
),
child: Center(
child: Text(
getText(item.approvalStatus),
style: TextStyle(
fontSize: 15,
fontFamily: "Plus Jakarta Sans",
fontWeight: FontWeight.w500,
color: _getAvatarTxtColor(item.approvalStatus),
), ),
], ),
), ),
),
bottomNavigationBar: Container( const SizedBox(width: 12),
padding: const EdgeInsets.symmetric(horizontal: 18, vertical: 10), Expanded(
color: Colors.white, child: Column(
child: ElevatedButton( crossAxisAlignment: CrossAxisAlignment.start,
style: ElevatedButton.styleFrom( children: [
backgroundColor: const Color(0xff1487c9), // App blue Text(
shape: RoundedRectangleBorder( item.placeOfVisit ?? "-",
borderRadius: BorderRadius.circular(15), maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontFamily: "JakartaRegular",
fontSize: 14,
color: AppColors.semi_black,
), ),
padding: const EdgeInsets.symmetric(vertical: 14),
elevation: 0, // Optional: remove shadow
), ),
onPressed: () { Text(
HapticFeedback.selectionClick(); item.appliedDate ?? "-",
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const AddBillScreen(pageTitleName: "Add Bill"),
settings: const RouteSettings(name: 'AddTourExpBillScreen'),
),
).then((_) {
provider.fetchTourExpenses(context, "1");
});
},
child: const Text(
"Add Bill",
style: TextStyle( style: TextStyle(
fontSize: 16, fontFamily: "JakartaRegular",
fontFamily: "JakartaMedium", fontSize: 14,
fontWeight: FontWeight.w500, color: AppColors.grey_semi,
color: Colors.white,
), ),
), ),
), ],
), ),
),
Text(
"₹${item.appliedAmount ?? '0'}",
style: const TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: Color(0xff1487c9),
),
),
],
),
),
);
}
// /// Bottom Add Bill Button Widget _buildBottomBar(BuildContext context) {
// bottomNavigationBar: Container( return Container(
// padding: const EdgeInsets.all(18), padding: const EdgeInsets.symmetric(horizontal: 18, vertical: 10),
// color: Colors.white, color: Colors.white,
// child: ElevatedButton( child: ElevatedButton(
// style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
// backgroundColor: Color(0xff1487c9), backgroundColor: const Color(0xff1487c9),
// shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(15), borderRadius: BorderRadius.circular(15),
// ), ),
// padding: const EdgeInsets.symmetric(vertical: 14), padding: const EdgeInsets.symmetric(vertical: 14),
// ), elevation: 0,
// onPressed: () { ),
// // to work onPressed: () {
// }, HapticFeedback.selectionClick();
// child: const Text( Navigator.push(
// "Add Bill", context,
// style: TextStyle( MaterialPageRoute(
// fontSize: 16, builder: (context) =>
// fontFamily: "Plus Jakarta Sans", const AddBillScreen(pageTitleName: "Add Bill"),
// fontWeight: FontWeight.w500, settings: const RouteSettings(name: 'AddTourExpBillScreen'),
// color: Colors.white, ),
// ), ).then((_) {
// ), _refreshList(context);
// ), });
// ), },
); child: const Text(
}, "Add Bill",
style: TextStyle(
fontSize: 16,
fontFamily: "JakartaMedium",
fontWeight: FontWeight.w500,
color: Colors.white,
),
), ),
), ),
); );
...@@ -260,11 +324,11 @@ class _TourExpensesListScreenState extends State<TourExpensesListScreen> { ...@@ -260,11 +324,11 @@ class _TourExpensesListScreenState extends State<TourExpensesListScreen> {
return AppColors.rejected_text_color; return AppColors.rejected_text_color;
case 'Expired at TL': case 'Expired at TL':
return AppColors.rejected_text_color; return AppColors.rejected_text_color;
} }
return color; return color;
} }
getText(value) {
String getText(value) {
switch (value) { switch (value) {
case 'HR Approved': case 'HR Approved':
return "A"; return "A";
...@@ -278,5 +342,4 @@ class _TourExpensesListScreenState extends State<TourExpensesListScreen> { ...@@ -278,5 +342,4 @@ class _TourExpensesListScreenState extends State<TourExpensesListScreen> {
return "R"; return "R";
} }
} }
}
} \ No newline at end of file
...@@ -36,29 +36,37 @@ class _OrderslistbyModesState extends State<OrderslistbyModes> { ...@@ -36,29 +36,37 @@ class _OrderslistbyModesState extends State<OrderslistbyModes> {
Map _source = {ConnectivityResult.mobile: true}; Map _source = {ConnectivityResult.mobile: true};
final MyConnectivity _connectivity = MyConnectivity.instance; final MyConnectivity _connectivity = MyConnectivity.instance;
final ScrollController _scrollController = ScrollController();
@override @override
void initState() { void initState() {
// TODO: implement initState
super.initState(); super.initState();
_connectivity.initialise(); _connectivity.initialise();
_connectivity.myStream.listen((source) { _connectivity.myStream.listen((source) {
setState(() => _source = source); setState(() => _source = source);
}); });
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
var provider = Provider.of<Pagesdashboardprovider>( WidgetsBinding.instance.addPostFrameCallback((_) {
context, final provider = Provider.of<Pagesdashboardprovider>(context, listen: false);
listen: false, provider.resetPagination();
);
provider.ordersListByModeFilterAPIFunction(context, widget.mode); provider.ordersListByModeFilterAPIFunction(context, widget.mode);
provider.ordersListByModeAPIFunction(context, widget.mode, "", ""); provider.ordersListByModeAPIFunction(context, widget.mode, "", "");
}); });
_scrollController.addListener(() {
if (_scrollController.position.pixels >=
_scrollController.position.maxScrollExtent - 200) {
final provider = Provider.of<Pagesdashboardprovider>(context, listen: false);
provider.loadMore(context, widget.mode, "", "");
}
});
} }
@override @override
void dispose() { void dispose() {
// TODO: implement dispose _scrollController.dispose();
super.dispose();
_connectivity.disposeStream(); _connectivity.disposeStream();
super.dispose();
} }
Color getDecorationColor(value) { Color getDecorationColor(value) {
...@@ -212,467 +220,183 @@ class _OrderslistbyModesState extends State<OrderslistbyModes> { ...@@ -212,467 +220,183 @@ class _OrderslistbyModesState extends State<OrderslistbyModes> {
0xFFFFFFFF, 0xFFFFFFFF,
), ),
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
body: body: provider.isLoading && ordersList.isEmpty
provider.isLoading ? Center(
? Center( child: CircularProgressIndicator.adaptive(
child: CircularProgressIndicator.adaptive( valueColor: AlwaysStoppedAnimation<Color>(AppColors.app_blue),
valueColor: AlwaysStoppedAnimation<Color>( ),
AppColors.app_blue, )
: ordersList.isNotEmpty
? RefreshIndicator(
onRefresh: () async {
provider.resetPagination();
await provider.ordersListByModeAPIFunction(
context,
widget.mode,
"",
"",
);
},
child: ListView.builder(
controller: _scrollController,
itemCount: ordersList.length + (provider.hasMoreData ? 1 : 0),
itemBuilder: (context, ol) {
if (ol == ordersList.length) {
return provider.isLoadingMore
? const Padding(
padding: EdgeInsets.all(16),
child: Center(child: CircularProgressIndicator()),
)
: const SizedBox.shrink();
}
final order = ordersList[ol];
return InkResponse(
onTap: () async {
var res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => Ordersdetailsbymodes(
pageTitleName: widget.pageTitleName,
orderId: ordersList[ol].orderId,
mode: widget.mode,
),
settings: RouteSettings(name: "Ordersdetailsbymodes")
), ),
);
if (routeSettingName == "Ordersdetailsbymodes") {
provider.ordersListByModeFilterAPIFunction(
context,
widget.mode,
);
provider.ordersListByModeAPIFunction(
context,
widget.mode,
"",
"",
);
}
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 7.5,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
), ),
)
: ordersList.isNotEmpty
? SingleChildScrollView(
child: Column( child: Column(
children: [ children: [
ListView.builder( Row(
itemCount: ordersList.length, children: [
shrinkWrap: true, Expanded(
physics: NeverScrollableScrollPhysics(), flex: 1,
itemBuilder: (context, ol) {
if (ordersList.isEmpty) {
return SizedBox(
child: Center(child: Text("No Data Available")),
);
}
return InkResponse(
onTap: () async {
var res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => Ordersdetailsbymodes(
pageTitleName: widget.pageTitleName,
orderId: ordersList[ol].orderId,
mode: widget.mode,
),
settings: RouteSettings(name: "Ordersdetailsbymodes")
),
);
if (routeSettingName == "Ordersdetailsbymodes") {
provider.ordersListByModeFilterAPIFunction(
context,
widget.mode,
);
provider.ordersListByModeAPIFunction(
context,
widget.mode,
"",
"",
);
}
},
child: Container( child: Container(
padding: EdgeInsets.symmetric( height: 50,
horizontal: 10, width: 50,
vertical: 7.5, padding: EdgeInsets.all(8.0),
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: getDecorationColor(
borderRadius: BorderRadius.circular(16), ordersList[ol].status,
),
shape: BoxShape.circle,
), ),
child: Column( child: Center(
children: [ child: Text(
Row( getText(
children: [ ordersList[ol].status,
// Expanded(
// flex: 1,
// child: Container(
// height: 50,
// width: 35,
// padding: EdgeInsets.all(8.0),
// decoration: BoxDecoration(
// color: Color(0xFFFFF3CE),
// borderRadius: BorderRadius.circular(
// 8,
// ),
// ),
// child: SvgPicture.asset(
// "assets/svg/fin_ic.svg",
// ),
// ),
// ),
Expanded(
flex: 1,
child: Container(
height: 50,
width: 50,
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: getDecorationColor(
ordersList[ol].status,
),
shape: BoxShape.circle,
),
child: Center(
child: Text(
getText(
ordersList[ol].status,
),
style: TextStyle(
color: getTextColor(
ordersList[ol].status,
),
fontSize: getSize(
ordersList[ol].status,
),
fontFamily: "JakartaBold",
),
),
),
),
),
SizedBox(width: 10),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
ordersList[ol]
.accountName!,
maxLines: 1,
overflow:
TextOverflow.ellipsis,
style: TextStyle(
fontFamily:
"JakartaRegular",
fontSize: 14,
color: AppColors.semi_black,
),
),
Text(
ordersList[ol]
.orderNumber!,
style: TextStyle(
fontSize: 14,
color: AppColors.grey_semi,
fontFamily:
"JakartaRegular",
decoration:
TextDecoration.none,
decorationColor:
AppColors.white,
),
),
],
),
),
),
SizedBox(width: 10),
Expanded(
flex: 2,
child: Container(
child: Text(
"₹"
"${ordersList[ol].balanceAmount}",
textAlign: TextAlign.right,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
),
),
],
), ),
], style: TextStyle(
), color: getTextColor(
), ordersList[ol].status,
);
},
),
],
),
)
: Emptywidget(context),
);
},
);
}
Widget _scaffold1(BuildContext context) {
return Consumer<Pagesdashboardprovider>(
builder: (context, provider, child) {
final ordersList = provider.ordersList;
return Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar2(
context,
widget.pageTitleName,
provider.resetAll,
Row(
children: [
// InkResponse(
// onTap: () {
// _showOptionsSheet(context);
// },
// child: SvgPicture.asset("assets/svg/ic_download.svg"),
// ),
InkResponse(
onTap: () async {
_showFilterSheet(context);
},
child: SvgPicture.asset(
"assets/svg/filter_ic.svg",
height: 25,
),
),
],
),
),
backgroundColor: AppColors.scaffold_bg_color,
body:
provider.isLoading
? Center(
child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue,
),
),
)
: ordersList.isNotEmpty
? SingleChildScrollView(
child: Column(
children: [
ListView.builder(
itemCount: ordersList.length,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
if (ordersList.isEmpty) {
return SizedBox(
child: Center(child: Text("No Data Available")),
);
}
return Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
children: [
Row(
children: [
Expanded(
flex: 1,
child: Container(
height: 50,
width: 35,
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Color(0xFFFFF3CE),
borderRadius: BorderRadius.circular(
8,
),
),
child: SvgPicture.asset(
"assets/svg/fin_ic.svg",
),
),
), ),
SizedBox(width: 10), fontSize: getSize(
Expanded( ordersList[ol].status,
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
ordersList[index].accountName!,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
),
),
Text(
"₹"
"${ordersList[index].balanceAmount}",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
],
),
),
),
Expanded(
flex: 2,
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 5,
vertical: 10,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(
8,
),
color: Color(0xFFE3FFE0),
),
child: Center(
child: Text(
ordersList[index].status!,
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: Color(0xFF0D9C00),
),
),
),
),
), ),
], fontFamily: "JakartaBold",
), ),
Divider(
thickness: 0.5,
color: Color(0xFFD7D7D7),
), ),
...List.generate(5, (j) { ),
final headings = [ ),
"Order Number", ),
"Entered Employee", SizedBox(width: 10),
"Sales Person", Expanded(
// "Date", flex: 4,
"Paid Amount", child: SizedBox(
"Balance Amount", child: Column(
]; crossAxisAlignment:
CrossAxisAlignment.start,
final subHeadings = [ children: [
ordersList[index].orderNumber, Text(
ordersList[index].enteredEmpName, ordersList[ol]
ordersList[index].salesPersonEmpName, .accountName!,
// ordersList[index].createdDatetime, maxLines: 1,
ordersList[index].paidAmount, overflow:
ordersList[index].balanceAmount, TextOverflow.ellipsis,
]; style: TextStyle(
return Container( fontFamily:
padding: EdgeInsets.symmetric( "JakartaRegular",
vertical: 5, fontSize: 14,
), color: AppColors.semi_black,
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
headings[j],
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
),
),
),
Expanded(
child: InkResponse(
child: Text(
subHeadings[j]!,
style: TextStyle(
fontSize: 14,
color: Color(0xFF818181),
decoration:
TextDecoration.none,
decorationColor:
AppColors.white,
),
),
),
),
],
),
);
}),
InkResponse(
onTap: () async {
var res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => Ordersdetailsbymodes(
pageTitleName:
widget.pageTitleName,
orderId:
ordersList[index].orderId,
mode: widget.mode,
),
),
);
if (res == true) {
provider
.ordersListByModeFilterAPIFunction(
context,
widget.mode,
);
provider.ordersListByModeAPIFunction(
context,
widget.mode,
"",
"",
);
}
},
child: Container(
padding: EdgeInsets.symmetric(
vertical: 5,
), ),
child: Row( ),
crossAxisAlignment: Text(
CrossAxisAlignment.center, ordersList[ol]
mainAxisAlignment: .orderNumber!,
MainAxisAlignment.start, style: TextStyle(
children: [ fontSize: 14,
Text( color: AppColors.grey_semi,
"View Details", fontFamily:
style: TextStyle( "JakartaRegular",
fontFamily: "JakartaMedium", decoration:
fontSize: 14, TextDecoration.none,
color: AppColors.app_blue, decorationColor:
), AppColors.white,
),
SizedBox(width: 5),
SvgPicture.asset(
"assets/svg/next_button.svg",
),
],
), ),
), ),
],
),
),
),
SizedBox(width: 10),
Expanded(
flex: 3,
child: Container(
child: Text(
"₹"
"${ordersList[ol].balanceAmount}",
textAlign: TextAlign.right,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
), ),
], ),
), ),
); ),
}, ],
), ),
], ],
), ),
) ),
: Emptywidget(context), );
},
),
)
: Emptywidget(context),
); );
}, },
); );
} }
Future<void> _showOptionsSheet(BuildContext context) { Future<void> _showOptionsSheet(BuildContext context) {
return showModalBottomSheet( return showModalBottomSheet(
useSafeArea: true, useSafeArea: true,
...@@ -943,8 +667,8 @@ class _OrderslistbyModesState extends State<OrderslistbyModes> { ...@@ -943,8 +667,8 @@ class _OrderslistbyModesState extends State<OrderslistbyModes> {
provider.ordersListByModeAPIFunction( provider.ordersListByModeAPIFunction(
context, context,
widget.mode, widget.mode,
provider.selectedEmpID, provider.selectedEmpID.toString(),
provider.selectedLeadType, provider.selectedLeadType.toString(),
); );
}, },
child: Container( child: Container(
......
...@@ -117,30 +117,37 @@ class _PaymentlistsbymodeState extends State<Paymentlistsbymode> { ...@@ -117,30 +117,37 @@ class _PaymentlistsbymodeState extends State<Paymentlistsbymode> {
} }
return 18.0; return 18.0;
} }
final ScrollController _scrollController = ScrollController();
@override @override
void initState() { void initState() {
// TODO: implement initState
super.initState(); super.initState();
_connectivity.initialise(); _connectivity.initialise();
_connectivity.myStream.listen((source) { _connectivity.myStream.listen((source) {
setState(() => _source = source); setState(() => _source = source);
}); });
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
var provider = Provider.of<Paymentsprovider>( WidgetsBinding.instance.addPostFrameCallback((_) {
context, final provider = Provider.of<Paymentsprovider>(context, listen: false);
listen: false, provider.resetPagination();
);
provider.paymentsListsByModeFilterAPIFunction(context, widget.mode); provider.paymentsListsByModeFilterAPIFunction(context, widget.mode);
provider.paymentsListsByModeAPIFunction(context, widget.mode, "",); provider.paymentsListsByModeAPIFunction(context, widget.mode, "");
});
_scrollController.addListener(() {
if (_scrollController.position.pixels >=
_scrollController.position.maxScrollExtent - 200) {
final provider = Provider.of<Paymentsprovider>(context, listen: false);
provider.loadMore(context, widget.mode, "");
}
}); });
} }
@override @override
void dispose() { void dispose() {
// TODO: implement dispose _scrollController.dispose();
super.dispose();
_connectivity.disposeStream(); _connectivity.disposeStream();
super.dispose();
} }
@override @override
...@@ -207,169 +214,162 @@ class _PaymentlistsbymodeState extends State<Paymentlistsbymode> { ...@@ -207,169 +214,162 @@ class _PaymentlistsbymodeState extends State<Paymentlistsbymode> {
0xFFFFFFFF 0xFFFFFFFF
), ),
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
body: body: provider.isLoading && paymentLists.isEmpty
provider.isLoading ? Center(
? Center(child: CircularProgressIndicator.adaptive( child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>( valueColor: AlwaysStoppedAnimation<Color>(AppColors.app_blue),
AppColors.app_blue) ),
)) )
: paymentLists.isNotEmpty ? SingleChildScrollView( : paymentLists.isNotEmpty
child: Column( ? RefreshIndicator(
children: [ onRefresh: () async {
ListView.builder( provider.resetPagination();
itemCount: paymentLists.length, await provider.paymentsListsByModeAPIFunction(
shrinkWrap: true, context,
physics: NeverScrollableScrollPhysics(), widget.mode,
itemBuilder: (context, index) { "",
if (paymentLists.isEmpty) { );
return SizedBox( },
child: Center( child: ListView.builder(
child: Text("No Data Available"), controller: _scrollController,
), itemCount: paymentLists.length + (provider.hasMoreData ? 1 : 0),
); itemBuilder: (context, index) {
} if (index == paymentLists.length) {
return InkResponse( return provider.isLoadingMore
onTap: () async { ? const Padding(
Navigator.push(context, MaterialPageRoute( padding: EdgeInsets.all(16),
builder: (context) => child: Center(child: CircularProgressIndicator()),
Paymentdetailsbymode(mode: widget.mode, )
pageTitleName: widget.pageTitleName, : const SizedBox.shrink();
paymentId: paymentLists[index].paymentId, }
),));
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 7.5,
vertical: 5,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
final payment = paymentLists[index];
return InkResponse(
onTap: () async {
Navigator.push(context, MaterialPageRoute(
builder: (context) =>
Paymentdetailsbymode(mode: widget.mode,
pageTitleName: widget.pageTitleName,
paymentId: paymentLists[index].paymentId,
),));
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 7.5,
vertical: 5,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
children: [
Row(
children: [ children: [
Row(
children: [ Expanded(
// Expanded( flex: 1,
// flex: 1, child: Container(
// child: Container( height: 50,
// height: 50, width: 50,
// width: 35, padding: EdgeInsets.all(8.0),
// padding: EdgeInsets.all(8.0), decoration: BoxDecoration(
// decoration: BoxDecoration( color: getDecorationColor(
// color: Color(0xFFFFF3CE), paymentLists[index].status,
// borderRadius: ),
// BorderRadius.circular(8), shape: BoxShape.circle,
// ), ),
// child: SvgPicture.asset( child: Center(
// "assets/svg/fin_ic.svg", child: Text(
// ), getText(
// ), paymentLists[index].status,
// ), ),
Expanded( style: TextStyle(
flex: 1, color: getTextColor(
child: Container(
height: 50,
width: 50,
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: getDecorationColor(
paymentLists[index].status, paymentLists[index].status,
), ),
shape: BoxShape.circle, fontSize: getSize(
), paymentLists[index].status,
child: Center(
child: Text(
getText(
paymentLists[index].status,
),
style: TextStyle(
color: getTextColor(
paymentLists[index].status,
),
fontSize: getSize(
paymentLists[index].status,
),
fontFamily: "JakartaBold",
),
), ),
fontFamily: "JakartaBold",
), ),
), ),
), ),
SizedBox(width: 10), ),
SizedBox(width: 10), ),
Expanded( SizedBox(width: 10),
flex: 4, SizedBox(width: 10),
child: SizedBox( Expanded(
child: Column( flex: 4,
crossAxisAlignment: child: SizedBox(
CrossAxisAlignment.start, child: Column(
children: [ crossAxisAlignment:
Text( CrossAxisAlignment.start,
paymentLists[index].ename!, children: [
style: TextStyle( Text(
fontFamily: paymentLists[index].ename!,
"JakartaMedium", style: TextStyle(
fontSize: 14, fontFamily:
color: "JakartaMedium",
AppColors.semi_black, fontSize: 14,
), color:
), AppColors.semi_black,
Text( ),
paymentLists[index]
.orderNumber??"-",
style: TextStyle(
fontSize: 14,
color: AppColors.grey_semi,
fontFamily:
"JakartaRegular",
decoration:
TextDecoration.none,
decorationColor:
AppColors.white,
),
),
],
), ),
), Text(
), paymentLists[index]
Expanded( .orderNumber??"-",
flex: 2, style: TextStyle(
child: Container( fontSize: 14,
color: AppColors.grey_semi,
child: Center( fontFamily:
child: Text( "JakartaRegular",
"₹" decoration:
"${paymentLists[index].amount}", TextDecoration.none,
textAlign: TextAlign.right, decorationColor:
style: TextStyle( AppColors.white,
fontFamily:
"JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
), ),
), ),
),
],
), ),
], ),
), ),
Expanded(
flex: 2,
child: Container(
child: Center(
child: Text(
"₹"
"${paymentLists[index].amount}",
textAlign: TextAlign.right,
style: TextStyle(
fontFamily:
"JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
),
),
),
], ],
), ),
),
); ],
}, ),
), ),
], );
},
), ),
) : Emptywidget(context), )
: Emptywidget(context),
); );
}, },
); );
...@@ -844,7 +844,7 @@ class _PaymentlistsbymodeState extends State<Paymentlistsbymode> { ...@@ -844,7 +844,7 @@ class _PaymentlistsbymodeState extends State<Paymentlistsbymode> {
onTap: () { onTap: () {
Navigator.pop(context); Navigator.pop(context);
provider.paymentsListsByModeAPIFunction( provider.paymentsListsByModeAPIFunction(
context, widget.mode, provider.selectedEmpID); context, widget.mode, provider.selectedEmpID.toString());
}, },
child: Container( child: Container(
height: 45, height: 45,
......
...@@ -27,31 +27,38 @@ class _TpcagentissuelistState extends State<Tpcagentissuelist> { ...@@ -27,31 +27,38 @@ class _TpcagentissuelistState extends State<Tpcagentissuelist> {
Map _source = {ConnectivityResult.mobile: true}; Map _source = {ConnectivityResult.mobile: true};
final MyConnectivity _connectivity = MyConnectivity.instance; final MyConnectivity _connectivity = MyConnectivity.instance;
final ScrollController _scrollController = ScrollController();
@override @override
void initState() { void initState() {
// TODO: implement initState
super.initState(); super.initState();
_connectivity.initialise(); _connectivity.initialise();
_connectivity.myStream.listen((source) { _connectivity.myStream.listen((source) {
setState(() => _source = source); setState(() => _source = source);
}); });
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
var provider = Provider.of<Tpcagentsprovider>(
context,
listen: false,
);
WidgetsBinding.instance.addPostFrameCallback((_) {
final provider = Provider.of<Tpcagentsprovider>(context, listen: false);
provider.resetPagination(); // clear before first load
provider.TPCAgentsIssueListAPIFunction(context); provider.TPCAgentsIssueListAPIFunction(context);
}); });
_scrollController.addListener(() {
if (_scrollController.position.pixels >=
_scrollController.position.maxScrollExtent - 200) {
final provider = Provider.of<Tpcagentsprovider>(context, listen: false);
provider.loadMoreIssues(context);
}
});
} }
@override @override
void dispose() { void dispose() {
// TODO: implement dispose _scrollController.dispose();
super.dispose();
_connectivity.disposeStream(); _connectivity.disposeStream();
super.dispose();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
switch (_source.keys.toList()[0]) { switch (_source.keys.toList()[0]) {
...@@ -108,134 +115,141 @@ class _TpcagentissuelistState extends State<Tpcagentissuelist> { ...@@ -108,134 +115,141 @@ class _TpcagentissuelistState extends State<Tpcagentissuelist> {
0xFFFFFFFF 0xFFFFFFFF
), ),
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
body: body: provider.isLoading && tpcAgentsIssueList.isEmpty
provider.isLoading ? Center(
? Center(child: CircularProgressIndicator.adaptive( child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>( valueColor:
AppColors.app_blue) AlwaysStoppedAnimation<Color>(AppColors.app_blue),
)) ),
: tpcAgentsIssueList.isNotEmpty ? SingleChildScrollView( )
child: Column( : tpcAgentsIssueList.isNotEmpty
children: [ ? RefreshIndicator(
ListView.builder( onRefresh: () async {
itemCount: tpcAgentsIssueList.length, provider.resetPagination();
shrinkWrap: true, await provider.TPCAgentsIssueListAPIFunction(context);
physics: NeverScrollableScrollPhysics(), },
itemBuilder: (context, index) { child: ListView.builder(
if (tpcAgentsIssueList.isEmpty) { controller: _scrollController,
return SizedBox( itemCount: tpcAgentsIssueList.length +
child: Center( (provider.hasMoreData ? 1 : 0),
child: Text("No Data Available"), itemBuilder: (context, index) {
), if (index == tpcAgentsIssueList.length) {
); return provider.isLoadingMore
} ? const Padding(
return InkResponse( padding: EdgeInsets.all(16),
onTap: () async { child: Center(
Navigator.push( child: CircularProgressIndicator()),
context, )
MaterialPageRoute( : const SizedBox.shrink();
builder: }
(context) =>
Tpcagentissuelistdetails( final issue = tpcAgentsIssueList[index];
pageTitleName: "CRM Order Details", return InkResponse(
mode: widget.mode, onTap: () async {
orderId: tpcAgentsIssueList[index].orderId, Navigator.push(
), context,
), MaterialPageRoute(
); builder:
}, (context) =>
child: Container( Tpcagentissuelistdetails(
padding: EdgeInsets.symmetric( pageTitleName: "CRM Order Details",
horizontal: 7.5, mode: widget.mode,
vertical: 5, orderId: tpcAgentsIssueList[index].orderId,
), ),
margin: EdgeInsets.symmetric( ),
horizontal: 10, );
vertical: 5, },
), child: Container(
decoration: BoxDecoration( padding: EdgeInsets.symmetric(
color: Colors.white, horizontal: 7.5,
borderRadius: BorderRadius.circular(16), vertical: 5,
), ),
child: Column( margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
children: [
Row(
children: [ children: [
Row( Expanded(
children: [ flex: 1,
Expanded( child: Container(
flex: 1, height: 50,
child: Container( width: 35,
height: 50,
width: 35,
child: SvgPicture.asset( child: SvgPicture.asset(
"assets/svg/order/tpc_list_ic.svg", "assets/svg/order/tpc_list_ic.svg",
),
),
), ),
SizedBox(width: 10), ),
Expanded( ),
flex: 4, SizedBox(width: 10),
child: SizedBox( Expanded(
child: Column( flex: 4,
crossAxisAlignment: child: SizedBox(
CrossAxisAlignment.start, child: Column(
children: [ crossAxisAlignment:
Text( CrossAxisAlignment.start,
tpcAgentsIssueList[index].name!, children: [
style: TextStyle( Text(
fontFamily: tpcAgentsIssueList[index].name!,
"JakartaRegular", style: TextStyle(
fontSize: 14, fontFamily:
color: "JakartaRegular",
AppColors.semi_black, fontSize: 14,
), color:
), AppColors.semi_black,
Text( ),
"${tpcAgentsIssueList[index].aname}",
style: TextStyle(
fontFamily:
"JakartaRegular",
fontSize: 14,
color: AppColors.grey_semi,
),
),
],
), ),
), Text(
),
SizedBox(width: 10), "${tpcAgentsIssueList[index].aname}",
Expanded( style: TextStyle(
flex: 1, fontFamily:
child: InkResponse( "JakartaRegular",
onTap: () { fontSize: 14,
launch( color: AppColors.grey_semi,
'tel://${tpcAgentsIssueList[index]
.mobileNumber}',
);
},
child: SizedBox(
height: 35,
width: 35,
child: SvgPicture.asset(
"assets/svg/crm/lead_list_call_ic.svg",
), ),
), ),
],
),
),
),
SizedBox(width: 10),
Expanded(
flex: 1,
child: InkResponse(
onTap: () {
launch(
'tel://${tpcAgentsIssueList[index]
.mobileNumber}',
);
},
child: SizedBox(
height: 35,
width: 35,
child: SvgPicture.asset(
"assets/svg/crm/lead_list_call_ic.svg",
), ),
), ),
], ),
), ),
], ],
), ),
),
);
}, ],
), ),
], ),
);
},
), ),
) : Emptywidget(context), )
: Emptywidget(context),
); );
}, },
); );
......
...@@ -27,30 +27,36 @@ class Tpcagentlistbymode extends StatefulWidget { ...@@ -27,30 +27,36 @@ class Tpcagentlistbymode extends StatefulWidget {
class _TpcagentlistbymodeState extends State<Tpcagentlistbymode> { class _TpcagentlistbymodeState extends State<Tpcagentlistbymode> {
Map _source = {ConnectivityResult.mobile: true}; Map _source = {ConnectivityResult.mobile: true};
final MyConnectivity _connectivity = MyConnectivity.instance; final MyConnectivity _connectivity = MyConnectivity.instance;
final ScrollController _scrollController = ScrollController();
@override @override
void initState() { void initState() {
// TODO: implement initState
super.initState(); super.initState();
_connectivity.initialise(); _connectivity.initialise();
_connectivity.myStream.listen((source) { _connectivity.myStream.listen((source) {
setState(() => _source = source); setState(() => _source = source);
}); });
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
var provider = Provider.of<Tpcagentsprovider>(
context,
listen: false,
);
WidgetsBinding.instance.addPostFrameCallback((_) {
final provider = Provider.of<Tpcagentsprovider>(context, listen: false);
provider.resetPagination();
provider.TPCAgentsListAPIFunction(context, widget.mode); provider.TPCAgentsListAPIFunction(context, widget.mode);
}); });
_scrollController.addListener(() {
if (_scrollController.position.pixels >=
_scrollController.position.maxScrollExtent - 200) {
final provider = Provider.of<Tpcagentsprovider>(context, listen: false);
provider.loadMore(context, widget.mode);
}
});
} }
@override @override
void dispose() { void dispose() {
// TODO: implement dispose _scrollController.dispose();
super.dispose();
_connectivity.disposeStream(); _connectivity.disposeStream();
super.dispose();
} }
...@@ -110,138 +116,148 @@ class _TpcagentlistbymodeState extends State<Tpcagentlistbymode> { ...@@ -110,138 +116,148 @@ class _TpcagentlistbymodeState extends State<Tpcagentlistbymode> {
0xFFFFFFFF 0xFFFFFFFF
), ),
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
body: body: provider.isLoading && tpcAgentsLists.isEmpty
provider.isLoading ? Center(
? Center(child: CircularProgressIndicator.adaptive( child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>( valueColor:
AppColors.app_blue) AlwaysStoppedAnimation<Color>(AppColors.app_blue),
)) ),
: tpcAgentsLists.isNotEmpty ? SingleChildScrollView( )
child: Column( : tpcAgentsLists.isNotEmpty
children: [ ? RefreshIndicator(
ListView.builder( onRefresh: () async {
itemCount: tpcAgentsLists.length, provider.resetPagination();
shrinkWrap: true, await provider.TPCAgentsListAPIFunction(
physics: NeverScrollableScrollPhysics(), context,
itemBuilder: (context, index) { widget.mode,
if (tpcAgentsLists.isEmpty) { );
return SizedBox( },
child: Center( child: ListView.builder(
child: Text("No Data Available"), controller: _scrollController,
), itemCount: tpcAgentsLists.length +
); (provider.hasMoreData ? 1 : 0),
} itemBuilder: (context, index) {
return InkResponse( if (index == tpcAgentsLists.length) {
onTap: () async { return provider.isLoadingMore
Navigator.push(context, MaterialPageRoute( ? const Padding(
builder: (context) => padding: EdgeInsets.all(16),
Tpcagentdetailsbymode(mode: widget.mode, child: Center(
pageTitleName: widget.pageTitleName, child: CircularProgressIndicator()),
tpcAgentId: tpcAgentsLists[index] )
.tpcAgentId, : const SizedBox.shrink();
),)); }
},
child: Container( final agent = tpcAgentsLists[index];
padding: EdgeInsets.symmetric( return InkResponse(
horizontal: 7.5, onTap: () async {
vertical: 5, Navigator.push(context, MaterialPageRoute(
), builder: (context) =>
margin: EdgeInsets.symmetric( Tpcagentdetailsbymode(mode: widget.mode,
horizontal: 10, pageTitleName: widget.pageTitleName,
vertical: 5, tpcAgentId: tpcAgentsLists[index]
), .tpcAgentId,
decoration: BoxDecoration( ),));
color: Colors.white, },
borderRadius: BorderRadius.circular(16), child: Container(
), padding: EdgeInsets.symmetric(
child: Column( horizontal: 7.5,
vertical: 5,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
children: [
Row(
children: [ children: [
Row( Expanded(
children: [ flex: 1,
Expanded( child: Container(
flex: 1, height: 50,
child: Container( width: 35,
height: 50,
width: 35, // decoration: BoxDecoration(
// color: Color(0xFFEAF7FF),
// decoration: BoxDecoration( // borderRadius:
// color: Color(0xFFEAF7FF), // BorderRadius.circular(8),
// borderRadius: // ),
// BorderRadius.circular(8), child: SvgPicture.asset(
// ), "assets/svg/order/tpc_list_ic.svg",
child: SvgPicture.asset(
"assets/svg/order/tpc_list_ic.svg",
),
),
), ),
SizedBox(width: 10), ),
Expanded( ),
flex: 5, SizedBox(width: 10),
child: SizedBox( Expanded(
child: Column( flex: 5,
crossAxisAlignment: child: SizedBox(
CrossAxisAlignment.start, child: Column(
children: [ crossAxisAlignment:
Text( CrossAxisAlignment.start,
tpcAgentsLists[index].name!, children: [
maxLines: 1, Text(
overflow: TextOverflow.ellipsis, tpcAgentsLists[index].name!,
style: TextStyle( maxLines: 1,
fontFamily: overflow: TextOverflow.ellipsis,
"JakartaRegular", style: TextStyle(
fontSize: 14, fontFamily:
color: "JakartaRegular",
AppColors.semi_black, fontSize: 14,
), color:
), AppColors.semi_black,
Text( ),
"${tpcAgentsLists[index]
.mobileNumber}",
style: TextStyle(
fontFamily:
"JakartaRegular",
fontSize: 14,
color: AppColors.grey_semi,
),
),
],
), ),
), Text(
),
SizedBox(width: 10), "${tpcAgentsLists[index]
Expanded( .mobileNumber}",
flex: 1, style: TextStyle(
child: InkResponse( fontFamily:
onTap: () { "JakartaRegular",
launch( fontSize: 14,
'tel://${tpcAgentsLists[index] color: AppColors.grey_semi,
.mobileNumber}',
);
},
child: SizedBox(
height: 35,
width: 35,
child: SvgPicture.asset(
"assets/svg/crm/lead_list_call_ic.svg",
), ),
), ),
],
),
),
),
SizedBox(width: 10),
Expanded(
flex: 1,
child: InkResponse(
onTap: () {
launch(
'tel://${tpcAgentsLists[index]
.mobileNumber}',
);
},
child: SizedBox(
height: 35,
width: 35,
child: SvgPicture.asset(
"assets/svg/crm/lead_list_call_ic.svg",
), ),
), ),
),
],
), ),
], ],
), ),
),
);
}, ],
), ),
], ),
);
},
), ),
) : Emptywidget(context), )
: Emptywidget(context),
); );
}, },
); );
......
...@@ -143,19 +143,19 @@ class ApiCalling { ...@@ -143,19 +143,19 @@ class ApiCalling {
var directory = ""; var directory = "";
if (Platform.isAndroid) { if (Platform.isAndroid) {
directory = "/storage/emulated/0/Download"; directory = "/storage/emulated/0/Download";
var _directory = Directory(directory); var directory0 = Directory(directory);
if (!_directory.existsSync()) { if (!directory0.existsSync()) {
// If the directory does not exist, create it // If the directory does not exist, create it
_directory.createSync(recursive: true); directory0.createSync(recursive: true);
debugPrint('Directory created: $_directory'); debugPrint('Directory created: $directory0');
} else { } else {
debugPrint('Directory already exists: $_directory'); debugPrint('Directory already exists: $directory0');
} }
// final androiddirectory = await getDownloadsDirectory(); // final androiddirectory = await getDownloadsDirectory();
// directory = androiddirectory!.path; // directory = androiddirectory!.path;
} else if (Platform.isIOS) { } else if (Platform.isIOS) {
final iosDirectory = await getApplicationSupportDirectory(); final iosDirectory = await getApplicationSupportDirectory();
directory = iosDirectory!.path; directory = iosDirectory.path;
} }
final contentDisposition = res.headers['content-disposition']; final contentDisposition = res.headers['content-disposition'];
...@@ -175,7 +175,7 @@ class ApiCalling { ...@@ -175,7 +175,7 @@ class ApiCalling {
await file.writeAsBytes(bytes); await file.writeAsBytes(bytes);
toast( toast(
cntxt, cntxt,
"File saved to your downloads as ${filename} to ${directory}, Successfully", "File saved to your downloads as $filename to $directory, Successfully",
); );
debugPrint('File saved successfully'); debugPrint('File saved successfully');
return jsonDecode(res.body); return jsonDecode(res.body);
...@@ -193,12 +193,12 @@ class ApiCalling { ...@@ -193,12 +193,12 @@ class ApiCalling {
try { try {
final response = await post({}, getAppVersionUrl, {}); final response = await post({}, getAppVersionUrl, {});
if (response != null) { if (response != null) {
print("${response.body}"); print(response.body);
return VersionsResponse.fromJson(jsonDecode(response.body)); return VersionsResponse.fromJson(jsonDecode(response.body));
} else { } else {
return null; return null;
} }
} catch (e, s) { } catch (e) {
return null; return null;
} }
} }
...@@ -258,19 +258,19 @@ class ApiCalling { ...@@ -258,19 +258,19 @@ class ApiCalling {
empId, empId,
session, session,
password, password,
conf_password, confPassword,
) 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(),
'password': (password).toString(), 'password': (password).toString(),
'confirm_password': (conf_password).toString(), 'confirm_password': (confPassword).toString(),
}; };
final res = await post(data, updatePasswordUrl, {}); final res = await post(data, updatePasswordUrl, {});
if (res != null) { if (res != null) {
debugPrint("update password ${res.body}"); debugPrint("update password ${res.body}");
debugPrint("update password ${data}"); debugPrint("update password $data");
return UpdatePasswordResponse.fromJson(jsonDecode(res.body)); return UpdatePasswordResponse.fromJson(jsonDecode(res.body));
} else { } else {
debugPrint("Null Response"); debugPrint("Null Response");
...@@ -376,7 +376,7 @@ class ApiCalling { ...@@ -376,7 +376,7 @@ class ApiCalling {
sessioId, sessioId,
location, location,
latlngs, latlngs,
check_in_pic, checkInPic,
) async { ) async {
try { try {
Map<String, String> data = { Map<String, String> data = {
...@@ -387,7 +387,7 @@ class ApiCalling { ...@@ -387,7 +387,7 @@ 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, {}, checkInPic);
res = jsonDecode(res); res = jsonDecode(res);
// } else { // } else {
// // res = await post(data, employeeChekInUrl, {}); // // res = await post(data, employeeChekInUrl, {});
...@@ -410,7 +410,7 @@ class ApiCalling { ...@@ -410,7 +410,7 @@ class ApiCalling {
sessioId, sessioId,
location, location,
latlngs, latlngs,
check_out_pic, checkOutPic,
) async { ) async {
try { try {
Map<String, String> data = { Map<String, String> data = {
...@@ -438,7 +438,7 @@ class ApiCalling { ...@@ -438,7 +438,7 @@ class ApiCalling {
data, data,
{}, {},
employeeCheckOutUrl, employeeCheckOutUrl,
check_out_pic, checkOutPic,
'check_out_pic', 'check_out_pic',
); );
if (res != null) { if (res != null) {
...@@ -529,13 +529,13 @@ class ApiCalling { ...@@ -529,13 +529,13 @@ class ApiCalling {
static Future<loadGeneratorDetailsResponse?> LoadGeneratorDetailsAPI( static Future<loadGeneratorDetailsResponse?> LoadGeneratorDetailsAPI(
empId, empId,
session, session,
gen_hash_id, genHashId,
) 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(),
'gen_hash_id': (gen_hash_id).toString(), 'gen_hash_id': (genHashId).toString(),
}; };
final res = await post(data, genTrackerGeneratorDetailsUrl, {}); final res = await post(data, genTrackerGeneratorDetailsUrl, {});
if (res != null) { if (res != null) {
...@@ -554,15 +554,15 @@ class ApiCalling { ...@@ -554,15 +554,15 @@ class ApiCalling {
static Future<generatorComplaintResponse?> LoadGeneratorComplaintListAPI( static Future<generatorComplaintResponse?> LoadGeneratorComplaintListAPI(
empId, empId,
session, session,
gen_id, genId,
open_status, openStatus,
) 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(),
'gen_id': (gen_id).toString(), 'gen_id': (genId).toString(),
'open_status': (open_status).toString(), 'open_status': (openStatus).toString(),
}; };
final res = await post(data, genTrackerGeneratorComplaintsUrl, {}); final res = await post(data, genTrackerGeneratorComplaintsUrl, {});
if (res != null) { if (res != null) {
...@@ -581,7 +581,7 @@ class ApiCalling { ...@@ -581,7 +581,7 @@ class ApiCalling {
static Future<TagLocationResponse?> TagLocationAPI( static Future<TagLocationResponse?> TagLocationAPI(
empId, empId,
session, session,
gen_hash_id, genHashId,
location, location,
attachment, attachment,
) async { ) async {
...@@ -589,10 +589,10 @@ class ApiCalling { ...@@ -589,10 +589,10 @@ class ApiCalling {
Map<String, String> data = { Map<String, String> data = {
'emp_id': (empId).toString(), 'emp_id': (empId).toString(),
'session_id': (session).toString(), 'session_id': (session).toString(),
'gen_hash_id': (gen_hash_id).toString(), 'gen_hash_id': (genHashId).toString(),
'location': (location).toString(), 'location': (location).toString(),
}; };
print("Tag Loation: ${data}"); print("Tag Loation: $data");
var res; var res;
if (attachment != null) { if (attachment != null) {
res = await postImageNew( res = await postImageNew(
...@@ -623,15 +623,15 @@ class ApiCalling { ...@@ -623,15 +623,15 @@ class ApiCalling {
static Future<TagGeneratorResponse?> TagGeneratorAPI( static Future<TagGeneratorResponse?> TagGeneratorAPI(
empId, empId,
session, session,
gen_hash_id, genHashId,
engine_no, engineNo,
) 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(),
'gen_hash_id': (gen_hash_id).toString(), 'gen_hash_id': (genHashId).toString(),
'engine_no': (engine_no).toString(), 'engine_no': (engineNo).toString(),
}; };
final res = await post(data, genTrackerTagGeneratorUrl, {}); final res = await post(data, genTrackerTagGeneratorUrl, {});
if (res != null) { if (res != null) {
...@@ -650,13 +650,13 @@ class ApiCalling { ...@@ -650,13 +650,13 @@ class ApiCalling {
static Future<TagGeneratorResponse?> TagGeneratorCheckAPI( static Future<TagGeneratorResponse?> TagGeneratorCheckAPI(
empId, empId,
session, session,
gen_hash_id, genHashId,
) 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(),
'gen_hash_id': (gen_hash_id).toString(), 'gen_hash_id': (genHashId).toString(),
}; };
final res = await post(data, genTrackerCheckTagGeneratorUrl, {}); final res = await post(data, genTrackerCheckTagGeneratorUrl, {});
if (res != null) { if (res != null) {
...@@ -675,23 +675,23 @@ class ApiCalling { ...@@ -675,23 +675,23 @@ class ApiCalling {
static Future<SubmitComplaintResponse?> SubmitGeneratorComplaintAPI( static Future<SubmitComplaintResponse?> SubmitGeneratorComplaintAPI(
empId, empId,
session, session,
complaint_type_id, complaintTypeId,
complaint_category_id, complaintCategoryId,
complaint_desc_id, complaintDescId,
running_hrs, runningHrs,
gen_id, genId,
complaint_note, complaintNote,
) 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(),
'complaint_type_id': (complaint_type_id).toString(), 'complaint_type_id': (complaintTypeId).toString(),
'complaint_category_id': (complaint_category_id).toString(), 'complaint_category_id': (complaintCategoryId).toString(),
'complaint_desc_id': (complaint_desc_id).toString(), 'complaint_desc_id': (complaintDescId).toString(),
'running_hrs': (running_hrs).toString(), 'running_hrs': (runningHrs).toString(),
'gen_id': (gen_id).toString(), 'gen_id': (genId).toString(),
'complaint_note': (complaint_note).toString(), 'complaint_note': (complaintNote).toString(),
}; };
final res = await post(data, genTrackerRegisterComplaint, {}); final res = await post(data, genTrackerRegisterComplaint, {});
if (res != null) { if (res != null) {
...@@ -710,13 +710,13 @@ class ApiCalling { ...@@ -710,13 +710,13 @@ class ApiCalling {
static Future<ComplaintsSelectionResponse?> ComplaintSelectionAPI( static Future<ComplaintsSelectionResponse?> ComplaintSelectionAPI(
empId, empId,
session, session,
gen_hash_id, genHashId,
) 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(),
'gen_hash_id': (gen_hash_id).toString(), 'gen_hash_id': (genHashId).toString(),
}; };
final res = await post(data, complaintsSelectionUrl, {}); final res = await post(data, complaintsSelectionUrl, {});
if (res != null) { if (res != null) {
...@@ -737,13 +737,13 @@ class ApiCalling { ...@@ -737,13 +737,13 @@ class ApiCalling {
static Future<Inventory_Part_details_response?> LoadPartDetailsAPI( static Future<Inventory_Part_details_response?> LoadPartDetailsAPI(
empId, empId,
session, session,
part_id, partId,
) 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(),
'part_id': (part_id).toString(), 'part_id': (partId).toString(),
}; };
final res = await post(data, inventoryPartDetailsUrl, {}); final res = await post(data, inventoryPartDetailsUrl, {});
if (res != null) { if (res != null) {
...@@ -764,8 +764,8 @@ class ApiCalling { ...@@ -764,8 +764,8 @@ class ApiCalling {
session, session,
qty, qty,
descr, descr,
part_id, partId,
tran_type, tranType,
) async { ) async {
try { try {
Map<String, String> data = { Map<String, String> data = {
...@@ -773,8 +773,8 @@ class ApiCalling { ...@@ -773,8 +773,8 @@ class ApiCalling {
'session_id': (session).toString(), 'session_id': (session).toString(),
'qty': (qty).toString(), 'qty': (qty).toString(),
'descr': (descr).toString(), 'descr': (descr).toString(),
'product_id': (part_id).toString(), 'product_id': (partId).toString(),
'tran_type': (tran_type).toString(), 'tran_type': (tranType).toString(),
}; };
final res = await post(data, inventoryStockUpdateUrl, {}); final res = await post(data, inventoryStockUpdateUrl, {});
if (res != null) { if (res != null) {
...@@ -793,17 +793,17 @@ class ApiCalling { ...@@ -793,17 +793,17 @@ class ApiCalling {
///technician ///technician
static Future<loadGeneratorDetailsResponse?> static Future<loadGeneratorDetailsResponse?>
LoadTechnicianGeneratorDetailsAPI(empId, session, gen_id) async { LoadTechnicianGeneratorDetailsAPI(empId, session, genId) 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(),
'gen_id': (gen_id).toString(), 'gen_id': (genId).toString(),
}; };
final res = await post(data, technicianGeneratorDetailsUrl, {}); final res = await post(data, technicianGeneratorDetailsUrl, {});
if (res != null) { if (res != null) {
print("genderrails:${jsonDecode(res!.body)}"); print("genderrails:${jsonDecode(res.body)}");
return loadGeneratorDetailsResponse.fromJson(jsonDecode(res.body)); return loadGeneratorDetailsResponse.fromJson(jsonDecode(res.body));
} else { } else {
debugPrint("Null Response"); debugPrint("Null Response");
...@@ -887,7 +887,7 @@ class ApiCalling { ...@@ -887,7 +887,7 @@ class ApiCalling {
static Future<NearbyGeneratorsResponse?> loadNearbyGeneratorsAPI( static Future<NearbyGeneratorsResponse?> loadNearbyGeneratorsAPI(
empId, empId,
session, session,
tech_loc, techLoc,
radius, radius,
status, status,
) async { ) async {
...@@ -895,7 +895,7 @@ class ApiCalling { ...@@ -895,7 +895,7 @@ class ApiCalling {
Map<String, String> data = { Map<String, String> data = {
'emp_id': (empId).toString(), 'emp_id': (empId).toString(),
'session_id': (session).toString(), 'session_id': (session).toString(),
'tech_loc': (tech_loc).toString(), 'tech_loc': (techLoc).toString(),
'radius': (radius).toString(), 'radius': (radius).toString(),
'status': (status).toString(), 'status': (status).toString(),
}; };
...@@ -917,13 +917,13 @@ class ApiCalling { ...@@ -917,13 +917,13 @@ class ApiCalling {
static Future<AccountSuggestionResonse?> AccountSuggestionAPI( static Future<AccountSuggestionResonse?> AccountSuggestionAPI(
empId, empId,
session, session,
search_string, searchString,
) 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(),
'search_string': (search_string).toString(), 'search_string': (searchString).toString(),
}; };
final res = await post(data, technicianAccountSearchUrl, {}); final res = await post(data, technicianAccountSearchUrl, {});
if (res != null) { if (res != null) {
...@@ -966,16 +966,16 @@ class ApiCalling { ...@@ -966,16 +966,16 @@ class ApiCalling {
empId, empId,
session, session,
type, type,
gen_id, genId,
account_id, accountId,
) 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(),
'type': (type).toString(), 'type': (type).toString(),
'gen_id': (gen_id).toString(), 'gen_id': (genId).toString(),
'account_id': (account_id).toString(), 'account_id': (accountId).toString(),
}; };
print(data); print(data);
final res = await post(data, technicianAddPaymentUrl, {}); final res = await post(data, technicianAddPaymentUrl, {});
...@@ -996,26 +996,26 @@ class ApiCalling { ...@@ -996,26 +996,26 @@ class ApiCalling {
TechnicianUpdatepaymentAPI( TechnicianUpdatepaymentAPI(
empId, empId,
session, session,
ref_type, refType,
ref_id, refId,
payment_mode_id, paymentModeId,
payment_ref_no, paymentRefNo,
amount, amount,
otp_validated_name, otpValidatedName,
otp_validated_mobile_number, otpValidatedMobileNumber,
payment_proof, paymentProof,
) 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(),
'ref_type': (ref_type).toString(), 'ref_type': (refType).toString(),
'ref_id': (ref_id).toString(), 'ref_id': (refId).toString(),
'payment_mode_id': (payment_mode_id).toString(), 'payment_mode_id': (paymentModeId).toString(),
'payment_ref_no': (payment_ref_no).toString(), 'payment_ref_no': (paymentRefNo).toString(),
'amount': (amount).toString(), 'amount': (amount).toString(),
'otp_validated_name': (otp_validated_name).toString(), 'otp_validated_name': (otpValidatedName).toString(),
'otp_validated_mobile_number': (otp_validated_mobile_number).toString(), 'otp_validated_mobile_number': (otpValidatedMobileNumber).toString(),
}; };
var res; var res;
// if (payment_proof != null) { // if (payment_proof != null) {
...@@ -1036,13 +1036,13 @@ class ApiCalling { ...@@ -1036,13 +1036,13 @@ 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 (paymentProof != null) {
res = await postImageNew( res = await postImageNew(
data, data,
{}, {},
technicianAddPaymentCollectionUrl, technicianAddPaymentCollectionUrl,
payment_proof, paymentProof,
'payment_proof', 'payment_proof',
); );
...@@ -1065,14 +1065,14 @@ class ApiCalling { ...@@ -1065,14 +1065,14 @@ class ApiCalling {
TechnicianPaymentOTPValidateAPI( TechnicianPaymentOTPValidateAPI(
empId, empId,
session, session,
payment_collection_id, paymentCollectionId,
otp, otp,
) 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(),
'payment_collection_id': (payment_collection_id).toString(), 'payment_collection_id': (paymentCollectionId).toString(),
'otp': (otp).toString(), 'otp': (otp).toString(),
}; };
final res = await post(data, technicianPaymentCollectionOtpUrl, {}); final res = await post(data, technicianPaymentCollectionOtpUrl, {});
...@@ -1092,12 +1092,12 @@ class ApiCalling { ...@@ -1092,12 +1092,12 @@ class ApiCalling {
} }
static Future<Technicianaddpaymentresendotpresponse?> static Future<Technicianaddpaymentresendotpresponse?>
TechnicianPaymentOTPResendAPI(empId, session, payment_collection_id) async { TechnicianPaymentOTPResendAPI(empId, session, paymentCollectionId) 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(),
'payment_collection_id': (payment_collection_id).toString(), 'payment_collection_id': (paymentCollectionId).toString(),
}; };
final res = await post(data, technicianAddPaymentResendOTPUrl, {}); final res = await post(data, technicianAddPaymentResendOTPUrl, {});
if (res != null) { if (res != null) {
...@@ -1164,13 +1164,13 @@ class ApiCalling { ...@@ -1164,13 +1164,13 @@ class ApiCalling {
static Future<ViewVisitDetailsResponseNew?> loadVisitDetailsAPI( static Future<ViewVisitDetailsResponseNew?> loadVisitDetailsAPI(
empId, empId,
session, session,
comp_id, compId,
) 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(),
'comp_id': (comp_id).toString(), 'comp_id': (compId).toString(),
}; };
final res = await post(data, technicianComplaintDetailsUrl, {}); final res = await post(data, technicianComplaintDetailsUrl, {});
if (res != null) { if (res != null) {
...@@ -1189,13 +1189,13 @@ class ApiCalling { ...@@ -1189,13 +1189,13 @@ class ApiCalling {
static Future<FollowupListResponse?> loadFollowupListAPI( static Future<FollowupListResponse?> loadFollowupListAPI(
empId, empId,
session, session,
comp_id, compId,
) 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(),
'comp_id': (comp_id).toString(), 'comp_id': (compId).toString(),
}; };
final res = await post(data, technicianComplaintFollowUpUrl, {}); final res = await post(data, technicianComplaintFollowUpUrl, {});
if (res != null) { if (res != null) {
...@@ -1214,7 +1214,7 @@ class ApiCalling { ...@@ -1214,7 +1214,7 @@ class ApiCalling {
static Future<AddContactResponse?> AddContactAPI( static Future<AddContactResponse?> AddContactAPI(
empId, empId,
session, session,
gen_id, genId,
name, name,
designation, designation,
mob1, mob1,
...@@ -1222,13 +1222,13 @@ class ApiCalling { ...@@ -1222,13 +1222,13 @@ class ApiCalling {
tel, tel,
mail, mail,
type, type,
account_id, accountId,
) 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(),
'gen_id': (gen_id).toString(), 'gen_id': (genId).toString(),
'name': (name).toString(), 'name': (name).toString(),
'designation': (designation).toString(), 'designation': (designation).toString(),
'mob1': (mob1).toString(), 'mob1': (mob1).toString(),
...@@ -1236,7 +1236,7 @@ class ApiCalling { ...@@ -1236,7 +1236,7 @@ class ApiCalling {
'tel': (tel).toString(), 'tel': (tel).toString(),
'mail': (mail).toString(), 'mail': (mail).toString(),
'type': (type).toString(), 'type': (type).toString(),
'account_id': (account_id).toString(), 'account_id': (accountId).toString(),
}; };
print("add: $data"); print("add: $data");
final res = await post(data, technicianAddContactUrl, {}); final res = await post(data, technicianAddContactUrl, {});
...@@ -1256,34 +1256,34 @@ class ApiCalling { ...@@ -1256,34 +1256,34 @@ class ApiCalling {
static Future<UpdateComplaintResponse?> UpdateComplaintAPI( static Future<UpdateComplaintResponse?> UpdateComplaintAPI(
empId, empId,
session, session,
complaint_id, complaintId,
in_time, inTime,
feedback, feedback,
fsr_no, fsrNo,
running_hrs, runningHrs,
complaint_status, complaintStatus,
fsr_file, fsrFile,
) 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(),
'complaint_id': (complaint_id).toString(), 'complaint_id': (complaintId).toString(),
'in_time': (in_time).toString(), 'in_time': (inTime).toString(),
'feedback': (feedback).toString(), 'feedback': (feedback).toString(),
'fsr_no': (fsr_no).toString(), 'fsr_no': (fsrNo).toString(),
'running_hrs': (running_hrs).toString(), 'running_hrs': (runningHrs).toString(),
'complaint_status': (complaint_status).toString(), 'complaint_status': (complaintStatus).toString(),
}; };
// print(data); // print(data);
// print(fsr_file); // print(fsr_file);
var res; var res;
if (fsr_file != null) { if (fsrFile != null) {
res = await postImageNew( res = await postImageNew(
data, data,
{}, {},
technicianUpdateVisitUrl, technicianUpdateVisitUrl,
fsr_file, fsrFile,
'fsr_file', 'fsr_file',
); );
res = jsonDecode(res); res = jsonDecode(res);
...@@ -1426,40 +1426,40 @@ class ApiCalling { ...@@ -1426,40 +1426,40 @@ class ApiCalling {
} }
static Future<CommonResponse?> addPaymentRequestionSubmitAPI( static Future<CommonResponse?> addPaymentRequestionSubmitAPI(
emp_id, empId,
session_id, sessionId,
type, type,
account_id, accountId,
requesting_purpose, requestingPurpose,
description, description,
amount, amount,
payment_mode_id, paymentModeId,
bank_name, bankName,
bank_branch_name, bankBranchName,
bank_acc_number, bankAccNumber,
bank_ifsc_code, bankIfscCode,
acc_holder_name, accHolderName,
bank_upi_id, bankUpiId,
approval_assignee_emp_id, approvalAssigneeEmpId,
attachment, attachment,
) async { ) async {
try { try {
Map<String, String> data = { Map<String, String> data = {
'emp_id': emp_id.toString(), 'emp_id': empId.toString(),
'session_id': session_id.toString(), 'session_id': sessionId.toString(),
'type': type.toString(), 'type': type.toString(),
'account_id': account_id.toString(), 'account_id': accountId.toString(),
'requesting_purpose': requesting_purpose.toString(), 'requesting_purpose': requestingPurpose.toString(),
'description': description.toString(), 'description': description.toString(),
'amount': amount.toString(), 'amount': amount.toString(),
'payment_mode_id': payment_mode_id.toString(), 'payment_mode_id': paymentModeId.toString(),
'bank_name': bank_name.toString(), 'bank_name': bankName.toString(),
'bank_branch_name': bank_branch_name.toString(), 'bank_branch_name': bankBranchName.toString(),
'bank_acc_number': bank_acc_number.toString(), 'bank_acc_number': bankAccNumber.toString(),
'bank_ifsc_code': bank_ifsc_code.toString(), 'bank_ifsc_code': bankIfscCode.toString(),
'acc_holder_name': acc_holder_name.toString(), 'acc_holder_name': accHolderName.toString(),
'bank_upi_id': bank_upi_id.toString(), 'bank_upi_id': bankUpiId.toString(),
'approval_assignee_emp_id': approval_assignee_emp_id.toString(), 'approval_assignee_emp_id': approvalAssigneeEmpId.toString(),
}; };
var res; var res;
...@@ -1486,40 +1486,40 @@ class ApiCalling { ...@@ -1486,40 +1486,40 @@ class ApiCalling {
} }
static Future<addDirectPaymentResponse?> addDirectPaymentRequestionSubmitAPI( static Future<addDirectPaymentResponse?> addDirectPaymentRequestionSubmitAPI(
emp_id, empId,
session_id, sessionId,
from_account_id, fromAccountId,
to_account_id, toAccountId,
description, description,
payment_mode_id, paymentModeId,
amount, amount,
payment_date, paymentDate,
payment_reference_number, paymentReferenceNumber,
bank_name, bankName,
bank_branch_name, bankBranchName,
bank_acc_number, bankAccNumber,
bank_ifsc_code, bankIfscCode,
acc_holder_name, accHolderName,
bank_upi_id, bankUpiId,
attachment, attachment,
) async { ) async {
try { try {
Map<String, String> data = { Map<String, String> data = {
'emp_id': emp_id.toString(), 'emp_id': empId.toString(),
'session_id': session_id.toString(), 'session_id': sessionId.toString(),
'from_account_id': from_account_id.toString(), 'from_account_id': fromAccountId.toString(),
'to_account_id': to_account_id.toString(), 'to_account_id': toAccountId.toString(),
'description': description.toString(), 'description': description.toString(),
'payment_mode_id': payment_mode_id.toString(), 'payment_mode_id': paymentModeId.toString(),
'amount': amount.toString(), 'amount': amount.toString(),
'payment_date': payment_date.toString(), 'payment_date': paymentDate.toString(),
'payment_reference_number': payment_reference_number.toString(), 'payment_reference_number': paymentReferenceNumber.toString(),
'bank_name': bank_name.toString(), 'bank_name': bankName.toString(),
'bank_branch_name': bank_branch_name.toString(), 'bank_branch_name': bankBranchName.toString(),
'bank_acc_number': bank_acc_number.toString(), 'bank_acc_number': bankAccNumber.toString(),
'bank_ifsc_code': bank_ifsc_code.toString(), 'bank_ifsc_code': bankIfscCode.toString(),
'acc_holder_name': acc_holder_name.toString(), 'acc_holder_name': accHolderName.toString(),
'bank_upi_id': bank_upi_id.toString(), 'bank_upi_id': bankUpiId.toString(),
}; };
print(data); print(data);
print(attachment); print(attachment);
...@@ -1554,40 +1554,40 @@ class ApiCalling { ...@@ -1554,40 +1554,40 @@ class ApiCalling {
static Future<addReceiptPaymentResponse?> static Future<addReceiptPaymentResponse?>
addReceiptPaymentRequestionSubmitAPI( addReceiptPaymentRequestionSubmitAPI(
emp_id, empId,
session_id, sessionId,
from_account_id, fromAccountId,
to_account_id, toAccountId,
description, description,
payment_mode_id, paymentModeId,
amount, amount,
receipt_date, receiptDate,
payment_reference_number, paymentReferenceNumber,
bank_name, bankName,
bank_branch_name, bankBranchName,
bank_acc_number, bankAccNumber,
bank_ifsc_code, bankIfscCode,
acc_holder_name, accHolderName,
bank_upi_id, bankUpiId,
attachment, attachment,
) async { ) async {
try { try {
Map<String, String> data = { Map<String, String> data = {
'emp_id': emp_id.toString(), 'emp_id': empId.toString(),
'session_id': session_id.toString(), 'session_id': sessionId.toString(),
'from_account_id': from_account_id.toString(), 'from_account_id': fromAccountId.toString(),
'to_account_id': to_account_id.toString(), 'to_account_id': toAccountId.toString(),
'description': description.toString(), 'description': description.toString(),
'payment_mode_id': payment_mode_id.toString(), 'payment_mode_id': paymentModeId.toString(),
'amount': amount.toString(), 'amount': amount.toString(),
'receipt_date': receipt_date.toString(), 'receipt_date': receiptDate.toString(),
'payment_reference_number': payment_reference_number.toString(), 'payment_reference_number': paymentReferenceNumber.toString(),
'bank_name': bank_name.toString(), 'bank_name': bankName.toString(),
'bank_branch_name': bank_branch_name.toString(), 'bank_branch_name': bankBranchName.toString(),
'bank_acc_number': bank_acc_number.toString(), 'bank_acc_number': bankAccNumber.toString(),
'bank_ifsc_code': bank_ifsc_code.toString(), 'bank_ifsc_code': bankIfscCode.toString(),
'acc_holder_name': acc_holder_name.toString(), 'acc_holder_name': accHolderName.toString(),
'bank_upi_id': bank_upi_id.toString(), 'bank_upi_id': bankUpiId.toString(),
}; };
var res; var res;
...@@ -1616,16 +1616,18 @@ class ApiCalling { ...@@ -1616,16 +1616,18 @@ class ApiCalling {
empId, empId,
session, session,
mode, mode,
from_date, fromDate,
to_date, toDate,
pageNumber,
) 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(),
'mode': (mode).toString(), 'mode': (mode).toString(),
'from': from_date.toString(), 'from': fromDate.toString(),
'to': to_date.toString(), 'to': toDate.toString(),
'page_number': pageNumber.toString(),
}; };
print(data); print(data);
final res = await post(data, paymentRequestionListUrl, {}); final res = await post(data, paymentRequestionListUrl, {});
...@@ -1645,13 +1647,13 @@ class ApiCalling { ...@@ -1645,13 +1647,13 @@ class ApiCalling {
static Future<paymentRequisitionDetailsResponse?> paymentRequestionDetailsAPI( static Future<paymentRequisitionDetailsResponse?> paymentRequestionDetailsAPI(
empId, empId,
session, session,
payment_request_id, paymentRequestId,
) 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(),
'payment_request_id': (payment_request_id).toString(), 'payment_request_id': (paymentRequestId).toString(),
}; };
final res = await post(data, paymentRequestionDetailsUrl, {}); final res = await post(data, paymentRequestionDetailsUrl, {});
if (res != null) { if (res != null) {
...@@ -1668,16 +1670,16 @@ class ApiCalling { ...@@ -1668,16 +1670,16 @@ class ApiCalling {
} }
static Future<paymentRequestionBankDetailsResponse?> static Future<paymentRequestionBankDetailsResponse?>
paymentRequestionBankDetailsAPI(empId, session, account_id) async { paymentRequestionBankDetailsAPI(empId, session, accountId) 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(),
'account_id': (account_id).toString(), 'account_id': (accountId).toString(),
}; };
final res = await post(data, paymentRequestBankDetailsUrl, {}); final res = await post(data, paymentRequestBankDetailsUrl, {});
if (res != null) { if (res != null) {
print("Bank Detaols ${data}"); print("Bank Detaols $data");
debugPrint(res.body); debugPrint(res.body);
return paymentRequestionBankDetailsResponse.fromJson( return paymentRequestionBankDetailsResponse.fromJson(
jsonDecode(res.body), jsonDecode(res.body),
...@@ -1693,16 +1695,16 @@ class ApiCalling { ...@@ -1693,16 +1695,16 @@ class ApiCalling {
} }
static Future<approveRejectPaymentRequestResponse?> static Future<approveRejectPaymentRequestResponse?>
approveRejectPaymentRequestAPI(empId, session, payment_request_id) async { approveRejectPaymentRequestAPI(empId, session, paymentRequestId) 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(),
'payment_request_id': (payment_request_id).toString(), 'payment_request_id': (paymentRequestId).toString(),
}; };
final res = await post(data, approveRejectPaymentRequestUrl, {}); final res = await post(data, approveRejectPaymentRequestUrl, {});
if (res != null) { if (res != null) {
print("add payment:${data}"); print("add payment:$data");
debugPrint(res.body); debugPrint(res.body);
return approveRejectPaymentRequestResponse.fromJson( return approveRejectPaymentRequestResponse.fromJson(
jsonDecode(res.body), jsonDecode(res.body),
...@@ -1722,8 +1724,8 @@ class ApiCalling { ...@@ -1722,8 +1724,8 @@ class ApiCalling {
empId, empId,
session, session,
mode, mode,
payment_request_id, paymentRequestId,
approve_remarks, approveRemarks,
) async { ) async {
try { try {
Map<String, String> data = { Map<String, String> data = {
...@@ -1731,8 +1733,8 @@ class ApiCalling { ...@@ -1731,8 +1733,8 @@ class ApiCalling {
'session_id': (session).toString(), 'session_id': (session).toString(),
'type': 'reject', 'type': 'reject',
'mode': mode.toString(), 'mode': mode.toString(),
'payment_request_id': (payment_request_id).toString(), 'payment_request_id': (paymentRequestId).toString(),
'approve_remarks': approve_remarks, 'approve_remarks': approveRemarks,
}; };
final res = await post(data, approveRejectPaymentRequestSubmitUrl, {}); final res = await post(data, approveRejectPaymentRequestSubmitUrl, {});
if (res != null) { if (res != null) {
...@@ -1756,10 +1758,10 @@ class ApiCalling { ...@@ -1756,10 +1758,10 @@ class ApiCalling {
empId, empId,
session, session,
mode, mode,
payment_request_id, paymentRequestId,
approved_amount, approvedAmount,
approve_remarks, approveRemarks,
proposed_payment_account_id, proposedPaymentAccountId,
) async { ) async {
try { try {
Map<String, String> data = { Map<String, String> data = {
...@@ -1767,10 +1769,10 @@ class ApiCalling { ...@@ -1767,10 +1769,10 @@ class ApiCalling {
'session_id': (session).toString(), 'session_id': (session).toString(),
'type': 'approve', 'type': 'approve',
'mode': mode.toString(), 'mode': mode.toString(),
'payment_request_id': (payment_request_id).toString(), 'payment_request_id': (paymentRequestId).toString(),
'approve_remarks': approve_remarks, 'approve_remarks': approveRemarks,
'approved_amount': approved_amount, 'approved_amount': approvedAmount,
'proposed_payment_account_id': proposed_payment_account_id, 'proposed_payment_account_id': proposedPaymentAccountId,
}; };
// print(data); // print(data);
final res = await post(data, approveRejectPaymentRequestSubmitUrl, {}); final res = await post(data, approveRejectPaymentRequestSubmitUrl, {});
...@@ -1794,11 +1796,11 @@ class ApiCalling { ...@@ -1794,11 +1796,11 @@ class ApiCalling {
empId, empId,
session, session,
mode, mode,
payment_reference_number, paymentReferenceNumber,
payment_amount, paymentAmount,
payment_request_id, paymentRequestId,
payment_account_id, paymentAccountId,
processing_remarks, processingRemarks,
attachment, attachment,
) async { ) async {
try { try {
...@@ -1807,14 +1809,14 @@ class ApiCalling { ...@@ -1807,14 +1809,14 @@ class ApiCalling {
'session_id': (session).toString(), 'session_id': (session).toString(),
'type': 'approve'.toString(), 'type': 'approve'.toString(),
'mode': mode.toString(), 'mode': mode.toString(),
'payment_reference_number': payment_reference_number.toString(), 'payment_reference_number': paymentReferenceNumber.toString(),
'payment_amount': payment_amount.toString(), 'payment_amount': paymentAmount.toString(),
'payment_request_id': (payment_request_id).toString(), 'payment_request_id': (paymentRequestId).toString(),
'payment_account_id': payment_account_id.toString(), 'payment_account_id': paymentAccountId.toString(),
'processing_remarks': processing_remarks.toString(), 'processing_remarks': processingRemarks.toString(),
}; };
var res; var res;
print("Process:${data}"); print("Process:$data");
if (attachment != null) { if (attachment != null) {
res = await postImageNew( res = await postImageNew(
data, data,
...@@ -1823,7 +1825,7 @@ class ApiCalling { ...@@ -1823,7 +1825,7 @@ class ApiCalling {
attachment, attachment,
"attachment", "attachment",
); );
print("Process:${data}"); print("Process:$data");
res = jsonDecode(res); res = jsonDecode(res);
print(data); print(data);
return CommonResponse.fromJson(res); return CommonResponse.fromJson(res);
...@@ -1839,13 +1841,14 @@ class ApiCalling { ...@@ -1839,13 +1841,14 @@ class ApiCalling {
} }
static Future<paymentRequisitionPaymentsListResponse?> static Future<paymentRequisitionPaymentsListResponse?>
paymentRequisitionPaymentListAPI(empId, session, from, to) async { paymentRequisitionPaymentListAPI(empId, session, from, to, pageNumber) 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(),
'from': (from).toString(), 'from': (from).toString(),
'to': (to).toString(), 'to': (to).toString(),
'page_number': (pageNumber).toString(),
}; };
final res = await post(data, paymentRequesitionPaymentsListUrl, {}); final res = await post(data, paymentRequesitionPaymentsListUrl, {});
if (res != null) { if (res != null) {
...@@ -1866,13 +1869,20 @@ class ApiCalling { ...@@ -1866,13 +1869,20 @@ class ApiCalling {
} }
static Future<paymentRequisitionPaymentsReceiptsListResponse?> static Future<paymentRequisitionPaymentsReceiptsListResponse?>
paymentRequisitionPaymentReceiptListAPI(empId, session, from, to) async { paymentRequisitionPaymentReceiptListAPI(
empId,
session,
from,
to,
pageNumber,
) 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(),
'from': (from).toString(), 'from': (from).toString(),
'to': (to).toString(), 'to': (to).toString(),
'page_number': (pageNumber).toString(),
}; };
final res = await post( final res = await post(
data, data,
...@@ -1895,12 +1905,12 @@ class ApiCalling { ...@@ -1895,12 +1905,12 @@ class ApiCalling {
} }
static Future<paymentRequisitionPaymentsDetailsResponse?> static Future<paymentRequisitionPaymentsDetailsResponse?>
paymentRequisitionPaymentDetailsAPI(empId, session, payment_id) async { paymentRequisitionPaymentDetailsAPI(empId, session, paymentId) 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(),
'payment_id': (payment_id).toString(), 'payment_id': (paymentId).toString(),
}; };
final res = await post(data, paymentRequesitionPaymentsDetailsUrl, {}); final res = await post(data, paymentRequesitionPaymentsDetailsUrl, {});
if (res != null) { if (res != null) {
...@@ -1919,12 +1929,12 @@ class ApiCalling { ...@@ -1919,12 +1929,12 @@ class ApiCalling {
} }
static Future<paymentRequisitionPaymentsReceiptsDetailsResponse?> static Future<paymentRequisitionPaymentsReceiptsDetailsResponse?>
paymentRequisitionPaymentReceiptDetailsAPI(empId, session, payment_id) async { paymentRequisitionPaymentReceiptDetailsAPI(empId, session, paymentId) 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(),
'payment_receipt_id': (payment_id).toString(), 'payment_receipt_id': (paymentId).toString(),
}; };
final res = await post( final res = await post(
data, data,
...@@ -1945,24 +1955,23 @@ class ApiCalling { ...@@ -1945,24 +1955,23 @@ class ApiCalling {
return null; return null;
} }
} }
static Future<CommonResponse?> editProcessedRequestAmountAPI( static Future<CommonResponse?> editProcessedRequestAmountAPI(
empId, empId,
session, session,
process_payment_id, processPaymentId,
approval_amount, approvalAmount,
) 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(),
'process_payment_id': process_payment_id.toString(), 'process_payment_id': processPaymentId.toString(),
'approval_amount': approval_amount.toString(), 'approval_amount': approvalAmount.toString(),
}; };
print("Process EDIT:${data}"); print("Process EDIT:$data");
var res = await post(data, paymentRequesitionEditProcessedPaymentUrl, {}); var res = await post(data, paymentRequesitionEditProcessedPaymentUrl, {});
if (res != null) { if (res != null) {
return CommonResponse.fromJson(jsonDecode(res.body)); return CommonResponse.fromJson(jsonDecode(res.body));
} else { } else {
debugPrint("Null Response"); debugPrint("Null Response");
...@@ -2024,13 +2033,13 @@ class ApiCalling { ...@@ -2024,13 +2033,13 @@ class ApiCalling {
static Future<DistrictsResponse?> commonAddAccountViewDistrictAPI( static Future<DistrictsResponse?> commonAddAccountViewDistrictAPI(
empId, empId,
session, session,
state_id, stateId,
) 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(),
'state_id': state_id.toString(), 'state_id': stateId.toString(),
}; };
final res = await post(data, commonAddAccountViewgetDistrictUrl, {}); final res = await post(data, commonAddAccountViewgetDistrictUrl, {});
if (res != null) { if (res != null) {
...@@ -2049,13 +2058,13 @@ class ApiCalling { ...@@ -2049,13 +2058,13 @@ class ApiCalling {
static Future<SubLocationsResponse?> commonAddAccountViewSubLocationAPI( static Future<SubLocationsResponse?> commonAddAccountViewSubLocationAPI(
empId, empId,
session, session,
district_id, districtId,
) 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(),
'district_id': district_id.toString(), 'district_id': districtId.toString(),
}; };
final res = await post(data, commonAddAccountViewgetSubLocationUrl, {}); final res = await post(data, commonAddAccountViewgetSubLocationUrl, {});
if (res != null) { if (res != null) {
...@@ -2075,14 +2084,14 @@ class ApiCalling { ...@@ -2075,14 +2084,14 @@ class ApiCalling {
empId, empId,
session, session,
type, type,
type_value, typeValue,
) 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(),
'type': (type).toString(), 'type': (type).toString(),
'type_value': (type_value).toString(), 'type_value': (typeValue).toString(),
}; };
final res = await post(data, commonAddAccountCheckInputsUrl, {}); final res = await post(data, commonAddAccountCheckInputsUrl, {});
if (res != null) { if (res != null) {
...@@ -2111,13 +2120,13 @@ class ApiCalling { ...@@ -2111,13 +2120,13 @@ class ApiCalling {
address, address,
state, state,
district, district,
sub_locality, subLocality,
bank_name, bankName,
bank_branch_name, bankBranchName,
bank_ifsc_code, bankIfscCode,
bank_account_holder_name, bankAccountHolderName,
bank_account_number, bankAccountNumber,
bank_upi_id, bankUpiId,
) async { ) async {
try { try {
Map<String, String> data = { Map<String, String> data = {
...@@ -2133,13 +2142,13 @@ class ApiCalling { ...@@ -2133,13 +2142,13 @@ class ApiCalling {
'address': address.toString(), 'address': address.toString(),
'state': state.toString(), 'state': state.toString(),
'district': district.toString(), 'district': district.toString(),
'sub_locality': sub_locality.toString(), 'sub_locality': subLocality.toString(),
'bank_name': bank_name.toString(), 'bank_name': bankName.toString(),
'bank_branch_name': bank_branch_name.toString(), 'bank_branch_name': bankBranchName.toString(),
'bank_ifsc_code': bank_ifsc_code.toString(), 'bank_ifsc_code': bankIfscCode.toString(),
'bank_account_holder_name': bank_account_holder_name.toString(), 'bank_account_holder_name': bankAccountHolderName.toString(),
'bank_account_number': bank_account_number.toString(), 'bank_account_number': bankAccountNumber.toString(),
'bank_upi_id': bank_upi_id.toString(), 'bank_upi_id': bankUpiId.toString(),
}; };
final res = await post(data, commonAddAccountSubmit, {}); final res = await post(data, commonAddAccountSubmit, {});
if (res != null) { if (res != null) {
...@@ -2159,17 +2168,17 @@ class ApiCalling { ...@@ -2159,17 +2168,17 @@ class ApiCalling {
static Future<commonAccountlistResponse?> commonAccountListAPI( static Future<commonAccountlistResponse?> commonAccountListAPI(
empId, empId,
session, session,
page_number, pageNumber,
company_name, companyName,
mobile_number, mobileNumber,
) 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(),
'page_number': page_number.toString(), 'page_number': pageNumber.toString(),
'company_name': company_name.toString(), 'company_name': companyName.toString(),
'mobile_number': mobile_number.toString(), 'mobile_number': mobileNumber.toString(),
}; };
final res = await post(data, commonAccountListUrl, {}); final res = await post(data, commonAccountListUrl, {});
if (res != null) { if (res != null) {
...@@ -2188,13 +2197,13 @@ class ApiCalling { ...@@ -2188,13 +2197,13 @@ class ApiCalling {
static Future<commonAccountdetailsResponse?> commonAccountDetailsAPI( static Future<commonAccountdetailsResponse?> commonAccountDetailsAPI(
empId, empId,
session, session,
account_id, accountId,
) 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(),
'account_id': account_id.toString(), 'account_id': accountId.toString(),
}; };
final res = await post(data, commonAccountLedgerAccountDetails, {}); final res = await post(data, commonAccountLedgerAccountDetails, {});
if (res != null) { if (res != null) {
...@@ -2234,13 +2243,13 @@ class ApiCalling { ...@@ -2234,13 +2243,13 @@ class ApiCalling {
static Future<commonAccountLedgerResponse?> commonAccountLedgerListAPI( static Future<commonAccountLedgerResponse?> commonAccountLedgerListAPI(
empId, empId,
session, session,
account_id, accountId,
) 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(),
'account_id': account_id.toString(), 'account_id': accountId.toString(),
}; };
print(data); print(data);
final res = await post(data, commonAccountLedgerListWithFilterUrl, {}); final res = await post(data, commonAccountLedgerListWithFilterUrl, {});
...@@ -2281,7 +2290,6 @@ class ApiCalling { ...@@ -2281,7 +2290,6 @@ class ApiCalling {
} }
} }
static Future<ordersAccessiblePagesResponse?> ordersAccesibleAddPagesAPI( static Future<ordersAccessiblePagesResponse?> ordersAccesibleAddPagesAPI(
empId, empId,
session, session,
...@@ -2387,13 +2395,13 @@ class ApiCalling { ...@@ -2387,13 +2395,13 @@ class ApiCalling {
static Future<addOrderAccontDetailsResponse?> addOrderAccountDetailsAPI( static Future<addOrderAccontDetailsResponse?> addOrderAccountDetailsAPI(
empId, empId,
session, session,
account_id, accountId,
) 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(),
'account_id': (account_id).toString(), 'account_id': (accountId).toString(),
}; };
final res = await post(data, ordersAddOrderAccountDetailsUrl, {}); final res = await post(data, ordersAddOrderAccountDetailsUrl, {});
if (res != null) { if (res != null) {
...@@ -2440,38 +2448,38 @@ class ApiCalling { ...@@ -2440,38 +2448,38 @@ class ApiCalling {
empId, empId,
session, session,
mode, mode,
sales_person_emp_id, salesPersonEmpId,
selected_acc_id, selectedAccId,
dispatch_state_id, dispatchStateId,
dispatch_district_id, dispatchDistrictId,
dispatch_sub_location_id, dispatchSubLocationId,
dispatch_pincode, dispatchPincode,
dispatch_address, dispatchAddress,
basic_amount, basicAmount,
cgst_amount, cgstAmount,
sgst_amount, sgstAmount,
igst_amount, igstAmount,
total_amount, totalAmount,
order_received_date, orderReceivedDate,
note, note,
unloading, unloading,
freight, freight,
erection, erection,
tpc_applicable, tpcApplicable,
billing_name, billingName,
billing_gst_no, billingGstNo,
billing_pincode, billingPincode,
billing_address, billingAddress,
billing_state, billingState,
billing_district, billingDistrict,
billing_sub_locality, billingSubLocality,
order_products, orderProducts,
lead_id, leadId,
feedback, feedback,
in_time, inTime,
loc, loc,
requested_tpc_amount, requestedTpcAmount,
tpc_agent_id, tpcAgentId,
po, po,
) async { ) async {
try { try {
...@@ -2479,41 +2487,41 @@ class ApiCalling { ...@@ -2479,41 +2487,41 @@ class ApiCalling {
'emp_id': empId.toString(), 'emp_id': empId.toString(),
'session_id': session.toString(), 'session_id': session.toString(),
'mode': mode.toString(), 'mode': mode.toString(),
'sales_person_emp_id': sales_person_emp_id.toString(), 'sales_person_emp_id': salesPersonEmpId.toString(),
'selected_acc_id': selected_acc_id.toString(), 'selected_acc_id': selectedAccId.toString(),
'dispatch_state_id': dispatch_state_id.toString(), 'dispatch_state_id': dispatchStateId.toString(),
'dispatch_district_id': dispatch_district_id.toString(), 'dispatch_district_id': dispatchDistrictId.toString(),
'dispatch_sub_location_id': dispatch_sub_location_id.toString(), 'dispatch_sub_location_id': dispatchSubLocationId.toString(),
'dispatch_pincode': dispatch_pincode.toString(), 'dispatch_pincode': dispatchPincode.toString(),
'dispatch_address': dispatch_address.toString(), 'dispatch_address': dispatchAddress.toString(),
'basic_amount': basic_amount.toString(), 'basic_amount': basicAmount.toString(),
'cgst_amount': cgst_amount.toString(), 'cgst_amount': cgstAmount.toString(),
'sgst_amount': sgst_amount.toString(), 'sgst_amount': sgstAmount.toString(),
'igst_amount': igst_amount.toString(), 'igst_amount': igstAmount.toString(),
'total_amount': total_amount.toString(), 'total_amount': totalAmount.toString(),
'order_received_date': order_received_date.toString(), 'order_received_date': orderReceivedDate.toString(),
'note': note.toString(), 'note': note.toString(),
'unloading': unloading.toString(), 'unloading': unloading.toString(),
'freight': freight.toString(), 'freight': freight.toString(),
'erection': erection.toString(), 'erection': erection.toString(),
'tpc_applicable': tpc_applicable.toString(), 'tpc_applicable': tpcApplicable.toString(),
'billing_name': billing_name.toString(), 'billing_name': billingName.toString(),
'billing_gst_no': billing_gst_no.toString(), 'billing_gst_no': billingGstNo.toString(),
'billing_pincode': billing_pincode.toString(), 'billing_pincode': billingPincode.toString(),
'billing_address': billing_address.toString(), 'billing_address': billingAddress.toString(),
'billing_state': billing_state.toString(), 'billing_state': billingState.toString(),
'billing_district': billing_district.toString(), 'billing_district': billingDistrict.toString(),
'billing_sub_locality': billing_sub_locality.toString(), 'billing_sub_locality': billingSubLocality.toString(),
'order_products': (order_products).toString(), 'order_products': (orderProducts).toString(),
'lead_id': lead_id.toString(), 'lead_id': leadId.toString(),
'feedback': feedback.toString(), 'feedback': feedback.toString(),
'in_time': in_time.toString(), 'in_time': inTime.toString(),
'loc': loc.toString(), 'loc': loc.toString(),
'requested_tpc_amount': requested_tpc_amount.toString(), 'requested_tpc_amount': requestedTpcAmount.toString(),
'tpc_agent_id': tpc_agent_id.toString(), 'tpc_agent_id': tpcAgentId.toString(),
}; };
var res; var res;
print("add order:${data}"); print("add order:$data");
if (po != null) { if (po != null) {
res = await postImageNew(data, {}, ordersAddOrderSubmitUrl, po, "po"); res = await postImageNew(data, {}, ordersAddOrderSubmitUrl, po, "po");
res = jsonDecode(res); res = jsonDecode(res);
...@@ -2559,6 +2567,7 @@ class ApiCalling { ...@@ -2559,6 +2567,7 @@ class ApiCalling {
mode, mode,
teamemployee, teamemployee,
status, status,
pageNumber,
) async { ) async {
try { try {
Map<String, String> data = { Map<String, String> data = {
...@@ -2567,6 +2576,7 @@ class ApiCalling { ...@@ -2567,6 +2576,7 @@ class ApiCalling {
'mode': (mode).toString(), 'mode': (mode).toString(),
'teamemployee': (teamemployee).toString(), 'teamemployee': (teamemployee).toString(),
'status': (status).toString(), 'status': (status).toString(),
'page_number': (pageNumber).toString(),
}; };
final res = await post(data, ordersOrderListFilterUrl, {}); final res = await post(data, ordersOrderListFilterUrl, {});
if (res != null) { if (res != null) {
...@@ -2586,17 +2596,17 @@ class ApiCalling { ...@@ -2586,17 +2596,17 @@ class ApiCalling {
static Future<ordersDetailsByModeResponse?> ordersDetailsByModeAPI( static Future<ordersDetailsByModeResponse?> ordersDetailsByModeAPI(
empId, empId,
session, session,
order_id, orderId,
) 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': (orderId).toString(),
}; };
final res = await post(data, ordersOrderDetailsUrl, {}); final res = await post(data, ordersOrderDetailsUrl, {});
if (res != null) { if (res != null) {
print("Order Details ${data}"); print("Order Details $data");
print("Order Details ${res.body}"); print("Order Details ${res.body}");
return ordersDetailsByModeResponse.fromJson(jsonDecode(res.body)); return ordersDetailsByModeResponse.fromJson(jsonDecode(res.body));
} else { } else {
...@@ -2612,26 +2622,26 @@ class ApiCalling { ...@@ -2612,26 +2622,26 @@ class ApiCalling {
static Future<CommonResponse?> ordersDetailsFeedbackSubmissionAPI( static Future<CommonResponse?> ordersDetailsFeedbackSubmissionAPI(
empId, empId,
session, session,
order_id, orderId,
feedback, feedback,
status, status,
attachment_file, attachmentFile,
) 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': orderId.toString(),
'feedback': (feedback).toString(), 'feedback': (feedback).toString(),
'status': status, 'status': status,
}; };
var res; var res;
if (attachment_file != null) { if (attachmentFile != null) {
res = await postImageNew( res = await postImageNew(
data, data,
{}, {},
ordersOrderDetailsFeedbackSubmitUrl, ordersOrderDetailsFeedbackSubmitUrl,
attachment_file, attachmentFile,
"attachment_file", "attachment_file",
); );
res = jsonDecode(res); res = jsonDecode(res);
...@@ -2647,12 +2657,12 @@ class ApiCalling { ...@@ -2647,12 +2657,12 @@ class ApiCalling {
} }
static Future<ordersDetailsEditOrderViewResponse?> static Future<ordersDetailsEditOrderViewResponse?>
ordersDetailsEditOrderViewAPI(empId, session, order_id) async { ordersDetailsEditOrderViewAPI(empId, session, orderId) 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': orderId.toString(),
}; };
var res = await post(data, ordersOrderDetailsEditOrderUrl, {}); var res = await post(data, ordersOrderDetailsEditOrderUrl, {});
...@@ -2667,18 +2677,19 @@ class ApiCalling { ...@@ -2667,18 +2677,19 @@ class ApiCalling {
debugPrint('hello bev=bug $e '); debugPrint('hello bev=bug $e ');
return null; return null;
} }
return null;
} }
static Future<CommonResponse?> ordersDetailsEditOrderSubmitAPI( static Future<CommonResponse?> ordersDetailsEditOrderSubmitAPI(
empId, empId,
session, session,
order_id, orderId,
attachment_file, attachmentFile,
dispatch_state_id, dispatchStateId,
district, district,
sub_locality, subLocality,
dispatch_pincode, dispatchPincode,
dispatch_address, dispatchAddress,
unloading, unloading,
freight, freight,
erection, erection,
...@@ -2688,12 +2699,12 @@ class ApiCalling { ...@@ -2688,12 +2699,12 @@ class ApiCalling {
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': orderId.toString(),
'dispatch_state_id': dispatch_state_id.toString(), 'dispatch_state_id': dispatchStateId.toString(),
'district': district.toString(), 'district': district.toString(),
'sub_locality': sub_locality.toString(), 'sub_locality': subLocality.toString(),
'dispatch_pincode': dispatch_pincode.toString(), 'dispatch_pincode': dispatchPincode.toString(),
'dispatch_address': dispatch_address.toString(), 'dispatch_address': dispatchAddress.toString(),
'unloading': unloading.toString(), 'unloading': unloading.toString(),
'freight': freight.toString(), 'freight': freight.toString(),
'erection': erection.toString(), 'erection': erection.toString(),
...@@ -2701,12 +2712,12 @@ class ApiCalling { ...@@ -2701,12 +2712,12 @@ class ApiCalling {
}; };
var res; var res;
print("Edit Order:$data"); print("Edit Order:$data");
if (attachment_file != null) { if (attachmentFile != null) {
res = await postImageNew( res = await postImageNew(
data, data,
{}, {},
ordersOrderDetailsEditOrderSubmitUrl, ordersOrderDetailsEditOrderSubmitUrl,
attachment_file, attachmentFile,
"attachment_file", "attachment_file",
); );
res = jsonDecode(res); res = jsonDecode(res);
...@@ -2722,12 +2733,12 @@ class ApiCalling { ...@@ -2722,12 +2733,12 @@ class ApiCalling {
} }
static Future<ordersDetailsDispatchOrderViewResponse?> static Future<ordersDetailsDispatchOrderViewResponse?>
ordersDetailsDispatchOrderViewAPI(empId, session, order_id) async { ordersDetailsDispatchOrderViewAPI(empId, session, orderId) 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': orderId.toString(),
}; };
final res = await post(data, ordersOrderDetailsDispatchProductsUrl, {}); final res = await post(data, ordersOrderDetailsDispatchProductsUrl, {});
...@@ -2742,18 +2753,19 @@ class ApiCalling { ...@@ -2742,18 +2753,19 @@ class ApiCalling {
debugPrint('hello bev=bug $e '); debugPrint('hello bev=bug $e ');
return null; return null;
} }
return null;
} }
static Future<ordersPdiIdByEngNumberResponse?> ordersPdiIdByEngNumberUrlAPI( static Future<ordersPdiIdByEngNumberResponse?> ordersPdiIdByEngNumberUrlAPI(
empId, empId,
session, session,
engine_number, engineNumber,
) 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': engineNumber.toString(),
}; };
final res = await post(data, ordersPdiIdByEngNumberUrl, {}); final res = await post(data, ordersPdiIdByEngNumberUrl, {});
...@@ -2766,6 +2778,7 @@ class ApiCalling { ...@@ -2766,6 +2778,7 @@ class ApiCalling {
debugPrint('hello bev=bug $e '); debugPrint('hello bev=bug $e ');
return null; return null;
} }
return null;
} }
static Future<CommonResponse?> ordersDetailsApproveRejectAPI( static Future<CommonResponse?> ordersDetailsApproveRejectAPI(
...@@ -2773,17 +2786,17 @@ class ApiCalling { ...@@ -2773,17 +2786,17 @@ class ApiCalling {
session, session,
status, status,
type, type,
order_id, orderId,
feedback, feedback,
tpc_applicable, tpcApplicable,
tpc_approved_amount, tpcApprovedAmount,
sale_order_number, saleOrderNumber,
edit_company_name, editCompanyName,
invoice_number, invoiceNumber,
vehicle_number, vehicleNumber,
driver_name, driverName,
driver_mobile_no, driverMobileNo,
crm_order_p_id, crmOrderPId,
) async { ) async {
try { try {
Map<String, String> data = { Map<String, String> data = {
...@@ -2791,17 +2804,17 @@ class ApiCalling { ...@@ -2791,17 +2804,17 @@ class ApiCalling {
'session_id': (session).toString(), 'session_id': (session).toString(),
"status": status.toString(), "status": status.toString(),
"type": type.toString(), "type": type.toString(),
"order_id": order_id.toString(), "order_id": orderId.toString(),
"feedback": feedback.toString(), "feedback": feedback.toString(),
"tpc_applicable": tpc_applicable.toString(), "tpc_applicable": tpcApplicable.toString(),
"tpc_approved_amount": tpc_approved_amount.toString(), "tpc_approved_amount": tpcApprovedAmount.toString(),
"sale_order_number": sale_order_number.toString(), "sale_order_number": saleOrderNumber.toString(),
"edit_company_name": edit_company_name.toString(), "edit_company_name": editCompanyName.toString(),
"invoice_number": invoice_number.toString(), "invoice_number": invoiceNumber.toString(),
"vehicle_number": vehicle_number.toString(), "vehicle_number": vehicleNumber.toString(),
"driver_name": driver_name.toString(), "driver_name": driverName.toString(),
"driver_mobile_no": driver_mobile_no.toString(), "driver_mobile_no": driverMobileNo.toString(),
"crm_order_p_id": crm_order_p_id.toString(), "crm_order_p_id": crmOrderPId.toString(),
}; };
final res = await post(data, ordersOrderApproveRejectUrl, {}); final res = await post(data, ordersOrderApproveRejectUrl, {});
if (res != null) { if (res != null) {
...@@ -2821,14 +2834,14 @@ class ApiCalling { ...@@ -2821,14 +2834,14 @@ class ApiCalling {
static Future<CommonResponse?> ordersDetailsDeleteAPI( static Future<CommonResponse?> ordersDetailsDeleteAPI(
empId, empId,
session, session,
order_id, orderId,
feedback, feedback,
) 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": orderId.toString(),
"feedback": feedback.toString(), "feedback": feedback.toString(),
}; };
final res = await post(data, ordersOrderLDeleteUrl, {}); final res = await post(data, ordersOrderLDeleteUrl, {});
...@@ -2872,29 +2885,29 @@ class ApiCalling { ...@@ -2872,29 +2885,29 @@ class ApiCalling {
static Future<CommonResponse?> addOrderpaymentListSubmitAPI( static Future<CommonResponse?> addOrderpaymentListSubmitAPI(
empId, empId,
session, session,
account_id, accountId,
description, description,
selected_orders, selectedOrders,
payment_amount, paymentAmount,
payment_date, paymentDate,
payment_type, paymentType,
ref_no, refNo,
attachment, attachment,
) 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(),
'account_id': account_id.toString(), 'account_id': accountId.toString(),
'description': description.toString(), 'description': description.toString(),
'selected_orders': jsonEncode(selected_orders).toString(), 'selected_orders': jsonEncode(selectedOrders).toString(),
'payment_amount': payment_amount.toString(), 'payment_amount': paymentAmount.toString(),
'payment_date': payment_date.toString(), 'payment_date': paymentDate.toString(),
'payment_type': payment_type.toString(), 'payment_type': paymentType.toString(),
'ref_no': ref_no.toString(), 'ref_no': refNo.toString(),
}; };
var res; var res;
print("Add Payment: ${data}"); print("Add Payment: $data");
if (attachment != null) { if (attachment != null) {
res = await postImageNew( res = await postImageNew(
data, data,
...@@ -2919,22 +2932,22 @@ class ApiCalling { ...@@ -2919,22 +2932,22 @@ class ApiCalling {
static Future<CommonResponse?> ordersEditPaymentDetailsAPI( static Future<CommonResponse?> ordersEditPaymentDetailsAPI(
empId, empId,
session, session,
payment_id, paymentId,
description, description,
payment_type, paymentType,
ref_no, refNo,
payment_date, paymentDate,
amount, amount,
) 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(),
'payment_id': payment_id.toString(), 'payment_id': paymentId.toString(),
'description': description.toString(), 'description': description.toString(),
'payment_type': payment_type.toString(), 'payment_type': paymentType.toString(),
'payment_date': payment_date.toString(), 'payment_date': paymentDate.toString(),
'ref_no': ref_no.toString(), 'ref_no': refNo.toString(),
'amount': amount.toString(), 'amount': amount.toString(),
}; };
...@@ -2948,19 +2961,20 @@ class ApiCalling { ...@@ -2948,19 +2961,20 @@ class ApiCalling {
debugPrint('hello bev=bug $e '); debugPrint('hello bev=bug $e ');
return null; return null;
} }
return null;
} }
static Future<EditPaymentDetailsAdjustedOrdersViewResponse?> static Future<EditPaymentDetailsAdjustedOrdersViewResponse?>
ordersEditPaymentDetailsAdjustedOrdersViewAPI( ordersEditPaymentDetailsAdjustedOrdersViewAPI(
empId, empId,
session, session,
payment_id, paymentId,
) 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(),
'payment_id': payment_id.toString(), 'payment_id': paymentId.toString(),
}; };
var res = await post( var res = await post(
...@@ -2980,23 +2994,24 @@ class ApiCalling { ...@@ -2980,23 +2994,24 @@ class ApiCalling {
debugPrint('hello bev=bug $e '); debugPrint('hello bev=bug $e ');
return null; return null;
} }
return null;
} }
static Future<EditPaymentDetailsAdjustedOrdersViewResponse?> static Future<EditPaymentDetailsAdjustedOrdersViewResponse?>
ordersEditPaymentDetailsAdjustedOrdersUpdateAPI( ordersEditPaymentDetailsAdjustedOrdersUpdateAPI(
empId, empId,
session, session,
payment_id, paymentId,
update_amounts, updateAmounts,
insert_amounts, insertAmounts,
) 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(),
'payment_id': payment_id.toString(), 'payment_id': paymentId.toString(),
'update_amounts': jsonEncode(update_amounts).toString(), 'update_amounts': jsonEncode(updateAmounts).toString(),
'insert_amounts': jsonEncode(insert_amounts).toString(), 'insert_amounts': jsonEncode(insertAmounts).toString(),
}; };
var res = await post(data, ordersEditPaymentDetailsAdjustedOrdersUrl, {}); var res = await post(data, ordersEditPaymentDetailsAdjustedOrdersUrl, {});
...@@ -3011,16 +3026,17 @@ class ApiCalling { ...@@ -3011,16 +3026,17 @@ class ApiCalling {
debugPrint('hello bev=bug $e '); debugPrint('hello bev=bug $e ');
return null; return null;
} }
return null;
} }
static Future<AddOrderPaymentSelectAccountResponse?> static Future<AddOrderPaymentSelectAccountResponse?>
AddOrderPaymentSelectAccountAPI(empId, session, mode, search_term) async { AddOrderPaymentSelectAccountAPI(empId, session, mode, searchTerm) 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(),
'mode': mode.toString(), 'mode': mode.toString(),
'search_term': search_term.toString(), 'search_term': searchTerm.toString(),
}; };
final res = await post( final res = await post(
data, data,
...@@ -3044,12 +3060,12 @@ class ApiCalling { ...@@ -3044,12 +3060,12 @@ class ApiCalling {
} }
static Future<AddOrderPaymentSelectOrderResponse?> static Future<AddOrderPaymentSelectOrderResponse?>
AddOrderPaymentSelectOrderAPI(empId, session, account_id) async { AddOrderPaymentSelectOrderAPI(empId, session, accountId) 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(),
'account_id': account_id.toString(), 'account_id': accountId.toString(),
}; };
final res = await post(data, ordersAddPaymentSelectOrderUrl, {}); final res = await post(data, ordersAddPaymentSelectOrderUrl, {});
if (res != null) { if (res != null) {
...@@ -3098,6 +3114,7 @@ class ApiCalling { ...@@ -3098,6 +3114,7 @@ class ApiCalling {
session, session,
mode, mode,
teamemployee, teamemployee,
pageNumber,
) async { ) async {
try { try {
Map<String, String> data = { Map<String, String> data = {
...@@ -3105,6 +3122,7 @@ class ApiCalling { ...@@ -3105,6 +3122,7 @@ class ApiCalling {
'session_id': (session).toString(), 'session_id': (session).toString(),
'mode': (mode).toString(), 'mode': (mode).toString(),
'teamemployee': (teamemployee).toString(), 'teamemployee': (teamemployee).toString(),
'page_number': (pageNumber).toString(),
}; };
final res = await post(data, ordersPaymentListByModeUrl, {}); final res = await post(data, ordersPaymentListByModeUrl, {});
if (res != null) { if (res != null) {
...@@ -3124,7 +3142,7 @@ class ApiCalling { ...@@ -3124,7 +3142,7 @@ class ApiCalling {
static Future<CommonResponse?> paymentOrderApproveRejectAPI( static Future<CommonResponse?> paymentOrderApproveRejectAPI(
empId, empId,
session, session,
payment_id, paymentId,
type, type,
remarks, remarks,
) async { ) async {
...@@ -3132,7 +3150,7 @@ class ApiCalling { ...@@ -3132,7 +3150,7 @@ class ApiCalling {
Map<String, String> data = { Map<String, String> data = {
'emp_id': (empId).toString(), 'emp_id': (empId).toString(),
'session_id': (session).toString(), 'session_id': (session).toString(),
"payment_id": payment_id.toString(), "payment_id": paymentId.toString(),
"type": type.toString(), "type": type.toString(),
"remarks": remarks.toString(), "remarks": remarks.toString(),
}; };
...@@ -3151,18 +3169,17 @@ class ApiCalling { ...@@ -3151,18 +3169,17 @@ class ApiCalling {
} }
} }
static Future<CommonResponse?> verifyOrderAPI( static Future<CommonResponse?> verifyOrderAPI(
empId, empId,
session, session,
order_id, orderId,
otp, otp,
) 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": orderId.toString(),
"otp": otp.toString(), "otp": otp.toString(),
}; };
final res = await post(data, ordersVerifyOtpUrl, {}); final res = await post(data, ordersVerifyOtpUrl, {});
...@@ -3183,13 +3200,13 @@ class ApiCalling { ...@@ -3183,13 +3200,13 @@ class ApiCalling {
static Future<CommonResponse?> resendOTPOrderAPI( static Future<CommonResponse?> resendOTPOrderAPI(
empId, empId,
session, session,
order_id, orderId,
) 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": orderId.toString(),
}; };
final res = await post(data, ordersResendOtpUrl, {}); final res = await post(data, ordersResendOtpUrl, {});
if (res != null) { if (res != null) {
...@@ -3209,13 +3226,13 @@ class ApiCalling { ...@@ -3209,13 +3226,13 @@ class ApiCalling {
static Future<CommonResponse?> paymentOrderDeleteAPI( static Future<CommonResponse?> paymentOrderDeleteAPI(
empId, empId,
session, session,
payment_id, paymentId,
) 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(),
"payment_id": payment_id.toString(), "payment_id": paymentId.toString(),
}; };
final res = await post(data, ordersPaymentListDeleteUrl, {}); final res = await post(data, ordersPaymentListDeleteUrl, {});
if (res != null) { if (res != null) {
...@@ -3235,13 +3252,13 @@ class ApiCalling { ...@@ -3235,13 +3252,13 @@ class ApiCalling {
static Future<paymentDetailsByModeFilterResponse?> paymentsDetailsByModeAPI( static Future<paymentDetailsByModeFilterResponse?> paymentsDetailsByModeAPI(
empId, empId,
session, session,
payment_id, paymentId,
) 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(),
'payment_id': (payment_id).toString(), 'payment_id': (paymentId).toString(),
}; };
final res = await post(data, ordersPaymentDetailsUrl, {}); final res = await post(data, ordersPaymentDetailsUrl, {});
if (res != null) { if (res != null) {
...@@ -3263,26 +3280,23 @@ class ApiCalling { ...@@ -3263,26 +3280,23 @@ class ApiCalling {
static Future<CommonResponse?> paymentsDetailsAddAdjustedOrderAPI( static Future<CommonResponse?> paymentsDetailsAddAdjustedOrderAPI(
empId, empId,
session, session,
payment_id, paymentId,
selected_order_id, selectedOrderId,
amount, amount,
) 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(),
'payment_id': (payment_id).toString(), 'payment_id': (paymentId).toString(),
'selected_order_id': (selected_order_id).toString(), 'selected_order_id': (selectedOrderId).toString(),
'amount': (amount).toString(), 'amount': (amount).toString(),
}; };
final res = await post(data, ordersPaymentDetailsAddOrderUrl, {}); final res = await post(data, ordersPaymentDetailsAddOrderUrl, {});
if (res != null) { if (res != null) {
print("paymentsDetailsAddAdjusted: $data"); print("paymentsDetailsAddAdjusted: $data");
debugPrint(res.body); debugPrint(res.body);
return CommonResponse.fromJson( return CommonResponse.fromJson(jsonDecode(res.body));
jsonDecode(res.body),
);
} else { } else {
debugPrint("Null Response"); debugPrint("Null Response");
return null; return null;
...@@ -3296,25 +3310,23 @@ class ApiCalling { ...@@ -3296,25 +3310,23 @@ class ApiCalling {
static Future<CommonResponse?> paymentsDetailsEditAdjustedOrderAPI( static Future<CommonResponse?> paymentsDetailsEditAdjustedOrderAPI(
empId, empId,
session, session,
selected_order_id, selectedOrderId,
amount, amount,
order_payment_id, orderPaymentId,
) 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(),
'selected_order_id': (selected_order_id).toString(), 'selected_order_id': (selectedOrderId).toString(),
'amount': (amount).toString(), 'amount': (amount).toString(),
'order_payment_id': (order_payment_id).toString(), 'order_payment_id': (orderPaymentId).toString(),
}; };
final res = await post(data, ordersPaymentDetailsEditOrderUrl, {}); final res = await post(data, ordersPaymentDetailsEditOrderUrl, {});
if (res != null) { if (res != null) {
print("paymentsDetailsEditAdjusted $data"); print("paymentsDetailsEditAdjusted $data");
debugPrint(res.body); debugPrint(res.body);
return CommonResponse.fromJson( return CommonResponse.fromJson(jsonDecode(res.body));
jsonDecode(res.body),
);
} else { } else {
debugPrint("Null Response"); debugPrint("Null Response");
return null; return null;
...@@ -3328,35 +3340,35 @@ class ApiCalling { ...@@ -3328,35 +3340,35 @@ class ApiCalling {
static Future<CommonResponse?> ordersAddTPCAgentAPI( static Future<CommonResponse?> ordersAddTPCAgentAPI(
empId, empId,
session, session,
agent_name, agentName,
mobile_number, mobileNumber,
bank_name, bankName,
bank_account_no, bankAccountNo,
bank_ifsc_code, bankIfscCode,
bank_beneficiary_name, bankBeneficiaryName,
note, note,
id_proof, idProof,
) 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(),
'agent_name': agent_name.toString(), 'agent_name': agentName.toString(),
'mobile_number': mobile_number.toString(), 'mobile_number': mobileNumber.toString(),
'bank_name': bank_name.toString(), 'bank_name': bankName.toString(),
'bank_account_no': bank_account_no.toString(), 'bank_account_no': bankAccountNo.toString(),
'bank_ifsc_code': bank_ifsc_code.toString(), 'bank_ifsc_code': bankIfscCode.toString(),
'bank_beneficiary_name': bank_beneficiary_name.toString(), 'bank_beneficiary_name': bankBeneficiaryName.toString(),
'note': note.toString(), 'note': note.toString(),
}; };
var res; var res;
print("add TPC: $data"); print("add TPC: $data");
if (id_proof != null) { if (idProof != null) {
res = await postImageNew( res = await postImageNew(
data, data,
{}, {},
ordersAddTPCAgentUrl, ordersAddTPCAgentUrl,
id_proof, idProof,
"id_proof", "id_proof",
); );
res = jsonDecode(res); res = jsonDecode(res);
...@@ -3365,7 +3377,7 @@ class ApiCalling { ...@@ -3365,7 +3377,7 @@ class ApiCalling {
res = jsonDecode(res.body); res = jsonDecode(res.body);
// return CommonResponse.fromJson(res); // return CommonResponse.fromJson(res);
} }
print("Add TPC: ${res}"); print("Add TPC: $res");
return CommonResponse.fromJson(res); return CommonResponse.fromJson(res);
} catch (e) { } catch (e) {
debugPrint('hello bev=bug $e '); debugPrint('hello bev=bug $e ');
...@@ -3373,12 +3385,18 @@ class ApiCalling { ...@@ -3373,12 +3385,18 @@ class ApiCalling {
} }
} }
static Future<TPCListResponse?> TPCAgentListAPI(empId, session, mode) async { static Future<TPCListResponse?> TPCAgentListAPI(
empId,
session,
mode,
pageNumber,
) 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(),
'mode': (mode).toString(), 'mode': (mode).toString(),
'page_number': (pageNumber).toString(),
}; };
final res = await post(data, ordersTPCAgentListUrl, {}); final res = await post(data, ordersTPCAgentListUrl, {});
if (res != null) { if (res != null) {
...@@ -3398,13 +3416,13 @@ class ApiCalling { ...@@ -3398,13 +3416,13 @@ class ApiCalling {
static Future<TPCAgentDetailsResponse?> TPCAgentDetailsAPI( static Future<TPCAgentDetailsResponse?> TPCAgentDetailsAPI(
empId, empId,
session, session,
tpc_agent_id, tpcAgentId,
) 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(),
'tpc_agent_id': (tpc_agent_id).toString(), 'tpc_agent_id': (tpcAgentId).toString(),
}; };
final res = await post(data, ordersTPCAgentDetailsUrl, {}); final res = await post(data, ordersTPCAgentDetailsUrl, {});
if (res != null) { if (res != null) {
...@@ -3424,11 +3442,13 @@ class ApiCalling { ...@@ -3424,11 +3442,13 @@ class ApiCalling {
static Future<PendingTPCAgentListResponse?> pendingTPCAgentIssueListAPI( static Future<PendingTPCAgentListResponse?> pendingTPCAgentIssueListAPI(
empId, empId,
session, session,
pageNumber,
) 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(),
'page_number': (pageNumber).toString(),
}; };
final res = await post(data, ordersPendingTPCIssueListUrl, {}); final res = await post(data, ordersPendingTPCIssueListUrl, {});
if (res != null) { if (res != null) {
...@@ -3448,28 +3468,28 @@ class ApiCalling { ...@@ -3448,28 +3468,28 @@ class ApiCalling {
static Future<CommonResponse?> TpcIssueListApprovalAPI( static Future<CommonResponse?> TpcIssueListApprovalAPI(
empId, empId,
session, session,
tpc_payment_mode, tpcPaymentMode,
tpc_payment_reference_no, tpcPaymentReferenceNo,
order_id, orderId,
order_tpc_feedback, orderTpcFeedback,
tpc_paym_attachment, tpcPaymAttachment,
) 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(),
'tpc_payment_mode': tpc_payment_mode.toString(), 'tpc_payment_mode': tpcPaymentMode.toString(),
'tpc_payment_reference_no': tpc_payment_reference_no.toString(), 'tpc_payment_reference_no': tpcPaymentReferenceNo.toString(),
'order_id': order_id.toString(), 'order_id': orderId.toString(),
'order_tpc_feedback': order_tpc_feedback.toString(), 'order_tpc_feedback': orderTpcFeedback.toString(),
}; };
var res; var res;
if (tpc_paym_attachment != null) { if (tpcPaymAttachment != null) {
res = await postImageNew( res = await postImageNew(
data, data,
{}, {},
ordersApprovePendingTPCIssueListUrl, ordersApprovePendingTPCIssueListUrl,
tpc_paym_attachment, tpcPaymAttachment,
"tpc_paym_attachment", "tpc_paym_attachment",
); );
res = jsonDecode(res); res = jsonDecode(res);
...@@ -3534,14 +3554,15 @@ class ApiCalling { ...@@ -3534,14 +3554,15 @@ class ApiCalling {
} }
} }
static Future<crmNewLeadsProspectsSubmitResponse?> crmNewLeadsProspectsSubmitAPI( static Future<crmNewLeadsProspectsSubmitResponse?>
session_id, crmNewLeadsProspectsSubmitAPI(
emp_id, sessionId,
empId,
mode, mode,
acc_manager_id, accManagerId,
salutation_name, salutationName,
name, name,
contact_name, contactName,
district, district,
state, state,
address, address,
...@@ -3549,24 +3570,24 @@ class ApiCalling { ...@@ -3549,24 +3570,24 @@ class ApiCalling {
source, source,
reference, reference,
team, team,
sub_locality, subLocality,
mob1, mob1,
mob2, mob2,
tel, tel,
email, email,
designation, designation,
lead_status, leadStatus,
products, products,
) async { ) async {
try { try {
Map<String, String> data = { Map<String, String> data = {
'session_id': session_id.toString(), 'session_id': sessionId.toString(),
'emp_id': emp_id.toString(), 'emp_id': empId.toString(),
'mode': mode.toString(), 'mode': mode.toString(),
'acc_manager_id': acc_manager_id.toString(), 'acc_manager_id': accManagerId.toString(),
'salutation_name': salutation_name.toString(), 'salutation_name': salutationName.toString(),
'name': name.toString(), 'name': name.toString(),
'contact_name': contact_name.toString(), 'contact_name': contactName.toString(),
'district': district.toString(), 'district': district.toString(),
'state': state.toString(), 'state': state.toString(),
'address': address.toString(), 'address': address.toString(),
...@@ -3574,20 +3595,22 @@ class ApiCalling { ...@@ -3574,20 +3595,22 @@ class ApiCalling {
'source': source.toString(), 'source': source.toString(),
'reference': reference.toString(), 'reference': reference.toString(),
'team': team.toString(), 'team': team.toString(),
'sub_locality': sub_locality.toString(), 'sub_locality': subLocality.toString(),
'mob1': mob1.toString(), 'mob1': mob1.toString(),
'mob2': mob2.toString(), 'mob2': mob2.toString(),
'tel': tel.toString(), 'tel': tel.toString(),
'email': email.toString(), 'email': email.toString(),
'designation': designation.toString(), 'designation': designation.toString(),
'lead_status': lead_status.toString(), 'lead_status': leadStatus.toString(),
'products': products.toString(), 'products': products.toString(),
}; };
final res = await post(data, crmNewProspectLeadSubmitUrl, {}); final res = await post(data, crmNewProspectLeadSubmitUrl, {});
if (res != null) { if (res != null) {
print(data); print(data);
debugPrint("Submit New Leads ${res.body}"); debugPrint("Submit New Leads ${res.body}");
return crmNewLeadsProspectsSubmitResponse.fromJson(jsonDecode(res.body)); return crmNewLeadsProspectsSubmitResponse.fromJson(
jsonDecode(res.body),
);
} else { } else {
debugPrint("Null Response"); debugPrint("Null Response");
return null; return null;
...@@ -3601,13 +3624,13 @@ class ApiCalling { ...@@ -3601,13 +3624,13 @@ class ApiCalling {
static Future<crmDashboardResponse?> crmDashboardAPI( static Future<crmDashboardResponse?> crmDashboardAPI(
empId, empId,
session, session,
emp_loc, empLoc,
) 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': empLoc.toString(),
}; };
final res = await post(data, crmDashboardUrl, {}); final res = await post(data, crmDashboardUrl, {});
if (res != null) { if (res != null) {
...@@ -3705,7 +3728,7 @@ class ApiCalling { ...@@ -3705,7 +3728,7 @@ class ApiCalling {
session, session,
mode, mode,
status, status,
open_status, openStatus,
mob, mob,
com, com,
source, source,
...@@ -3713,6 +3736,7 @@ class ApiCalling { ...@@ -3713,6 +3736,7 @@ class ApiCalling {
team, team,
segment, segment,
alphabet, alphabet,
pageNumber,
) async { ) async {
try { try {
Map<String, String> data = { Map<String, String> data = {
...@@ -3720,7 +3744,7 @@ class ApiCalling { ...@@ -3720,7 +3744,7 @@ class ApiCalling {
'session_id': (session).toString(), 'session_id': (session).toString(),
'mode': (mode).toString(), 'mode': (mode).toString(),
'status': status.toString(), 'status': status.toString(),
'open_status': open_status.toString(), 'open_status': openStatus.toString(),
'mob': mob.toString(), 'mob': mob.toString(),
'com': com.toString(), 'com': com.toString(),
'source': source.toString(), 'source': source.toString(),
...@@ -3728,10 +3752,11 @@ class ApiCalling { ...@@ -3728,10 +3752,11 @@ class ApiCalling {
'team': team.toString(), 'team': team.toString(),
'segment': segment.toString(), 'segment': segment.toString(),
'alphabet': alphabet.toString(), 'alphabet': alphabet.toString(),
'page_number': pageNumber.toString(),
}; };
final res = await post(data, crmLeadListFilterSubmitUrl, {}); final res = await post(data, crmLeadListFilterSubmitUrl, {});
if (res != null) { if (res != null) {
print("Lead Filter:${data}"); print("Lead Filter:$data");
debugPrint(res.body); debugPrint(res.body);
return SubmitLeadListFilterResponse.fromJson(jsonDecode(res.body)); return SubmitLeadListFilterResponse.fromJson(jsonDecode(res.body));
} else { } else {
...@@ -3747,13 +3772,13 @@ class ApiCalling { ...@@ -3747,13 +3772,13 @@ class ApiCalling {
static Future<GetSourceOnReferenceResponse?> crmLeadListSourceOnReferenceAPI( static Future<GetSourceOnReferenceResponse?> crmLeadListSourceOnReferenceAPI(
empId, empId,
session, session,
source_id, sourceId,
) 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(),
'source_id': (source_id).toString(), 'source_id': (sourceId).toString(),
}; };
final res = await post(data, crmLeadListSourceOnReferenceUrl, {}); final res = await post(data, crmLeadListSourceOnReferenceUrl, {});
if (res != null) { if (res != null) {
...@@ -3773,13 +3798,13 @@ class ApiCalling { ...@@ -3773,13 +3798,13 @@ class ApiCalling {
static Future<GetSegmentOnTeamResponse?> crmLeadListSegmentOnTeamAPI( static Future<GetSegmentOnTeamResponse?> crmLeadListSegmentOnTeamAPI(
empId, empId,
session, session,
team_id, teamId,
) 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(),
'team_id': (team_id).toString(), 'team_id': (teamId).toString(),
}; };
final res = await post(data, crmLeadListSegmentOnTeamUrl, {}); final res = await post(data, crmLeadListSegmentOnTeamUrl, {});
if (res != null) { if (res != null) {
...@@ -3799,13 +3824,13 @@ class ApiCalling { ...@@ -3799,13 +3824,13 @@ class ApiCalling {
static Future<GetDistrictOnStateResponse?> crmDistrictsOnStateAPI( static Future<GetDistrictOnStateResponse?> crmDistrictsOnStateAPI(
empId, empId,
session, session,
state_id, stateId,
) 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(),
'state_id': (state_id).toString(), 'state_id': (stateId).toString(),
}; };
final res = await post(data, crmLeadListDistrictOnStateUrl, {}); final res = await post(data, crmLeadListDistrictOnStateUrl, {});
if (res != null) { if (res != null) {
...@@ -3825,13 +3850,13 @@ class ApiCalling { ...@@ -3825,13 +3850,13 @@ class ApiCalling {
static Future<GetSubLocOnDistrictResponse?> crmSubLocOnDistrictAPI( static Future<GetSubLocOnDistrictResponse?> crmSubLocOnDistrictAPI(
empId, empId,
session, session,
district_id, districtId,
) 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(),
'district_id': (district_id).toString(), 'district_id': (districtId).toString(),
}; };
final res = await post(data, crmLeadListSubLocOnDistrictUrl, {}); final res = await post(data, crmLeadListSubLocOnDistrictUrl, {});
if (res != null) { if (res != null) {
...@@ -3851,13 +3876,13 @@ class ApiCalling { ...@@ -3851,13 +3876,13 @@ class ApiCalling {
static Future<LeadListContactPopUpResponse?> crmLeadListContactPopUpAPI( static Future<LeadListContactPopUpResponse?> crmLeadListContactPopUpAPI(
empId, empId,
session, session,
account_id, accountId,
) 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(),
'account_id': (account_id).toString(), 'account_id': (accountId).toString(),
}; };
final res = await post(data, crmLeadListContactPopUpUrl, {}); final res = await post(data, crmLeadListContactPopUpUrl, {});
if (res != null) { if (res != null) {
...@@ -3877,14 +3902,14 @@ class ApiCalling { ...@@ -3877,14 +3902,14 @@ class ApiCalling {
static Future<LeadDetailsResponse?> crmLeadDetailsAPI( static Future<LeadDetailsResponse?> crmLeadDetailsAPI(
empId, empId,
session, session,
lead_id, leadId,
mode, mode,
) 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(),
'lead_id': (lead_id).toString(), 'lead_id': (leadId).toString(),
'mode': (mode).toString(), 'mode': (mode).toString(),
}; };
final res = await post(data, crmLeadDetailsUrl, {}); final res = await post(data, crmLeadDetailsUrl, {});
...@@ -3905,10 +3930,10 @@ class ApiCalling { ...@@ -3905,10 +3930,10 @@ class ApiCalling {
static Future<CommonResponse?> crmLeadDetailsAddEditProductsAPI( static Future<CommonResponse?> crmLeadDetailsAddEditProductsAPI(
empId, empId,
session, session,
lead_id, leadId,
type, type,
lead_product_id, leadProductId,
product_id, productId,
qty, qty,
amount, amount,
) async { ) async {
...@@ -3916,10 +3941,10 @@ class ApiCalling { ...@@ -3916,10 +3941,10 @@ class ApiCalling {
Map<String, String> data = { Map<String, String> data = {
'emp_id': (empId).toString(), 'emp_id': (empId).toString(),
'session_id': (session).toString(), 'session_id': (session).toString(),
'lead_id': (lead_id).toString(), 'lead_id': (leadId).toString(),
'type': (type).toString(), 'type': (type).toString(),
'lead_product_id': (lead_product_id).toString(), 'lead_product_id': (leadProductId).toString(),
'product_id': (product_id).toString(), 'product_id': (productId).toString(),
'qty': (qty).toString(), 'qty': (qty).toString(),
'amount': (amount).toString(), 'amount': (amount).toString(),
}; };
...@@ -3939,41 +3964,41 @@ class ApiCalling { ...@@ -3939,41 +3964,41 @@ class ApiCalling {
} }
static Future<crmAddFollowUpResponse?> crmLeadDetailsAddFollowUpAPI( static Future<crmAddFollowUpResponse?> crmLeadDetailsAddFollowUpAPI(
session_id, sessionId,
emp_id, empId,
nextapp, nextapp,
orderstatus, orderstatus,
lead_id, leadId,
followup_feedback, followupFeedback,
followup_type, followupType,
followupintime, followupintime,
loc, loc,
competitor, competitor,
reason, reason,
followup_status, followupStatus,
next_appointment_date, nextAppointmentDate,
appointment_type, appointmentType,
sms, sms,
app_note, appNote,
) async { ) async {
try { try {
Map<String, String> data = { Map<String, String> data = {
'session_id': session_id.toString(), 'session_id': sessionId.toString(),
'emp_id': emp_id.toString(), 'emp_id': empId.toString(),
'nextapp': nextapp.toString(), 'nextapp': nextapp.toString(),
'orderstatus': orderstatus.toString(), 'orderstatus': orderstatus.toString(),
'lead_id': lead_id.toString(), 'lead_id': leadId.toString(),
'followup_feedback': followup_feedback.toString(), 'followup_feedback': followupFeedback.toString(),
'followup_type': followup_type.toString(), 'followup_type': followupType.toString(),
'followupintime': followupintime.toString(), 'followupintime': followupintime.toString(),
'loc': loc.toString(), 'loc': loc.toString(),
'competitor': competitor.toString(), 'competitor': competitor.toString(),
'reason': reason.toString(), 'reason': reason.toString(),
'followup_status': followup_status.toString(), 'followup_status': followupStatus.toString(),
'next_appointment_date': next_appointment_date.toString(), 'next_appointment_date': nextAppointmentDate.toString(),
'appointment_type': appointment_type.toString(), 'appointment_type': appointmentType.toString(),
'sms': sms.toString(), 'sms': sms.toString(),
'app_note': app_note.toString(), 'app_note': appNote.toString(),
}; };
final res = await post(data, crmLeadDetailsAddFollowUpUrl, {}); final res = await post(data, crmLeadDetailsAddFollowUpUrl, {});
...@@ -3992,12 +4017,12 @@ class ApiCalling { ...@@ -3992,12 +4017,12 @@ class ApiCalling {
} }
static Future<crmLeadDetailsEditAccountViewResponse?> static Future<crmLeadDetailsEditAccountViewResponse?>
crmLeadDetailsEditAccountViewAPI(empId, session, lead_id, mode) async { crmLeadDetailsEditAccountViewAPI(empId, session, leadId, mode) 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(),
'lead_id': (lead_id).toString(), 'lead_id': (leadId).toString(),
'mode': (mode).toString(), 'mode': (mode).toString(),
}; };
final res = await post(data, crmLeadDetailsEditAccountViewUrl, {}); final res = await post(data, crmLeadDetailsEditAccountViewUrl, {});
...@@ -4020,19 +4045,19 @@ class ApiCalling { ...@@ -4020,19 +4045,19 @@ class ApiCalling {
static Future<CommonResponse?> crmLeadDetailsEditAccountSubmitAPI( static Future<CommonResponse?> crmLeadDetailsEditAccountSubmitAPI(
empId, empId,
session, session,
account_id, accountId,
segment_id, segmentId,
team_id, teamId,
account_name, accountName,
) 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(),
'account_id': (account_id).toString(), 'account_id': (accountId).toString(),
'segment_id': (segment_id).toString(), 'segment_id': (segmentId).toString(),
'team_id': (team_id).toString(), 'team_id': (teamId).toString(),
'account_name': (account_name).toString(), 'account_name': (accountName).toString(),
}; };
final res = await post(data, crmLeadDetailsEditAccountUrl, {}); final res = await post(data, crmLeadDetailsEditAccountUrl, {});
if (res != null) { if (res != null) {
...@@ -4050,17 +4075,19 @@ class ApiCalling { ...@@ -4050,17 +4075,19 @@ class ApiCalling {
} }
static Future<crmLeadDetailsEditProductsViewResponse?> static Future<crmLeadDetailsEditProductsViewResponse?>
crmLeadDetailsEditProductsViewAPI(empId, session, lead_id) async { crmLeadDetailsEditProductsViewAPI(empId, session, leadId) 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(),
'lead_id': (lead_id).toString(), 'lead_id': (leadId).toString(),
}; };
final res = await post(data, crmLeadDetailsEditProductsViewUrl, {}); final res = await post(data, crmLeadDetailsEditProductsViewUrl, {});
if (res != null) { if (res != null) {
print(data); print(data);
print("crmLeadDetailsEditProductsViewAPI: ${jsonDecode(res.body)['lead_products']}"); print(
"crmLeadDetailsEditProductsViewAPI: ${jsonDecode(res.body)['lead_products']}",
);
debugPrint(res.body); debugPrint(res.body);
return crmLeadDetailsEditProductsViewResponse.fromJson( return crmLeadDetailsEditProductsViewResponse.fromJson(
jsonDecode(res.body), jsonDecode(res.body),
...@@ -4079,14 +4106,14 @@ class ApiCalling { ...@@ -4079,14 +4106,14 @@ class ApiCalling {
empId, empId,
session, session,
products, products,
lead_id, leadId,
) 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(),
'products': jsonEncode(products).toString(), 'products': jsonEncode(products).toString(),
'lead_id': (lead_id).toString(), 'lead_id': (leadId).toString(),
}; };
final res = await post(data, crmLeadDetailsEditProductsUrl, {}); final res = await post(data, crmLeadDetailsEditProductsUrl, {});
if (res != null) { if (res != null) {
...@@ -4106,7 +4133,7 @@ class ApiCalling { ...@@ -4106,7 +4133,7 @@ class ApiCalling {
static Future<CommonResponse?> crmLeadDetailsAddContactAPI( static Future<CommonResponse?> crmLeadDetailsAddContactAPI(
empId, empId,
session, session,
acc_id, accId,
name, name,
mob1, mob1,
designation, designation,
...@@ -4118,7 +4145,7 @@ class ApiCalling { ...@@ -4118,7 +4145,7 @@ class ApiCalling {
Map<String, String> data = { Map<String, String> data = {
'emp_id': (empId).toString(), 'emp_id': (empId).toString(),
'session_id': (session).toString(), 'session_id': (session).toString(),
'acc_id': (acc_id).toString(), 'acc_id': (accId).toString(),
'name': (name).toString(), 'name': (name).toString(),
'mob1': (mob1).toString(), 'mob1': (mob1).toString(),
'designation': (designation).toString(), 'designation': (designation).toString(),
...@@ -4144,7 +4171,7 @@ class ApiCalling { ...@@ -4144,7 +4171,7 @@ class ApiCalling {
static Future<CommonResponse?> crmLeadDetailsEditContactAPI( static Future<CommonResponse?> crmLeadDetailsEditContactAPI(
empId, empId,
session, session,
contact_id, contactId,
name, name,
mob1, mob1,
designation, designation,
...@@ -4156,7 +4183,7 @@ class ApiCalling { ...@@ -4156,7 +4183,7 @@ class ApiCalling {
Map<String, String> data = { Map<String, String> data = {
'emp_id': (empId).toString(), 'emp_id': (empId).toString(),
'session_id': (session).toString(), 'session_id': (session).toString(),
'contact_id': (contact_id).toString(), 'contact_id': (contactId).toString(),
'name': (name).toString(), 'name': (name).toString(),
'mob1': (mob1).toString(), 'mob1': (mob1).toString(),
'designation': (designation).toString(), 'designation': (designation).toString(),
...@@ -4182,8 +4209,8 @@ class ApiCalling { ...@@ -4182,8 +4209,8 @@ class ApiCalling {
static Future<CommonResponse?> crmLeadDetailsAddAppointmentAPI( static Future<CommonResponse?> crmLeadDetailsAddAppointmentAPI(
empId, empId,
session, session,
lead_id, leadId,
appointment_date, appointmentDate,
type, type,
note, note,
) async { ) async {
...@@ -4191,8 +4218,8 @@ class ApiCalling { ...@@ -4191,8 +4218,8 @@ class ApiCalling {
Map<String, String> data = { Map<String, String> data = {
'emp_id': (empId).toString(), 'emp_id': (empId).toString(),
'session_id': (session).toString(), 'session_id': (session).toString(),
'lead_id': (lead_id).toString(), 'lead_id': (leadId).toString(),
'appointment_date': (appointment_date).toString(), 'appointment_date': (appointmentDate).toString(),
'type': (type).toString(), 'type': (type).toString(),
'note': (note).toString(), 'note': (note).toString(),
}; };
...@@ -4212,12 +4239,12 @@ class ApiCalling { ...@@ -4212,12 +4239,12 @@ class ApiCalling {
} }
static Future<crmLeadDetailsGenerateQuotationViewResponse?> static Future<crmLeadDetailsGenerateQuotationViewResponse?>
crmLeadDetailsGenerateQuotationViewAPI(empId, session, lead_id) async { crmLeadDetailsGenerateQuotationViewAPI(empId, session, leadId) 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(),
'lead_id': (lead_id).toString(), 'lead_id': (leadId).toString(),
}; };
final res = await post(data, crmLeadDetailsGenerateQuotationViewUrl, {}); final res = await post(data, crmLeadDetailsGenerateQuotationViewUrl, {});
if (res != null) { if (res != null) {
...@@ -4238,33 +4265,33 @@ class ApiCalling { ...@@ -4238,33 +4265,33 @@ class ApiCalling {
static Future<crmLeadDetailsGenerateQuotationSubmitResponse?> static Future<crmLeadDetailsGenerateQuotationSubmitResponse?>
crmLeadDetailsGenerateQuotationSubmitAPI( crmLeadDetailsGenerateQuotationSubmitAPI(
emp_id, empId,
session_id, sessionId,
lead_id, leadId,
quotemno, quotemno,
quotesubject, quotesubject,
taxes, taxes,
quotenote, quotenote,
quotefor, quotefor,
quotep_terms, quotepTerms,
quotemail, quotemail,
quote_products, quoteProducts,
quotation_type, quotationType,
) async { ) async {
try { try {
Map<String, String> data = { Map<String, String> data = {
'emp_id': emp_id.toString(), 'emp_id': empId.toString(),
'session_id': session_id.toString(), 'session_id': sessionId.toString(),
'lead_id': lead_id.toString(), 'lead_id': leadId.toString(),
'quotemno': quotemno.toString(), 'quotemno': quotemno.toString(),
'quotesubject': quotesubject.toString(), 'quotesubject': quotesubject.toString(),
'taxes': taxes.toString(), 'taxes': taxes.toString(),
'quotenote': quotenote.toString(), 'quotenote': quotenote.toString(),
'quotefor': quotefor.toString(), 'quotefor': quotefor.toString(),
'quotep_terms': quotep_terms.toString(), 'quotep_terms': quotepTerms.toString(),
'quotemail': quotemail.toString(), 'quotemail': quotemail.toString(),
'quote_products': jsonEncode(quote_products).toString(), 'quote_products': jsonEncode(quoteProducts).toString(),
'quotation_type': quotation_type.toString(), 'quotation_type': quotationType.toString(),
}; };
final res = await post( final res = await post(
data, data,
...@@ -4272,7 +4299,7 @@ class ApiCalling { ...@@ -4272,7 +4299,7 @@ class ApiCalling {
{}, {},
); );
if (res != null) { if (res != null) {
print("Filter: ${data}"); print("Filter: $data");
debugPrint(res.body); debugPrint(res.body);
return crmLeadDetailsGenerateQuotationSubmitResponse.fromJson( return crmLeadDetailsGenerateQuotationSubmitResponse.fromJson(
jsonDecode(res.body), jsonDecode(res.body),
...@@ -4287,35 +4314,26 @@ class ApiCalling { ...@@ -4287,35 +4314,26 @@ class ApiCalling {
} }
} }
static Future<crmDownloadGenQuoteResponse?> crmDownloadGenQuoteAPI(
static Future<crmDownloadGenQuoteResponse?> empId,
crmDownloadGenQuoteAPI( sessionId,
emp_id, leadId,
session_id, quoteId,
lead_id, quotationType,
quote_id,
quotation_type,
) async { ) async {
try { try {
Map<String, String> data = { Map<String, String> data = {
'emp_id': emp_id.toString(), 'emp_id': empId.toString(),
'session_id': session_id.toString(), 'session_id': sessionId.toString(),
'lead_id': lead_id.toString(), 'lead_id': leadId.toString(),
'quote_id': quote_id.toString(), 'quote_id': quoteId.toString(),
'quotation_type': quotation_type.toString(), 'quotation_type': quotationType.toString(),
}; };
final res = await post( final res = await post(data, crmDownloadGeneratedQuotationUrl, {});
data,
crmDownloadGeneratedQuotationUrl,
{},
);
if (res != null) { if (res != null) {
print("Filter: ${data}"); print("Filter: $data");
debugPrint(res.body); debugPrint(res.body);
return crmDownloadGenQuoteResponse.fromJson( return crmDownloadGenQuoteResponse.fromJson(jsonDecode(res.body));
jsonDecode(res.body),
);
} else { } else {
debugPrint("Null Response"); debugPrint("Null Response");
return null; return null;
...@@ -4359,7 +4377,8 @@ class ApiCalling { ...@@ -4359,7 +4377,8 @@ class ApiCalling {
mode, mode,
teamemployee, teamemployee,
mob, mob,
company_name, companyName,
pageNumber,
) async { ) async {
try { try {
Map<String, String> data = { Map<String, String> data = {
...@@ -4368,11 +4387,12 @@ class ApiCalling { ...@@ -4368,11 +4387,12 @@ class ApiCalling {
'mode': (mode).toString(), 'mode': (mode).toString(),
'teamemployee': teamemployee.toString(), 'teamemployee': teamemployee.toString(),
'mob': mob.toString(), 'mob': mob.toString(),
'company_name': company_name.toString(), 'company_name': companyName.toString(),
'page_number': pageNumber.toString(),
}; };
final res = await post(data, crmProspectListFilterSubmitUrl, {}); final res = await post(data, crmProspectListFilterSubmitUrl, {});
if (res != null) { if (res != null) {
print("Filter:${data}"); print("Filter:$data");
debugPrint(res.body); debugPrint(res.body);
return SubmitProspectListFilterResponse.fromJson(jsonDecode(res.body)); return SubmitProspectListFilterResponse.fromJson(jsonDecode(res.body));
} else { } else {
...@@ -4388,17 +4408,17 @@ class ApiCalling { ...@@ -4388,17 +4408,17 @@ class ApiCalling {
static Future<crmProspectDetailsResponse?> crmProspectDetailsAPI( static Future<crmProspectDetailsResponse?> crmProspectDetailsAPI(
empId, empId,
session, session,
account_id, accountId,
) 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(),
'account_id': (account_id).toString(), 'account_id': (accountId).toString(),
}; };
final res = await post(data, crmProspectDetailsUrl, {}); final res = await post(data, crmProspectDetailsUrl, {});
if (res != null) { if (res != null) {
print("Filter:${data}"); print("Filter:$data");
debugPrint(res.body); debugPrint(res.body);
return crmProspectDetailsResponse.fromJson(jsonDecode(res.body)); return crmProspectDetailsResponse.fromJson(jsonDecode(res.body));
} else { } else {
...@@ -4414,19 +4434,19 @@ class ApiCalling { ...@@ -4414,19 +4434,19 @@ class ApiCalling {
static Future<CommonResponse?> crmProspectDetailsTransferAccountAPI( static Future<CommonResponse?> crmProspectDetailsTransferAccountAPI(
empId, empId,
session, session,
account_id, accountId,
tranemp_id, tranempId,
) 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(),
'account_id': (account_id).toString(), 'account_id': (accountId).toString(),
'tranemp_id': (tranemp_id).toString(), 'tranemp_id': (tranempId).toString(),
}; };
final res = await post(data, crmProspectDetailsTransferAccountUrl, {}); final res = await post(data, crmProspectDetailsTransferAccountUrl, {});
if (res != null) { if (res != null) {
print("Filter:${data}"); print("Filter:$data");
debugPrint(res.body); debugPrint(res.body);
return CommonResponse.fromJson(jsonDecode(res.body)); return CommonResponse.fromJson(jsonDecode(res.body));
} else { } else {
...@@ -4440,16 +4460,16 @@ class ApiCalling { ...@@ -4440,16 +4460,16 @@ class ApiCalling {
} }
static Future<crmProspectDetailsEditAccountViewResponse?> static Future<crmProspectDetailsEditAccountViewResponse?>
crmProspectDetailsEditAccountViewAPI(empId, session, account_id) async { crmProspectDetailsEditAccountViewAPI(empId, session, accountId) 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(),
'account_id': (account_id).toString(), 'account_id': (accountId).toString(),
}; };
final res = await post(data, crmProspectDetailsEditAccountViewUrl, {}); final res = await post(data, crmProspectDetailsEditAccountViewUrl, {});
if (res != null) { if (res != null) {
print("Filter:${data}"); print("Filter:$data");
print("Stetets:${jsonDecode(res.body)['states']}"); print("Stetets:${jsonDecode(res.body)['states']}");
return crmProspectDetailsEditAccountViewResponse.fromJson( return crmProspectDetailsEditAccountViewResponse.fromJson(
jsonDecode(res.body), jsonDecode(res.body),
...@@ -4467,12 +4487,12 @@ class ApiCalling { ...@@ -4467,12 +4487,12 @@ class ApiCalling {
static Future<CommonResponse?> crmProspectDetailsEditAccountSubmitAPI( static Future<CommonResponse?> crmProspectDetailsEditAccountSubmitAPI(
empId, empId,
session, session,
account_id, accountId,
edit_company_name, editCompanyName,
edit_salutation_name, editSalutationName,
state_id, stateId,
district, district,
sub_locality, subLocality,
pincode, pincode,
address, address,
) async { ) async {
...@@ -4480,18 +4500,18 @@ class ApiCalling { ...@@ -4480,18 +4500,18 @@ class ApiCalling {
Map<String, String> data = { Map<String, String> data = {
'emp_id': (empId).toString(), 'emp_id': (empId).toString(),
'session_id': (session).toString(), 'session_id': (session).toString(),
'account_id': (account_id).toString(), 'account_id': (accountId).toString(),
'edit_company_name': edit_company_name.toString(), 'edit_company_name': editCompanyName.toString(),
'edit_salutation_name': edit_salutation_name.toString(), 'edit_salutation_name': editSalutationName.toString(),
'state_id': state_id.toString(), 'state_id': stateId.toString(),
'district': district.toString(), 'district': district.toString(),
'sub_locality': sub_locality.toString(), 'sub_locality': subLocality.toString(),
'pincode': pincode.toString(), 'pincode': pincode.toString(),
'address': address.toString(), 'address': address.toString(),
}; };
final res = await post(data, crmProspectDetailsEditAccountSubmitUrl, {}); final res = await post(data, crmProspectDetailsEditAccountSubmitUrl, {});
if (res != null) { if (res != null) {
print("Filter:${data}"); print("Filter:$data");
debugPrint(res.body); debugPrint(res.body);
return CommonResponse.fromJson(jsonDecode(res.body)); return CommonResponse.fromJson(jsonDecode(res.body));
} else { } else {
...@@ -4514,7 +4534,7 @@ class ApiCalling { ...@@ -4514,7 +4534,7 @@ class ApiCalling {
}; };
final res = await post(data, crmProspectDetailsAddLeadViewUrl, {}); final res = await post(data, crmProspectDetailsAddLeadViewUrl, {});
if (res != null) { if (res != null) {
print("Filter:${data}"); print("Filter:$data");
debugPrint(res.body); debugPrint(res.body);
return crmProspectDetailsAddLeadsResponse.fromJson( return crmProspectDetailsAddLeadsResponse.fromJson(
jsonDecode(res.body), jsonDecode(res.body),
...@@ -4533,24 +4553,24 @@ class ApiCalling { ...@@ -4533,24 +4553,24 @@ class ApiCalling {
empId, empId,
session, session,
mode, mode,
account_id, accountId,
acc_manager_id, accManagerId,
products, products,
lead_status, leadStatus,
) 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(),
'mode': (mode).toString(), 'mode': (mode).toString(),
'account_id': account_id.toString(), 'account_id': accountId.toString(),
'acc_manager_id': acc_manager_id.toString(), 'acc_manager_id': accManagerId.toString(),
'products': jsonEncode(products).toString(), 'products': jsonEncode(products).toString(),
'lead_status': lead_status.toString(), 'lead_status': leadStatus.toString(),
}; };
final res = await post(data, crmProspectDetailsAddLeadSubmitUrl, {}); final res = await post(data, crmProspectDetailsAddLeadSubmitUrl, {});
if (res != null) { if (res != null) {
print("Filter:${data}"); print("Filter:$data");
debugPrint(res.body); debugPrint(res.body);
return CommonResponse.fromJson(jsonDecode(res.body)); return CommonResponse.fromJson(jsonDecode(res.body));
} else { } else {
...@@ -4566,25 +4586,25 @@ class ApiCalling { ...@@ -4566,25 +4586,25 @@ class ApiCalling {
static Future<CommonResponse?> crmProspectDetailsAddLeadAPI( static Future<CommonResponse?> crmProspectDetailsAddLeadAPI(
empId, empId,
session, session,
account_id, accountId,
product_id, productId,
quantity, quantity,
amount, amount,
lead_status, leadStatus,
) 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(),
'account_id': account_id.toString(), 'account_id': accountId.toString(),
'product_id': product_id.toString(), 'product_id': productId.toString(),
'quantity': quantity.toString(), 'quantity': quantity.toString(),
'amount': amount.toString(), 'amount': amount.toString(),
'lead_status': lead_status.toString(), 'lead_status': leadStatus.toString(),
}; };
final res = await post(data, crmProspectDetailsAddLeadUrl, {}); final res = await post(data, crmProspectDetailsAddLeadUrl, {});
if (res != null) { if (res != null) {
print("crmProspectDetailsAddLead:${data}"); print("crmProspectDetailsAddLead:$data");
debugPrint(res.body); debugPrint(res.body);
return CommonResponse.fromJson(jsonDecode(res.body)); return CommonResponse.fromJson(jsonDecode(res.body));
} else { } else {
...@@ -4601,7 +4621,7 @@ class ApiCalling { ...@@ -4601,7 +4621,7 @@ class ApiCalling {
empId, empId,
session, session,
name, name,
acc_id, accId,
mob1, mob1,
designation, designation,
email, email,
...@@ -4613,7 +4633,7 @@ class ApiCalling { ...@@ -4613,7 +4633,7 @@ class ApiCalling {
'emp_id': (empId).toString(), 'emp_id': (empId).toString(),
'session_id': (session).toString(), 'session_id': (session).toString(),
'name': name.toString(), 'name': name.toString(),
'acc_id': acc_id.toString(), 'acc_id': accId.toString(),
'mob1': mob1.toString(), 'mob1': mob1.toString(),
'designation': designation.toString(), 'designation': designation.toString(),
'email': email.toString(), 'email': email.toString(),
...@@ -4622,7 +4642,7 @@ class ApiCalling { ...@@ -4622,7 +4642,7 @@ class ApiCalling {
}; };
final res = await post(data, crmProspectDetailsAddAccountUrl, {}); final res = await post(data, crmProspectDetailsAddAccountUrl, {});
if (res != null) { if (res != null) {
print("crmProspectDetailsAddAccountAPI:${data}"); print("crmProspectDetailsAddAccountAPI:$data");
debugPrint(res.body); debugPrint(res.body);
return CommonResponse.fromJson(jsonDecode(res.body)); return CommonResponse.fromJson(jsonDecode(res.body));
} else { } else {
...@@ -4638,9 +4658,9 @@ class ApiCalling { ...@@ -4638,9 +4658,9 @@ class ApiCalling {
static Future<CommonResponse?> crmProspectDetailsEditContactAPI( static Future<CommonResponse?> crmProspectDetailsEditContactAPI(
empId, empId,
session, session,
contact_id, contactId,
name, name,
acc_id, accId,
mob1, mob1,
mob2, mob2,
tel, tel,
...@@ -4651,9 +4671,9 @@ class ApiCalling { ...@@ -4651,9 +4671,9 @@ class ApiCalling {
Map<String, String> data = { Map<String, String> data = {
'emp_id': (empId).toString(), 'emp_id': (empId).toString(),
'session_id': (session).toString(), 'session_id': (session).toString(),
'contact_id': (contact_id).toString(), 'contact_id': (contactId).toString(),
'name': name.toString(), 'name': name.toString(),
'acc_id': acc_id.toString(), 'acc_id': accId.toString(),
'mob1': mob1.toString(), 'mob1': mob1.toString(),
'mob2': mob2.toString(), 'mob2': mob2.toString(),
'tel': tel.toString(), 'tel': tel.toString(),
...@@ -4662,7 +4682,7 @@ class ApiCalling { ...@@ -4662,7 +4682,7 @@ class ApiCalling {
}; };
final res = await post(data, crmProspectDetailsEditContactUrl, {}); final res = await post(data, crmProspectDetailsEditContactUrl, {});
if (res != null) { if (res != null) {
print("Filter:${data}"); print("Filter:$data");
debugPrint(res.body); debugPrint(res.body);
return CommonResponse.fromJson(jsonDecode(res.body)); return CommonResponse.fromJson(jsonDecode(res.body));
} else { } else {
...@@ -4681,12 +4701,12 @@ class ApiCalling { ...@@ -4681,12 +4701,12 @@ class ApiCalling {
session, session,
nextapp, nextapp,
orderstatus, orderstatus,
lead_id, leadId,
followup_feedback, followupFeedback,
followup_type, followupType,
followupintime, followupintime,
loc, loc,
followup_status, followupStatus,
) async { ) async {
try { try {
Map<String, String> data = { Map<String, String> data = {
...@@ -4694,12 +4714,12 @@ class ApiCalling { ...@@ -4694,12 +4714,12 @@ class ApiCalling {
'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': leadId.toString(),
'followup_feedback': followup_feedback.toString(), 'followup_feedback': followupFeedback.toString(),
'followup_type': followup_type.toString(), 'followup_type': followupType.toString(),
'followupintime': followupintime.toString(), 'followupintime': followupintime.toString(),
'loc': loc.toString(), 'loc': loc.toString(),
'followup_status': followup_status.toString(), 'followup_status': followupStatus.toString(),
}; };
final res = await post( final res = await post(
data, data,
...@@ -4707,7 +4727,7 @@ class ApiCalling { ...@@ -4707,7 +4727,7 @@ class ApiCalling {
{}, {},
); );
if (res != null) { if (res != null) {
print("Filter:${data}"); print("Filter:$data");
debugPrint(res.body); debugPrint(res.body);
return crmProspectDetailsAddFollowUpAppointmentResponse.fromJson( return crmProspectDetailsAddFollowUpAppointmentResponse.fromJson(
jsonDecode(res.body), jsonDecode(res.body),
...@@ -4725,19 +4745,19 @@ class ApiCalling { ...@@ -4725,19 +4745,19 @@ class ApiCalling {
static Future<appointmentCalendarResponse?> crmAppointmentCalendarAPI( static Future<appointmentCalendarResponse?> crmAppointmentCalendarAPI(
empId, empId,
session, session,
appointment_date, appointmentDate,
type, type,
) 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(),
'appointment_date': (appointment_date).toString(), 'appointment_date': (appointmentDate).toString(),
'type': (type).toString(), 'type': (type).toString(),
}; };
final res = await post(data, crmAppointmentCalendarUrl, {}); final res = await post(data, crmAppointmentCalendarUrl, {});
if (res != null) { if (res != null) {
print("appointmentCalendar: ${data}"); print("appointmentCalendar: $data");
debugPrint(res.body); debugPrint(res.body);
return appointmentCalendarResponse.fromJson(jsonDecode(res.body)); return appointmentCalendarResponse.fromJson(jsonDecode(res.body));
} else { } else {
...@@ -4750,20 +4770,17 @@ class ApiCalling { ...@@ -4750,20 +4770,17 @@ class ApiCalling {
} }
} }
static Future<crmSelectedProductDetailsResponse?> crmSelectedProductDetailsApi( static Future<crmSelectedProductDetailsResponse?>
empId, crmSelectedProductDetailsApi(empId, session, productId) async {
session,
product_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(),
'product_id': (product_id).toString(), 'product_id': (productId).toString(),
}; };
final res = await post(data, crmSelectedProductDetailsUrl, {}); final res = await post(data, crmSelectedProductDetailsUrl, {});
if (res != null) { if (res != null) {
print("crmSelectedProductDetailsApi: ${data}"); print("crmSelectedProductDetailsApi: $data");
debugPrint(res.body); debugPrint(res.body);
return crmSelectedProductDetailsResponse.fromJson(jsonDecode(res.body)); return crmSelectedProductDetailsResponse.fromJson(jsonDecode(res.body));
} else { } else {
...@@ -4776,24 +4793,22 @@ class ApiCalling { ...@@ -4776,24 +4793,22 @@ class ApiCalling {
} }
} }
static Future<CommonResponse?> crmCheckAccountFieldsApi( static Future<CommonResponse?> crmCheckAccountFieldsApi(
empId, empId,
session, session,
type_value, typeValue,
type, type,
) 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(),
'type_value': (type_value).toString(), 'type_value': (typeValue).toString(),
'type': (type).toString(), 'type': (type).toString(),
}; };
final res = await post(data, crmCheckAccountFieldsUrl, {}); final res = await post(data, crmCheckAccountFieldsUrl, {});
if (res != null) { if (res != null) {
print("crmCheckAccountFieldsApi: ${data}"); print("crmCheckAccountFieldsApi: $data");
debugPrint(res.body); debugPrint(res.body);
return CommonResponse.fromJson(jsonDecode(res.body)); return CommonResponse.fromJson(jsonDecode(res.body));
} else { } else {
...@@ -4812,17 +4827,17 @@ class ApiCalling { ...@@ -4812,17 +4827,17 @@ class ApiCalling {
session, session,
nextapp, nextapp,
orderstatus, orderstatus,
lead_id, leadId,
followup_feedback, followupFeedback,
followup_type, followupType,
followupintime, followupintime,
loc, loc,
followup_status, followupStatus,
appointmentset, appointmentset,
app_date, appDate,
sms, sms,
app_note, appNote,
in_t, inT,
) async { ) async {
try { try {
Map<String, String> data = { Map<String, String> data = {
...@@ -4830,17 +4845,17 @@ class ApiCalling { ...@@ -4830,17 +4845,17 @@ class ApiCalling {
'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': leadId.toString(),
'followup_feedback': followup_feedback.toString(), 'followup_feedback': followupFeedback.toString(),
'followup_type': followup_type.toString(), 'followup_type': followupType.toString(),
'followupintime': followupintime.toString(), 'followupintime': followupintime.toString(),
'loc': loc.toString(), 'loc': loc.toString(),
'followup_status': followup_status.toString(), 'followup_status': followupStatus.toString(),
'appointmentset': appointmentset.toString(), 'appointmentset': appointmentset.toString(),
'app_date': app_date.toString(), 'app_date': appDate.toString(),
'sms': sms.toString(), 'sms': sms.toString(),
'app_note': app_note.toString(), 'app_note': appNote.toString(),
'in_t': in_t.toString(), 'in_t': inT.toString(),
}; };
final res = await post( final res = await post(
data, data,
...@@ -4848,7 +4863,7 @@ class ApiCalling { ...@@ -4848,7 +4863,7 @@ class ApiCalling {
{}, {},
); );
if (res != null) { if (res != null) {
print("Filter:${data}"); print("Filter:$data");
debugPrint(res.body); debugPrint(res.body);
return CommonResponse.fromJson(jsonDecode(res.body)); return CommonResponse.fromJson(jsonDecode(res.body));
} else { } else {
...@@ -4864,14 +4879,14 @@ class ApiCalling { ...@@ -4864,14 +4879,14 @@ class ApiCalling {
static Future<NearbyOpenLeadsResponse?> loadNearbyOpenLeadsAPI( static Future<NearbyOpenLeadsResponse?> loadNearbyOpenLeadsAPI(
empId, empId,
session, session,
emp_loc, empLoc,
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': (empLoc).toString(),
'radius': radius.toString(), 'radius': radius.toString(),
}; };
final res = await post(data, crmNearbyOpenLeadsUrl, {}); final res = await post(data, crmNearbyOpenLeadsUrl, {});
...@@ -4892,7 +4907,7 @@ class ApiCalling { ...@@ -4892,7 +4907,7 @@ class ApiCalling {
static Future<crmDashboardFollowUpResponse?> crmDashboardFollowUpAPI( static Future<crmDashboardFollowUpResponse?> crmDashboardFollowUpAPI(
empId, empId,
session, session,
type, type,
) async { ) async {
try { try {
Map<String, String> data = { Map<String, String> data = {
...@@ -4916,9 +4931,9 @@ class ApiCalling { ...@@ -4916,9 +4931,9 @@ class ApiCalling {
} }
static Future<crmDashboardQuotationResponse?> crmDashboardQuotationsAPI( static Future<crmDashboardQuotationResponse?> crmDashboardQuotationsAPI(
empId, empId,
session, session,
) async { ) async {
try { try {
Map<String, String> data = { Map<String, String> data = {
'emp_id': (empId).toString(), 'emp_id': (empId).toString(),
...@@ -4939,14 +4954,11 @@ class ApiCalling { ...@@ -4939,14 +4954,11 @@ class ApiCalling {
} }
} }
///hrm modules ///hrm modules
/// ///
/// ///
static Future<ogresponse?> ogChartAPI( static Future<ogresponse?> ogChartAPI(empId, session) async {
empId,
session,
) async {
try { try {
Map<String, String> data = { Map<String, String> data = {
'emp_id': (empId).toString(), 'emp_id': (empId).toString(),
...@@ -4967,10 +4979,7 @@ class ApiCalling { ...@@ -4967,10 +4979,7 @@ class ApiCalling {
} }
} }
static Future<jobDescriptionResponse?> jobDescriptAPI( static Future<jobDescriptionResponse?> jobDescriptAPI(empId, session) async {
empId,
session,
) async {
try { try {
Map<String, String> data = { Map<String, String> data = {
'session_id': (session).toString(), 'session_id': (session).toString(),
...@@ -4992,9 +5001,9 @@ class ApiCalling { ...@@ -4992,9 +5001,9 @@ class ApiCalling {
} }
static Future<hrmAccessiblePagesResponse?> hrmAccessiblePagesAPI( static Future<hrmAccessiblePagesResponse?> hrmAccessiblePagesAPI(
empId, empId,
session, session,
) async { ) async {
try { try {
Map<String, String> data = { Map<String, String> data = {
'emp_id': (empId).toString(), 'emp_id': (empId).toString(),
...@@ -5016,13 +5025,13 @@ class ApiCalling { ...@@ -5016,13 +5025,13 @@ class ApiCalling {
} }
static Future<attendanceRequestListResponse?> attendanceRequestListAPI( static Future<attendanceRequestListResponse?> attendanceRequestListAPI(
empId, empId,
session, session,
type, type,
from, from,
to, to,
mode mode,
) async { ) async {
try { try {
Map<String, String> data = { Map<String, String> data = {
'emp_id': (empId).toString(), 'emp_id': (empId).toString(),
...@@ -5047,12 +5056,11 @@ class ApiCalling { ...@@ -5047,12 +5056,11 @@ class ApiCalling {
} }
} }
static Future<attendanceRequestDetailsResponse?> attendanceRequestDetailAPI( static Future<attendanceRequestDetailsResponse?> attendanceRequestDetailAPI(
empId, empId,
session, session,
attendanceRequestId, attendanceRequestId,
) async { ) async {
try { try {
Map<String, String> data = { Map<String, String> data = {
'emp_id': (empId).toString(), 'emp_id': (empId).toString(),
...@@ -5075,13 +5083,13 @@ class ApiCalling { ...@@ -5075,13 +5083,13 @@ class ApiCalling {
} }
static Future<CommonResponse?> attendanceRequestApproveRejectAPI( static Future<CommonResponse?> attendanceRequestApproveRejectAPI(
session, session,
empId, empId,
mode, mode,
type, type,
remarks, remarks,
id, id,
) async { ) async {
try { try {
Map<String, String> data = { Map<String, String> data = {
'session_id': (session).toString(), 'session_id': (session).toString(),
...@@ -5093,7 +5101,7 @@ class ApiCalling { ...@@ -5093,7 +5101,7 @@ class ApiCalling {
}; };
final res = await post(data, AttendanceRequestRejectUrl, {}); final res = await post(data, AttendanceRequestRejectUrl, {});
if (res != null) { if (res != null) {
print("Attendance App Reje:${data}"); print("Attendance App Reje:$data");
debugPrint(res.body); debugPrint(res.body);
return CommonResponse.fromJson(jsonDecode(res.body)); return CommonResponse.fromJson(jsonDecode(res.body));
} else { } else {
...@@ -5122,7 +5130,10 @@ class ApiCalling { ...@@ -5122,7 +5130,10 @@ class ApiCalling {
String? note, String? note,
}) async { }) async {
try { try {
var request = http.MultipartRequest('POST', Uri.parse(AddAttendanceRequestUrl)); var request = http.MultipartRequest(
'POST',
Uri.parse(AddAttendanceRequestUrl),
);
// Add basic fields that are always required // Add basic fields that are always required
Map<String, String> fields = { Map<String, String> fields = {
...@@ -5141,7 +5152,12 @@ class ApiCalling { ...@@ -5141,7 +5152,12 @@ class ApiCalling {
fields["check_in_loc"] = checkInLoc ?? ""; fields["check_in_loc"] = checkInLoc ?? "";
if (checkInProof != null) { if (checkInProof != null) {
request.files.add(await http.MultipartFile.fromPath("check_in_proof", checkInProof.path)); request.files.add(
await http.MultipartFile.fromPath(
"check_in_proof",
checkInProof.path,
),
);
} }
} }
...@@ -5151,7 +5167,12 @@ class ApiCalling { ...@@ -5151,7 +5167,12 @@ class ApiCalling {
fields["check_out_loc"] = checkOutLoc ?? ""; fields["check_out_loc"] = checkOutLoc ?? "";
if (checkOutProof != null) { if (checkOutProof != null) {
request.files.add(await http.MultipartFile.fromPath("check_out_proof", checkOutProof.path)); request.files.add(
await http.MultipartFile.fromPath(
"check_out_proof",
checkOutProof.path,
),
);
} }
} }
...@@ -5161,7 +5182,9 @@ class ApiCalling { ...@@ -5161,7 +5182,9 @@ class ApiCalling {
// Log the actual fields being sent // Log the actual fields being sent
debugPrint("addAttendanceRequestAPI - Type: $type"); debugPrint("addAttendanceRequestAPI - Type: $type");
debugPrint("addAttendanceRequestAPI - Fields: $fields"); debugPrint("addAttendanceRequestAPI - Fields: $fields");
debugPrint("addAttendanceRequestAPI - Files: ${request.files.map((f) => f.filename).toList()}"); debugPrint(
"addAttendanceRequestAPI - Files: ${request.files.map((f) => f.filename).toList()}",
);
var response = await request.send(); var response = await request.send();
var resBody = await response.stream.bytesToString(); var resBody = await response.stream.bytesToString();
...@@ -5179,14 +5202,8 @@ class ApiCalling { ...@@ -5179,14 +5202,8 @@ class ApiCalling {
} }
} }
//reward list //reward list
static Future<rewardListResponse?> rewardListAPI( static Future<rewardListResponse?> rewardListAPI(empId, session) async {
empId,
session,
) async {
try { try {
Map<String, String> data = { Map<String, String> data = {
'session_id': (session).toString(), 'session_id': (session).toString(),
...@@ -5209,10 +5226,10 @@ class ApiCalling { ...@@ -5209,10 +5226,10 @@ class ApiCalling {
//tour exp //tour exp
static Future<tourExpensesListResponse?> tourExpensesListAPI( static Future<tourExpensesListResponse?> tourExpensesListAPI(
empId, empId,
session, session,
pageNumber, pageNumber,
) async { ) async {
try { try {
Map<String, String> data = { Map<String, String> data = {
'session_id': (session).toString(), 'session_id': (session).toString(),
...@@ -5235,10 +5252,10 @@ class ApiCalling { ...@@ -5235,10 +5252,10 @@ class ApiCalling {
} }
static Future<tourExpensesDetailsResponse?> tourExpensesDetailAPI( static Future<tourExpensesDetailsResponse?> tourExpensesDetailAPI(
session, session,
empId, empId,
tourBillId, tourBillId,
) async { ) async {
try { try {
Map<String, String> data = { Map<String, String> data = {
'session_id': (session).toString(), 'session_id': (session).toString(),
...@@ -5261,10 +5278,10 @@ class ApiCalling { ...@@ -5261,10 +5278,10 @@ class ApiCalling {
} }
static Future<tourExpensesAddViewResponse?> tourExpensesAddViewAPI( static Future<tourExpensesAddViewResponse?> tourExpensesAddViewAPI(
empId, empId,
session, session,
tourBillId, tourBillId,
) async { ) async {
try { try {
Map<String, String> data = { Map<String, String> data = {
'session_id': (session).toString(), 'session_id': (session).toString(),
...@@ -5285,6 +5302,7 @@ class ApiCalling { ...@@ -5285,6 +5302,7 @@ class ApiCalling {
return null; return null;
} }
} }
static Future<CommonResponse?> addTourBillAPI({ static Future<CommonResponse?> addTourBillAPI({
required String sessionId, required String sessionId,
required String empId, required String empId,
...@@ -5300,7 +5318,10 @@ class ApiCalling { ...@@ -5300,7 +5318,10 @@ class ApiCalling {
List<File>? otherImages, List<File>? otherImages,
}) async { }) async {
try { try {
var request = http.MultipartRequest("POST", Uri.parse(AddTourExpensesUrl)); var request = http.MultipartRequest(
"POST",
Uri.parse(AddTourExpensesUrl),
);
/// Add text fields /// Add text fields
request.fields['session_id'] = sessionId; request.fields['session_id'] = sessionId;
...@@ -5320,10 +5341,7 @@ class ApiCalling { ...@@ -5320,10 +5341,7 @@ class ApiCalling {
for (var file in hotelImages) { for (var file in hotelImages) {
if (file.path.isNotEmpty) { if (file.path.isNotEmpty) {
request.files.add( request.files.add(
await http.MultipartFile.fromPath( await http.MultipartFile.fromPath("hotel_image[]", file.path),
"hotel_image[]",
file.path,
),
); );
} }
} }
...@@ -5334,10 +5352,7 @@ class ApiCalling { ...@@ -5334,10 +5352,7 @@ class ApiCalling {
for (var file in travelImages) { for (var file in travelImages) {
if (file.path.isNotEmpty) { if (file.path.isNotEmpty) {
request.files.add( request.files.add(
await http.MultipartFile.fromPath( await http.MultipartFile.fromPath("travel_image[]", file.path),
"travel_image[]",
file.path,
),
); );
} }
} }
...@@ -5348,14 +5363,12 @@ class ApiCalling { ...@@ -5348,14 +5363,12 @@ class ApiCalling {
for (var file in otherImages) { for (var file in otherImages) {
if (file.path.isNotEmpty) { if (file.path.isNotEmpty) {
request.files.add( request.files.add(
await http.MultipartFile.fromPath( await http.MultipartFile.fromPath("other_image[]", file.path),
"other_image[]",
file.path,
),
); );
} }
} }
} }
/// Send request /// Send request
var response = await request.send(); var response = await request.send();
var resBody = await response.stream.bytesToString(); var resBody = await response.stream.bytesToString();
...@@ -5375,18 +5388,15 @@ class ApiCalling { ...@@ -5375,18 +5388,15 @@ class ApiCalling {
} }
} }
// Leave Application api // Leave Application api
// Leave Application api // Leave Application api
static Future<leaveApplicationLIstResponse?> leaveApplicationListAPI( static Future<leaveApplicationLIstResponse?> leaveApplicationListAPI(
session, session,
empId, empId,
dateFrom, dateFrom,
dateTo, dateTo,
mode mode,
) async { ) async {
try { try {
Map<String, String> data = { Map<String, String> data = {
'session_id': (session).toString(), 'session_id': (session).toString(),
...@@ -5394,7 +5404,6 @@ class ApiCalling { ...@@ -5394,7 +5404,6 @@ class ApiCalling {
'requested_date_from': (dateFrom), 'requested_date_from': (dateFrom),
'requested_date_to': (dateTo), 'requested_date_to': (dateTo),
'mode': (mode), 'mode': (mode),
}; };
final res = await post(data, LeaveApplicationListUrl, {}); final res = await post(data, LeaveApplicationListUrl, {});
if (res != null) { if (res != null) {
...@@ -5412,10 +5421,10 @@ class ApiCalling { ...@@ -5412,10 +5421,10 @@ class ApiCalling {
} }
static Future<leaveApplicationDetailsResponse?> leaveApplicationDetailAPI( static Future<leaveApplicationDetailsResponse?> leaveApplicationDetailAPI(
session, session,
empId, empId,
leaveRequestId, leaveRequestId,
) async { ) async {
try { try {
Map<String, String> data = { Map<String, String> data = {
'session_id': (session).toString(), 'session_id': (session).toString(),
...@@ -5436,17 +5445,18 @@ class ApiCalling { ...@@ -5436,17 +5445,18 @@ class ApiCalling {
return null; return null;
} }
} }
//add leave request //add leave request
static Future<CommonResponse?> leaveRequestAddAPI( static Future<CommonResponse?> leaveRequestAddAPI(
session, session,
empId, empId,
fromDate, fromDate,
fromTime, fromTime,
toDate, toDate,
toTime, toTime,
leaveType, leaveType,
reason reason,
) async { ) async {
try { try {
Map<String, String> data = { Map<String, String> data = {
'session_id': (session).toString(), 'session_id': (session).toString(),
...@@ -5474,13 +5484,13 @@ class ApiCalling { ...@@ -5474,13 +5484,13 @@ class ApiCalling {
} }
static Future<CommonResponse?> leaveRequestRejectApproveAPI( static Future<CommonResponse?> leaveRequestRejectApproveAPI(
session, session,
empId, empId,
mode, mode,
type, type,
remarks, remarks,
id, id,
) async { ) async {
try { try {
Map<String, String> data = { Map<String, String> data = {
'session_id': (session).toString(), 'session_id': (session).toString(),
...@@ -5505,7 +5515,6 @@ class ApiCalling { ...@@ -5505,7 +5515,6 @@ class ApiCalling {
} }
} }
// static Future<CommonResponse?> TpcIssueListApprovalAPI( // static Future<CommonResponse?> TpcIssueListApprovalAPI(
// empId, // empId,
// session, // session,
......
...@@ -63,14 +63,14 @@ const addPaymentReceiptViewUrl = "${baseUrl_test}add_payment_receipt_view"; ...@@ -63,14 +63,14 @@ const addPaymentReceiptViewUrl = "${baseUrl_test}add_payment_receipt_view";
const addPaymentRequestionSubmitUrl = "${baseUrl_test}add_payment_requsition_submit"; const addPaymentRequestionSubmitUrl = "${baseUrl_test}add_payment_requsition_submit";
const addDirectPaymentRequestionSubmitUrl = "${baseUrl_test}add_direct_payment_submit"; const addDirectPaymentRequestionSubmitUrl = "${baseUrl_test}add_direct_payment_submit";
const addPaymentReceiptSubmitUrl = "${baseUrl_test}add_payment_receipt_submit"; const addPaymentReceiptSubmitUrl = "${baseUrl_test}add_payment_receipt_submit";
const paymentRequestionListUrl = "${baseUrl_test}payment_requsition_list"; const paymentRequestionListUrl = "${baseUrl_test}payment_requsition_list_v2";
const paymentRequestionDetailsUrl = "${baseUrl_test}payment_requisition_details"; const paymentRequestionDetailsUrl = "${baseUrl_test}payment_requisition_details";
const paymentRequestBankDetailsUrl = "${baseUrl_test}get_account_bank_details"; const paymentRequestBankDetailsUrl = "${baseUrl_test}get_account_bank_details";
const approveRejectPaymentRequestUrl = "${baseUrl_test}approve_reject_payment_request_view"; const approveRejectPaymentRequestUrl = "${baseUrl_test}approve_reject_payment_request_view";
const approveRejectPaymentRequestSubmitUrl = "${baseUrl_test}approve_reject_payment_request_submit"; const approveRejectPaymentRequestSubmitUrl = "${baseUrl_test}approve_reject_payment_request_submit";
const paymentRequesitionPaymentsListUrl = "${baseUrl_test}payment_requistion_payments_list"; const paymentRequesitionPaymentsListUrl = "${baseUrl_test}payment_requistion_payments_list_v2";
const paymentRequesitionPaymentsDetailsUrl = "${baseUrl_test}payment_requisition_payment_details"; const paymentRequesitionPaymentsDetailsUrl = "${baseUrl_test}payment_requisition_payment_details";
const paymentRequesitionPaymentsReceiptsListUrl = "${baseUrl_test}payment_receipts_list"; const paymentRequesitionPaymentsReceiptsListUrl = "${baseUrl_test}payment_receipts_list_v2";
const paymentRequesitionPaymentsReceiptsDetailsUrl = "${baseUrl_test}payment_receipt_details"; const paymentRequesitionPaymentsReceiptsDetailsUrl = "${baseUrl_test}payment_receipt_details";
const paymentRequesitionEditProcessedPaymentUrl = "${baseUrl_test}edit_processes_payment"; const paymentRequesitionEditProcessedPaymentUrl = "${baseUrl_test}edit_processes_payment";
...@@ -82,9 +82,9 @@ const commonAddAccountViewgetDistrictUrl = "${baseUrl_test}get_district_on_state ...@@ -82,9 +82,9 @@ const commonAddAccountViewgetDistrictUrl = "${baseUrl_test}get_district_on_state
const commonAddAccountViewgetSubLocationUrl = "${baseUrl_test}get_sublocation_on_district"; const commonAddAccountViewgetSubLocationUrl = "${baseUrl_test}get_sublocation_on_district";
const commonAddAccountCheckInputsUrl = "${baseUrl_test}check_common_add_account_fields"; const commonAddAccountCheckInputsUrl = "${baseUrl_test}check_common_add_account_fields";
const commonAddAccountSubmit = "${baseUrl_test}common_add_account_submit"; const commonAddAccountSubmit = "${baseUrl_test}common_add_account_submit";
const commonAccountListUrl = "${baseUrl_test}common_account_list"; const commonAccountListUrl = "${baseUrl_test}common_account_list_v2";
const commonAccountLedgerDropDownUrl = "${baseUrl_test}common_account_ledger_list_view"; const commonAccountLedgerDropDownUrl = "${baseUrl_test}common_account_ledger_list_view";
const commonAccountLedgerListWithFilterUrl = "${baseUrl_test}common_account_ledger_list_submit_filter"; const commonAccountLedgerListWithFilterUrl = "${baseUrl_test}common_account_ledger_list_submit_filter_v2";
const commonAccountLedgerAccountDetails = "${baseUrl_test}common_account_details"; const commonAccountLedgerAccountDetails = "${baseUrl_test}common_account_details";
///order Module ///order Module
...@@ -93,7 +93,7 @@ const ordersAccessibleAddPagesUrl = "${baseUrl_test}crm_add_order_accessible_pag ...@@ -93,7 +93,7 @@ const ordersAccessibleAddPagesUrl = "${baseUrl_test}crm_add_order_accessible_pag
const ordersDashboardUrl = "${baseUrl_test}order_dashboard"; const ordersDashboardUrl = "${baseUrl_test}order_dashboard";
const ordersPendingTasksListUrl = "${baseUrl_test}pending_tasks_list"; const ordersPendingTasksListUrl = "${baseUrl_test}pending_tasks_list";
const ordersOrderListByModeUrl = "${baseUrl_test}crm_order_list_view"; const ordersOrderListByModeUrl = "${baseUrl_test}crm_order_list_view";
const ordersOrderListFilterUrl = "${baseUrl_test}crm_order_list_filter_submit"; const ordersOrderListFilterUrl = "${baseUrl_test}crm_order_list_filter_submit_v2";
const ordersOrderApproveRejectUrl = "${baseUrl_test}approve_reject_crm_order"; const ordersOrderApproveRejectUrl = "${baseUrl_test}approve_reject_crm_order";
const ordersOrderLDeleteUrl = "${baseUrl_test}delete_crm_order"; const ordersOrderLDeleteUrl = "${baseUrl_test}delete_crm_order";
const ordersOrderDetailsUrl = "${baseUrl_test}crm_order_details"; const ordersOrderDetailsUrl = "${baseUrl_test}crm_order_details";
...@@ -115,7 +115,7 @@ const ordersEditPaymentDetailsAdjustedOrdersUrl ="${baseUrl_test}crm_payment_upd ...@@ -115,7 +115,7 @@ const ordersEditPaymentDetailsAdjustedOrdersUrl ="${baseUrl_test}crm_payment_upd
const ordersAddPaymentSelectAccountForOrderUrl ="${baseUrl_test}select_account_for_order_payment"; const ordersAddPaymentSelectAccountForOrderUrl ="${baseUrl_test}select_account_for_order_payment";
const ordersAddPaymentSelectOrderUrl ="${baseUrl_test}select_order_for_order_payment"; const ordersAddPaymentSelectOrderUrl ="${baseUrl_test}select_order_for_order_payment";
const ordersPaymentListFilterUrl = "${baseUrl_test}crm_payments_list_view"; const ordersPaymentListFilterUrl = "${baseUrl_test}crm_payments_list_view";
const ordersPaymentListByModeUrl = "${baseUrl_test}crm_payments_list_filter_submit"; const ordersPaymentListByModeUrl = "${baseUrl_test}crm_payments_list_filter_submit_v2";
const ordersPaymentListDeleteUrl = "${baseUrl_test}delete_crm_order_payment"; const ordersPaymentListDeleteUrl = "${baseUrl_test}delete_crm_order_payment";
const ordersVerifyOtpUrl = "${baseUrl_test}verify_otp_add_order"; const ordersVerifyOtpUrl = "${baseUrl_test}verify_otp_add_order";
const ordersResendOtpUrl = "${baseUrl_test}resend_otp_add_order"; const ordersResendOtpUrl = "${baseUrl_test}resend_otp_add_order";
...@@ -124,9 +124,9 @@ const ordersPaymentDetailsUrl = "${baseUrl_test}crm_payment_details"; ...@@ -124,9 +124,9 @@ const ordersPaymentDetailsUrl = "${baseUrl_test}crm_payment_details";
const ordersPaymentDetailsAddOrderUrl = "${baseUrl_test}crm_payment_add_adjusted_orders"; const ordersPaymentDetailsAddOrderUrl = "${baseUrl_test}crm_payment_add_adjusted_orders";
const ordersPaymentDetailsEditOrderUrl = "${baseUrl_test}crm_payment_edit_adjusted_orders"; const ordersPaymentDetailsEditOrderUrl = "${baseUrl_test}crm_payment_edit_adjusted_orders";
const ordersAddTPCAgentUrl = "${baseUrl_test}add_tpc_agent_submit"; const ordersAddTPCAgentUrl = "${baseUrl_test}add_tpc_agent_submit";
const ordersTPCAgentListUrl = "${baseUrl_test}tpc_agent_list"; const ordersTPCAgentListUrl = "${baseUrl_test}tpc_agent_list_v2";
const ordersTPCAgentDetailsUrl = "${baseUrl_test}tpc_agent_details"; const ordersTPCAgentDetailsUrl = "${baseUrl_test}tpc_agent_details";
const ordersPendingTPCIssueListUrl = "${baseUrl_test}pending_tpc_issue_list"; const ordersPendingTPCIssueListUrl = "${baseUrl_test}pending_tpc_issue_list_v2";
const ordersApprovePendingTPCIssueListUrl = "${baseUrl_test}update_pending_tpc_issue_list"; const ordersApprovePendingTPCIssueListUrl = "${baseUrl_test}update_pending_tpc_issue_list";
...@@ -156,7 +156,7 @@ const crmLeadDetailsGenerateQuotationViewUrl = "${baseUrl_test}crm_lead_details_ ...@@ -156,7 +156,7 @@ const crmLeadDetailsGenerateQuotationViewUrl = "${baseUrl_test}crm_lead_details_
const crmLeadDetailsGenerateQuotationSubmitUrl = "${baseUrl_test}crm_lead_details_generate_quotation_submit"; const crmLeadDetailsGenerateQuotationSubmitUrl = "${baseUrl_test}crm_lead_details_generate_quotation_submit";
const crmDownloadGeneratedQuotationUrl = "${baseUrl_test}download_generated_quotation_file"; const crmDownloadGeneratedQuotationUrl = "${baseUrl_test}download_generated_quotation_file";
const crmProspectListViewUrl = "${baseUrl_test}crm_prospect_list_view"; const crmProspectListViewUrl = "${baseUrl_test}crm_prospect_list_view";
const crmProspectListFilterSubmitUrl = "${baseUrl_test}crm_prospect_list_filter_submit"; const crmProspectListFilterSubmitUrl = "${baseUrl_test}crm_prospect_list_filter_submit_v2";
const crmProspectDetailsUrl = "${baseUrl_test}crm_prospect_details"; const crmProspectDetailsUrl = "${baseUrl_test}crm_prospect_details";
const crmProspectDetailsTransferAccountUrl = "${baseUrl_test}crm_prospect_details_transfer_account_submit"; const crmProspectDetailsTransferAccountUrl = "${baseUrl_test}crm_prospect_details_transfer_account_submit";
const crmProspectDetailsEditAccountViewUrl = "${baseUrl_test}crm_prospect_details_edit_account_view"; const crmProspectDetailsEditAccountViewUrl = "${baseUrl_test}crm_prospect_details_edit_account_view";
......
...@@ -5,16 +5,12 @@ import 'package:http/http.dart' as http; ...@@ -5,16 +5,12 @@ import 'package:http/http.dart' as http;
Future<http.Response?> post( Future<http.Response?> post(
Map<String, dynamic> Body, Map<String, dynamic> Body,
api_url, apiUrl,
Map<String, String> Headers, Map<String, String> Headers,
) async { ) async {
http.Response? response; http.Response? response;
try { try {
response = await http.post( response = await http.post(Uri.parse(apiUrl), headers: Headers, body: Body);
Uri.parse(api_url),
headers: Headers,
body: Body,
);
return response; return response;
} on Exception catch (e, s) { } on Exception catch (e, s) {
print(e); print(e);
...@@ -23,10 +19,10 @@ Future<http.Response?> post( ...@@ -23,10 +19,10 @@ Future<http.Response?> post(
return response; return response;
} }
Future<http.Response?> get(api_url, Map<String, String> Headers) async { Future<http.Response?> get(apiUrl, Map<String, String> Headers) async {
http.Response? response; http.Response? response;
try { try {
response = await http.get(Uri.parse(api_url), headers: Headers); response = await http.get(Uri.parse(apiUrl), headers: Headers);
return response; return response;
} on Exception catch (e, s) { } on Exception catch (e, s) {
print(e); print(e);
...@@ -158,13 +154,13 @@ Future<String?> postImageNew( ...@@ -158,13 +154,13 @@ Future<String?> postImageNew(
Map<String, String> headers, Map<String, String> headers,
String urlLink, String urlLink,
File image, File image,
req_field reqField,
) async { ) async {
try { try {
var req = http.MultipartRequest('POST', Uri.parse(urlLink)); var req = http.MultipartRequest('POST', Uri.parse(urlLink));
req.headers.addAll(headers?? {}); req.headers.addAll(headers ?? {});
req.files.add(await http.MultipartFile.fromPath(req_field, image.path)); req.files.add(await http.MultipartFile.fromPath(reqField, image.path));
req.fields.addAll(body?? {}); req.fields.addAll(body ?? {});
var res = await req.send(); var res = await req.send();
final resBody = await res.stream.bytesToString(); final resBody = await res.stream.bytesToString();
...@@ -185,16 +181,14 @@ Future<String?> postImageNew( ...@@ -185,16 +181,14 @@ Future<String?> postImageNew(
//hotel_image //hotel_image
//other_image //other_image
Future<String?> PostMultipleImagesNew( Future<String?> PostMultipleImagesNew(
Map<String, String> body, Map<String, String> body,
String urlLink, String urlLink,
Map<String, String> headers, Map<String, String> headers,
List<http.MultipartFile> newList, List<http.MultipartFile> newList,
List<http.MultipartFile> newList1, List<http.MultipartFile> newList1,
List<http.MultipartFile> newList2, List<http.MultipartFile> newList2,
) async { ) async {
try { try {
var req = http.MultipartRequest('POST', Uri.parse(urlLink)); var req = http.MultipartRequest('POST', Uri.parse(urlLink));
req.headers.addAll(headers); req.headers.addAll(headers);
...@@ -220,12 +214,12 @@ Future<String?> PostMultipleImagesNew( ...@@ -220,12 +214,12 @@ Future<String?> PostMultipleImagesNew(
} }
Future<String?> PostMultipleImagesNew2( Future<String?> PostMultipleImagesNew2(
Map<String, String> body, Map<String, String> body,
String urlLink, String urlLink,
Map<String, String> headers, Map<String, String> headers,
List<http.MultipartFile> newList, List<http.MultipartFile> newList,
List<http.MultipartFile> newList1, List<http.MultipartFile> newList1,
) async { ) async {
try { try {
var req = http.MultipartRequest('POST', Uri.parse(urlLink)); var req = http.MultipartRequest('POST', Uri.parse(urlLink));
req.headers.addAll(headers); req.headers.addAll(headers);
...@@ -249,9 +243,6 @@ Future<String?> PostMultipleImagesNew2( ...@@ -249,9 +243,6 @@ Future<String?> PostMultipleImagesNew2(
} }
} }
Future<String?> PostMultipleImages( Future<String?> PostMultipleImages(
Map<String, String> body, Map<String, String> body,
String urlLink, String urlLink,
......
...@@ -61,10 +61,10 @@ packages: ...@@ -61,10 +61,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: async name: async
sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.13.0" version: "2.12.0"
auto_size_text: auto_size_text:
dependency: "direct main" dependency: "direct main"
description: description:
...@@ -445,10 +445,10 @@ packages: ...@@ -445,10 +445,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: fake_async name: fake_async
sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.3.3" version: "1.3.2"
ffi: ffi:
dependency: transitive dependency: transitive
description: description:
...@@ -1180,26 +1180,26 @@ packages: ...@@ -1180,26 +1180,26 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: leak_tracker name: leak_tracker
sha256: "8dcda04c3fc16c14f48a7bb586d4be1f0d1572731b6d81d51772ef47c02081e0" sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "11.0.1" version: "10.0.8"
leak_tracker_flutter_testing: leak_tracker_flutter_testing:
dependency: transitive dependency: transitive
description: description:
name: leak_tracker_flutter_testing name: leak_tracker_flutter_testing
sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.0.10" version: "3.0.9"
leak_tracker_testing: leak_tracker_testing:
dependency: transitive dependency: transitive
description: description:
name: leak_tracker_testing name: leak_tracker_testing
sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.0.2" version: "3.0.1"
lints: lints:
dependency: transitive dependency: transitive
description: description:
...@@ -2017,10 +2017,10 @@ packages: ...@@ -2017,10 +2017,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: vm_service name: vm_service
sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02 sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "15.0.0" version: "14.3.1"
watcher: watcher:
dependency: transitive dependency: transitive
description: description:
......
...@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev ...@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts # In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix. # of the product and file versions while build-number is used as the build suffix.
version: 1.0.103+111 version: 1.0.104+112
environment: environment:
sdk: ^3.7.2 sdk: ^3.7.2
......
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