Commit a7dc0d35 authored by Sai Srinivas's avatar Sai Srinivas
Browse files

21-06-2025 By Sai Srinivas

test cases and CRM module Lead list and details
parent b8ffa919
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:provider/provider.dart';
import '../../Notifiers/crmProvider/crmLeadDetailsProvider.dart';
import '../../Utils/app_colors.dart';
import '../../Utils/commonWidgets.dart';
class Contactdetails extends StatefulWidget {
const Contactdetails({super.key});
@override
State<Contactdetails> createState() => _ContactdetailsState();
}
class _ContactdetailsState extends State<Contactdetails> {
@override
Widget build(BuildContext context) {
return Consumer<crmLeadDetailsProvider>(
builder: (context, provider, child) {
var customerDetails = provider.contactDetails;
return WillPopScope(
onWillPop: () => onBackPressed(context),
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar(context, "Contact Details"),
backgroundColor: AppColors.scaffold_bg_color,
body: SafeArea(
child: SizedBox(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
TextWidget(context,"Contact Details"),
ListView.builder(
itemCount: customerDetails.length,
shrinkWrap: true,
itemBuilder: (context, index) {
return Container(
margin: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
padding: EdgeInsets.symmetric(horizontal: 15, vertical: 10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Expanded(
flex: 1,
child: Container(
height: 50,
width: 35,
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Color(0xFFE6F6FF),
borderRadius: BorderRadius.circular(8),
),
child: SvgPicture.asset(
"assets/svg/se_block_head.svg",
),
),
),
SizedBox(width: 10),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
customerDetails[index].name ?? "-",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
),
),
],
),
),
),
],
),
Divider(thickness: 0.5, color: Color(0xFFD7D7D7)),
...List.generate(5, (j) {
final textheads = [
"Mobile",
"Alternate Mobile",
"Telephone Number",
"Email",
"Designation"
];
final textSubheads = [
customerDetails[index].mob1??"-",
customerDetails[index].mob2??"-",
customerDetails[index].tel??"-",
customerDetails[index].email??"-",
customerDetails[index].designation??"-",
];
return Container(
padding: EdgeInsets.symmetric(
vertical: 6,
horizontal: 0,
),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Expanded(
flex:2,
child: Text(textheads[j].toString(),
maxLines: 2,
overflow: TextOverflow.ellipsis,),
),
Expanded(
flex: 3,
child: Text(
textSubheads[j],
maxLines: 2,
overflow:
TextOverflow.ellipsis,
style: TextStyle(
color: Color(0xFF818181),
),
),
),
],
),
);
})],
),
);
}
),
SizedBox(height: 75),
],
),
),
),
),
floatingActionButton: Align(
alignment: Alignment.bottomCenter,
child: InkWell(
child: Container(
alignment: Alignment.bottomCenter,
height: 45,
width: MediaQuery.of(context).size.width,
margin: EdgeInsets.symmetric(horizontal: 10),
decoration: BoxDecoration(
color: AppColors.app_blue,
borderRadius: BorderRadius.circular(14.0),
),
child: Center(
child: Text(
"Followup Details",
textAlign: TextAlign.center,
style: TextStyle(color: Colors.white,
fontFamily: "JakartaMedium"),
),
),
),
),
),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
),
);
},
);
}
}
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:provider/provider.dart';
import '../../Notifiers/crmProvider/crmDashboardProvider.dart';
import '../../Utils/app_colors.dart';
import '../../Utils/commonWidgets.dart';
import 'LeadListByMode.dart';
class CrmdashboardScreen extends StatefulWidget { class CrmdashboardScreen extends StatefulWidget {
const CrmdashboardScreen({super.key}); const CrmdashboardScreen({super.key});
...@@ -8,8 +15,208 @@ class CrmdashboardScreen extends StatefulWidget { ...@@ -8,8 +15,208 @@ class CrmdashboardScreen extends StatefulWidget {
} }
class _CrmdashboardScreenState extends State<CrmdashboardScreen> { class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
var prov = Provider.of<Crmdashboardprovider>(context, listen: false);
prov.accessPagesAPIFunction(context);
});
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return const Placeholder(); return Consumer<Crmdashboardprovider>(
builder: (context, provider, child) {
final gridPages =
provider.accessPages
.where((page) => ![8, 9, 23, 24].contains(page.id))
.toList();
return WillPopScope(
onWillPop: () => onBackPressed(context),
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar(context, "CRM"),
body: SafeArea(
child: ListView.builder(
padding: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
itemCount: gridPages.length,
itemBuilder: (context, index) {
// final icons = ["comm_ic_1", "comm_ic_2"];
Widget? SvgIcon;
if (gridPages[index].pageName!.contains("Lead List")) {
SvgIcon = SvgPicture.asset("assets/svg/fin_lv1.svg");
} else {
SvgIcon = SvgPicture.asset("assets/svg/fin_ic.svg");
}
return InkResponse(
onTap: () {
print(gridPages[index].pageName!);
if (gridPages[index].pageName!.contains("Lead List")) {
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => Leadlistbymode(
mode: gridPages[index].mode,
pageTitleName: gridPages[index].pageName,
),
),
);
} else {}
// switch (gridPages[index].pageName!) {
// case "Lead List":
// Navigator.push(
// context,
// MaterialPageRoute(builder: (context) => Leadlistbymode()),
// );
// break;
// case "Prospect List":
// // Navigator.push(
// // context,
// // MaterialPageRoute(builder: (context) => Accountledger()),
// // );
// break;
//
// default:
// print("111");
// break;
// }
},
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(14),
),
margin: EdgeInsets.symmetric(horizontal: 5, vertical: 5),
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 15,
),
child: Row(
children: [
Expanded(flex: 1, child: SvgIcon),
Expanded(
flex: 5,
child: Text(
"${gridPages[index].pageName}",
style: TextStyle(fontSize: 14),
),
),
Expanded(
flex: 1,
child: SvgPicture.asset(
"assets/svg/arrow_right_new.svg",
),
),
],
),
),
);
},
),
),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
floatingActionButton: InkResponse(
onTap: () {
_showPaymentOptionsSheet(context);
},
child: Container(
height: 45,
alignment: Alignment.center,
margin: EdgeInsets.symmetric(horizontal: 10),
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
decoration: BoxDecoration(
color: AppColors.app_blue,
borderRadius: BorderRadius.circular(15),
),
child: Text(
"Add Leads and Prospect",
style: TextStyle(
fontSize: 15,
fontFamily: "JakartaMedium",
color: Colors.white,
),
),
),
),
),
);
},
);
}
Future<void> _showPaymentOptionsSheet(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<Crmdashboardprovider>(
builder: (context, provider, child) {
final accessiblePagesList =
provider.accessPages
.where((page) => [8, 9].contains(page.id))
.toList();
return Container(
margin: EdgeInsets.only(
bottom: 15,
left: 15,
right: 15,
top: 10,
),
child: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
SizedBox(height: 15),
...List.generate(accessiblePagesList.length, (index) {
print(accessiblePagesList[index].mode);
return ListTile(
onTap: () async {
Navigator.pop(context);
var res;
},
leading: SvgPicture.asset(
"assets/svg/fin_ic.svg",
),
title: Text(
"${accessiblePagesList[index].pageName}",
style: TextStyle(
fontSize: 14,
fontFamily: "JakartaMedium",
),
),
trailing: SvgPicture.asset(
"assets/svg/arrow_right_new.svg",
),
);
}),
],
),
),
);
},
),
);
},
);
},
);
} }
} }
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:provider/provider.dart';
import '../../Notifiers/crmProvider/crmLeadDetailsProvider.dart';
import '../../Utils/app_colors.dart';
import '../../Utils/commonWidgets.dart';
class Productdetails extends StatefulWidget {
const Productdetails({super.key});
@override
State<Productdetails> createState() => _ProductdetailsState();
}
class _ProductdetailsState extends State<Productdetails> {
@override
Widget build(BuildContext context) {
return Consumer<crmLeadDetailsProvider>(
builder: (context, provider, child) {
var customerDetails = provider.leadProducts;
return WillPopScope(
onWillPop: () => onBackPressed(context),
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar(context, "Product Details"),
backgroundColor: AppColors.scaffold_bg_color,
body: SafeArea(
child: SizedBox(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
TextWidget(context,"Product Details"),
ListView.builder(
itemCount: customerDetails.length,
shrinkWrap: true,
itemBuilder: (context, index) {
return Container(
margin: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
padding: EdgeInsets.symmetric(horizontal: 15, vertical: 10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: List.generate(4, (j) {
final textheads = [
"Product Name",
"Product Price",
"Quantity",
"Total Price"
];
final textSubheads = [
customerDetails[index].productName??"-",
customerDetails[index].price??"-",
customerDetails[index].qty??"-",
customerDetails[index].price??"-",
];
return Container(
padding: EdgeInsets.symmetric(
vertical: 6,
horizontal: 0,
),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Expanded(
flex:2,
child: Text(textheads[j].toString(),
maxLines: 2,
overflow: TextOverflow.ellipsis,),
),
Expanded(
flex: 3,
child: Text(
textSubheads[j],
maxLines: 2,
overflow:
TextOverflow.ellipsis,
style: TextStyle(
color: Color(0xFF818181),
),
),
),
],
),
);
}),
),
);
}
),
SizedBox(height: 75),
],
),
),
),
),
floatingActionButton: Align(
alignment: Alignment.bottomCenter,
child: InkWell(
child: Container(
alignment: Alignment.bottomCenter,
height: 45,
width: MediaQuery.of(context).size.width,
margin: EdgeInsets.symmetric(horizontal: 10),
decoration: BoxDecoration(
color: AppColors.app_blue,
borderRadius: BorderRadius.circular(14.0),
),
child: Center(
child: Text(
"Followup Details",
textAlign: TextAlign.center,
style: TextStyle(color: Colors.white,
fontFamily: "JakartaMedium"),
),
),
),
),
),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
),
);
},
);
}
}
import 'package:dropdown_button2/dropdown_button2.dart'; import 'package:dropdown_button2/dropdown_button2.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
...@@ -32,21 +31,25 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> { ...@@ -32,21 +31,25 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
}); });
} }
@override @override
void dispose() { void dispose() {
super.dispose(); super.dispose();
} }
Future<bool> _onBackPressed(BuildContext context) async {
Navigator.pop(context, true);
return true;
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Consumer<Paymentreceiptsprovider>( return Consumer<Paymentreceiptsprovider>(
builder: (context, provider, child) { builder: (context, provider, child) {
return WillPopScope( return PopScope(
canPop: true,
onPopInvoked: (didPop) async {
if (!didPop) {
provider.resetForm();
await onBackPressed(context);
}
},
child: Scaffold( child: Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
backgroundColor: AppColors.white, backgroundColor: AppColors.white,
...@@ -70,7 +73,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> { ...@@ -70,7 +73,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
child: DropdownButton2<Accounts>( child: DropdownButton2<Accounts>(
isExpanded: true, isExpanded: true,
hint: Text( hint: Text(
'Select Account Type', 'Select Account',
style: TextStyle(fontSize: 14), style: TextStyle(fontSize: 14),
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
...@@ -107,6 +110,40 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> { ...@@ -107,6 +110,40 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
} }
} }
}, },
dropdownSearchData: DropdownSearchData(
searchInnerWidgetHeight: 50,
searchController: provider.accountSearchController,
searchInnerWidget: Padding(
padding: const EdgeInsets.all(8),
child: TextFormField(
controller: provider.accountSearchController,
decoration: InputDecoration(
isDense: true,
contentPadding: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 8,
),
hintText: 'Search account...',
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
),
),
),
),
searchMatchFn: (item, searchValue) {
return item.value?.name
?.toLowerCase()
.contains(searchValue.toLowerCase()) ??
false;
},
// Optional: clear search text when dropdown closes
),
onMenuStateChange: (isOpen) {
if (!isOpen) {
provider.accountSearchController.clear();
}
},
buttonStyleData: ButtonStyleData( buttonStyleData: ButtonStyleData(
height: 50, height: 50,
width: 160, width: 160,
...@@ -158,7 +195,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> { ...@@ -158,7 +195,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
child: DropdownButton2<ReceiptAccounts>( child: DropdownButton2<ReceiptAccounts>(
isExpanded: true, isExpanded: true,
hint: Text( hint: Text(
'Select Account Type', 'Select Account',
style: TextStyle(fontSize: 14), style: TextStyle(fontSize: 14),
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
...@@ -202,6 +239,40 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> { ...@@ -202,6 +239,40 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
} }
} }
}, },
dropdownSearchData: DropdownSearchData(
searchInnerWidgetHeight: 50,
searchController: provider.paymentAccountSearchController,
searchInnerWidget: Padding(
padding: const EdgeInsets.all(8),
child: TextFormField(
controller: provider.paymentAccountSearchController,
decoration: InputDecoration(
isDense: true,
contentPadding: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 8,
),
hintText: 'Search account...',
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
),
),
),
),
searchMatchFn: (item, searchValue) {
return item.value?.name
?.toLowerCase()
.contains(searchValue.toLowerCase()) ??
false;
},
// Optional: clear search text when dropdown closes
),
onMenuStateChange: (isOpen) {
if (!isOpen) {
provider.paymentAccountSearchController.clear();
}
},
buttonStyleData: ButtonStyleData( buttonStyleData: ButtonStyleData(
height: 50, height: 50,
width: 160, width: 160,
...@@ -544,69 +615,65 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> { ...@@ -544,69 +615,65 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
), ),
), ),
), ),
onWillPop: () async {
provider.resetForm();
return _onBackPressed(context);
},
); );
}, },
); );
} }
void _showDialog(Widget child) { // void _showDialog(Widget child) {
showCupertinoModalPopup<void>( // showCupertinoModalPopup<void>(
context: context, // context: context,
builder: (BuildContext context) => Container( // builder: (BuildContext context) => Container(
height: 216, // height: 216,
padding: const EdgeInsets.only(top: 6.0), // padding: const EdgeInsets.only(top: 6.0),
// The Bottom margin is provided to align the popup above the system // // The Bottom margin is provided to align the popup above the system
// navigation bar. // // navigation bar.
margin: EdgeInsets.only( // margin: EdgeInsets.only(
bottom: MediaQuery.of(context).viewInsets.bottom, // bottom: MediaQuery.of(context).viewInsets.bottom,
), // ),
// Provide a background color for the popup. // // Provide a background color for the popup.
color: CupertinoColors.systemBackground.resolveFrom(context), // color: CupertinoColors.systemBackground.resolveFrom(context),
// Use a SafeArea widget to avoid system overlaps. // // Use a SafeArea widget to avoid system overlaps.
child: SafeArea( // child: SafeArea(
top: false, // top: false,
child: Column( // child: Column(
children: [ // children: [
Expanded( // Expanded(
flex: 1, // flex: 1,
child: SizedBox( // child: SizedBox(
height: 40, // height: 40,
child: Row( // child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, // mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ // children: [
// Add a Cancel button (optional) // // Add a Cancel button (optional)
CupertinoButton( // CupertinoButton(
child: Text( // child: Text(
'Cancel', // 'Cancel',
style: TextStyle(fontFamily: "JakartaMedium"), // style: TextStyle(fontFamily: "JakartaMedium"),
), // ),
onPressed: () { // onPressed: () {
Navigator.pop(context); // Navigator.pop(context);
}, // },
), // ),
// Add a Done button // // Add a Done button
CupertinoButton( // CupertinoButton(
child: Text('Done', // child: Text('Done',
style: TextStyle(fontFamily: "JakartaMedium")), // style: TextStyle(fontFamily: "JakartaMedium")),
onPressed: () { // onPressed: () {
Navigator.pop(context); // Dismiss the dialog // Navigator.pop(context); // Dismiss the dialog
}, // },
), // ),
], // ],
), // ),
), // ),
), // ),
Expanded(flex: 3, child: child), // Expanded(flex: 3, child: child),
], // ],
), // ),
), // ),
), // ),
); // );
} // }
Future<void> _showAttachmentSheet(BuildContext context) { Future<void> _showAttachmentSheet(BuildContext context) {
......
...@@ -74,7 +74,7 @@ class _DirectpaymentrequesitionlistState ...@@ -74,7 +74,7 @@ class _DirectpaymentrequesitionlistState
child: DropdownButton2<DirectAccounts>( child: DropdownButton2<DirectAccounts>(
isExpanded: true, isExpanded: true,
hint: Text( hint: Text(
'Select Account Type', 'Select Account',
style: TextStyle(fontSize: 14), style: TextStyle(fontSize: 14),
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
...@@ -111,6 +111,40 @@ class _DirectpaymentrequesitionlistState ...@@ -111,6 +111,40 @@ class _DirectpaymentrequesitionlistState
} }
} }
}, },
dropdownSearchData: DropdownSearchData(
searchInnerWidgetHeight: 50,
searchController: provider.accountSearchController,
searchInnerWidget: Padding(
padding: const EdgeInsets.all(8),
child: TextFormField(
controller: provider.accountSearchController,
decoration: InputDecoration(
isDense: true,
contentPadding: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 8,
),
hintText: 'Search account...',
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
),
),
),
),
searchMatchFn: (item, searchValue) {
return item.value?.name
?.toLowerCase()
.contains(searchValue.toLowerCase()) ??
false;
},
// Optional: clear search text when dropdown closes
),
onMenuStateChange: (isOpen) {
if (!isOpen) {
provider.accountSearchController.clear();
}
},
buttonStyleData: ButtonStyleData( buttonStyleData: ButtonStyleData(
height: 50, height: 50,
width: 160, width: 160,
...@@ -157,6 +191,9 @@ class _DirectpaymentrequesitionlistState ...@@ -157,6 +191,9 @@ class _DirectpaymentrequesitionlistState
], ],
), ),
), ),
errorWidget(context, provider.selectDirectAccountError), errorWidget(context, provider.selectDirectAccountError),
TextWidget(context, "Payment Account"), TextWidget(context, "Payment Account"),
DropdownButtonHideUnderline( DropdownButtonHideUnderline(
...@@ -210,6 +247,40 @@ class _DirectpaymentrequesitionlistState ...@@ -210,6 +247,40 @@ class _DirectpaymentrequesitionlistState
} }
} }
}, },
dropdownSearchData: DropdownSearchData(
searchInnerWidgetHeight: 50,
searchController: provider.paymentAccountSearchController,
searchInnerWidget: Padding(
padding: const EdgeInsets.all(8),
child: TextFormField(
controller: provider.paymentAccountSearchController,
decoration: InputDecoration(
isDense: true,
contentPadding: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 8,
),
hintText: 'Search account...',
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
),
),
),
),
searchMatchFn: (item, searchValue) {
return item.value?.name
?.toLowerCase()
.contains(searchValue.toLowerCase()) ??
false;
},
// Optional: clear search text when dropdown closes
),
onMenuStateChange: (isOpen) {
if (!isOpen) {
provider.paymentAccountSearchController.clear();
}
},
buttonStyleData: ButtonStyleData( buttonStyleData: ButtonStyleData(
height: 50, height: 50,
width: 160, width: 160,
......
...@@ -76,7 +76,7 @@ class _SubmitpaymentrequestionlistsbymodeState ...@@ -76,7 +76,7 @@ class _SubmitpaymentrequestionlistsbymodeState
child: DropdownButton2<Accounts>( child: DropdownButton2<Accounts>(
isExpanded: true, isExpanded: true,
hint: Text( hint: Text(
'Select Account Type', 'Select Account',
style: TextStyle(fontSize: 14), style: TextStyle(fontSize: 14),
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
...@@ -86,7 +86,7 @@ class _SubmitpaymentrequestionlistsbymodeState ...@@ -86,7 +86,7 @@ class _SubmitpaymentrequestionlistsbymodeState
(accs) => DropdownMenuItem<Accounts>( (accs) => DropdownMenuItem<Accounts>(
value: accs, value: accs,
child: Text( child: Text(
accs.name ?? '', "${accs.name}",
style: const TextStyle( style: const TextStyle(
fontSize: 14, fontSize: 14,
), ),
...@@ -115,6 +115,40 @@ class _SubmitpaymentrequestionlistsbymodeState ...@@ -115,6 +115,40 @@ class _SubmitpaymentrequestionlistsbymodeState
} }
} }
}, },
dropdownSearchData: DropdownSearchData(
searchInnerWidgetHeight: 50,
searchController: provider.accountSearchController,
searchInnerWidget: Padding(
padding: const EdgeInsets.all(8),
child: TextFormField(
controller: provider.accountSearchController,
decoration: InputDecoration(
isDense: true,
contentPadding: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 8,
),
hintText: 'Search account...',
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
),
),
),
),
searchMatchFn: (item, searchValue) {
return item.value?.name
?.toLowerCase()
.contains(searchValue.toLowerCase()) ??
false;
},
// Optional: clear search text when dropdown closes
),
onMenuStateChange: (isOpen) {
if (!isOpen) {
provider.accountSearchController.clear();
}
},
buttonStyleData: ButtonStyleData( buttonStyleData: ButtonStyleData(
height: 50, height: 50,
width: 160, width: 160,
...@@ -455,7 +489,7 @@ class _SubmitpaymentrequestionlistsbymodeState ...@@ -455,7 +489,7 @@ class _SubmitpaymentrequestionlistsbymodeState
] else if (provider.paymentModeValue == "UPI") ...[ ] else if (provider.paymentModeValue == "UPI") ...[
textControllerWidget( textControllerWidget(
context, context,
provider.amountController, provider.bankUpiController,
"Enter UPI ID", "Enter UPI ID",
provider.updateUPI,TextInputType.text,false,null provider.updateUPI,TextInputType.text,false,null
), ),
...@@ -485,7 +519,7 @@ class _SubmitpaymentrequestionlistsbymodeState ...@@ -485,7 +519,7 @@ class _SubmitpaymentrequestionlistsbymodeState
color:AppColors.app_blue, color:AppColors.app_blue,
borderRadius: BorderRadius.circular(15), borderRadius: BorderRadius.circular(15),
), ),
child:provider.submitClicked?CircularProgressIndicator.adaptive(valueColor: AlwaysStoppedAnimation(AppColors.app_blue),): Text( child:provider.submitClicked?CircularProgressIndicator.adaptive(valueColor: AlwaysStoppedAnimation(AppColors.white),): Text(
"Submit", "Submit",
style: TextStyle( style: TextStyle(
fontSize: 15, fontSize: 15,
......
...@@ -40,4 +40,7 @@ export 'package:generp/Notifiers/ordersProvider/addPaymentProvider.dart'; ...@@ -40,4 +40,7 @@ export 'package:generp/Notifiers/ordersProvider/addPaymentProvider.dart';
export 'package:generp/Notifiers/ordersProvider/addOrderProvider.dart'; export 'package:generp/Notifiers/ordersProvider/addOrderProvider.dart';
export 'package:generp/Notifiers/ordersProvider/editPaymentProvider.dart'; export 'package:generp/Notifiers/ordersProvider/editPaymentProvider.dart';
export 'package:generp/Notifiers/crmProvider/crmDashboardProvider.dart';
export 'package:generp/Notifiers/crmProvider/LeadListProvider.dart'; export 'package:generp/Notifiers/crmProvider/LeadListProvider.dart';
export 'package:generp/Notifiers/crmProvider/crmLeadDetailsProvider.dart';
...@@ -3,6 +3,7 @@ export 'package:generp/screens/WebERPIOS.dart'; ...@@ -3,6 +3,7 @@ export 'package:generp/screens/WebERPIOS.dart';
export "package:generp/screens/WebERPScreen.dart"; export "package:generp/screens/WebERPScreen.dart";
export "package:generp/screens/WebWhizzdomScreen.dart"; export "package:generp/screens/WebWhizzdomScreen.dart";
export 'AttendanceScreen.dart';
export 'package:generp/screens/finance/financeDashboard.dart'; export 'package:generp/screens/finance/financeDashboard.dart';
export 'package:generp/screens/genTracker/GenTrackerDashboard.dart'; export 'package:generp/screens/genTracker/GenTrackerDashboard.dart';
export 'package:generp/screens/genTracker/GeneratorDetails.dart'; export 'package:generp/screens/genTracker/GeneratorDetails.dart';
...@@ -30,6 +31,7 @@ export 'package:generp/screens/finance/paymentListPaymentRequisition.dart'; ...@@ -30,6 +31,7 @@ export 'package:generp/screens/finance/paymentListPaymentRequisition.dart';
export 'package:generp/screens/finance/paymentreceiptList.dart'; export 'package:generp/screens/finance/paymentreceiptList.dart';
export 'package:generp/screens/finance/submitPaymentRequestionListsByMode.dart'; export 'package:generp/screens/finance/submitPaymentRequestionListsByMode.dart';
export 'package:generp/screens/order/orderModuleDashboard.dart';
export 'package:generp/screens/order/addPayment.dart'; export 'package:generp/screens/order/addPayment.dart';
export 'package:generp/screens/order/addOrder.dart'; export 'package:generp/screens/order/addOrder.dart';
export 'package:generp/screens/order/ordersListByModes.dart'; export 'package:generp/screens/order/ordersListByModes.dart';
...@@ -40,3 +42,5 @@ export 'package:generp/screens/order/orderDetailsFeedbackHistory.dart'; ...@@ -40,3 +42,5 @@ export 'package:generp/screens/order/orderDetailsFeedbackHistory.dart';
export 'package:generp/screens/order/orderDetailsPaymentHistory.dart'; export 'package:generp/screens/order/orderDetailsPaymentHistory.dart';
export 'package:generp/screens/order/orderDetailsProductsHistory.dart'; export 'package:generp/screens/order/orderDetailsProductsHistory.dart';
export 'package:generp/screens/crm/crmDashboard.dart';
...@@ -20,7 +20,7 @@ class _UpdatecomplaintsState extends State<Updatecomplaints> { ...@@ -20,7 +20,7 @@ class _UpdatecomplaintsState extends State<Updatecomplaints> {
void initState() { void initState() {
// TODO: implement initState // TODO: implement initState
super.initState(); super.initState();
WidgetsBinding.instance.addPostFrameCallback((timeStamp) { WidgetsBinding.instance.addPostFrameCallback((_) {
final provider = Provider.of<Pendingcomplaintsprovider>(context,listen: false); final provider = Provider.of<Pendingcomplaintsprovider>(context,listen: false);
provider.checkDropDownSelected(); provider.checkDropDownSelected();
},); },);
...@@ -95,7 +95,7 @@ class _UpdatecomplaintsState extends State<Updatecomplaints> { ...@@ -95,7 +95,7 @@ class _UpdatecomplaintsState extends State<Updatecomplaints> {
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
)).toList(), )).toList(),
value: provider.statusID!.isEmpty ? null : provider.statusID, value: provider.statusID,
onChanged: (value) { onChanged: (value) {
if (value != null) { if (value != null) {
provider.statusID = value; provider.statusID = value;
......
...@@ -6,6 +6,7 @@ import 'package:generp/Models/commonModels/DistrictsResponse.dart'; ...@@ -6,6 +6,7 @@ import 'package:generp/Models/commonModels/DistrictsResponse.dart';
import 'package:generp/Models/commonModels/SubLocationsResponse.dart'; import 'package:generp/Models/commonModels/SubLocationsResponse.dart';
import 'package:generp/Models/commonModels/commonAccessiblePagesResponse.dart'; import 'package:generp/Models/commonModels/commonAccessiblePagesResponse.dart';
import 'package:generp/Models/commonModels/commonAddAccountsViewResponse.dart'; import 'package:generp/Models/commonModels/commonAddAccountsViewResponse.dart';
import 'package:generp/Models/crmModels/AccessiblePagesResponse.dart';
import 'package:generp/Models/crmModels/GetDistrictOnStateResponse.dart'; import 'package:generp/Models/crmModels/GetDistrictOnStateResponse.dart';
import 'package:generp/Models/crmModels/GetSegmentOnTeamResponse.dart'; import 'package:generp/Models/crmModels/GetSegmentOnTeamResponse.dart';
import 'package:generp/Models/crmModels/GetSourceOnReferenceResponse.dart'; import 'package:generp/Models/crmModels/GetSourceOnReferenceResponse.dart';
...@@ -57,6 +58,7 @@ import '../Models/commonModels/commonAccountLedgerFilterResponse.dart'; ...@@ -57,6 +58,7 @@ import '../Models/commonModels/commonAccountLedgerFilterResponse.dart';
import '../Models/commonModels/commonAccountLedgerResponse.dart'; import '../Models/commonModels/commonAccountLedgerResponse.dart';
import '../Models/commonModels/commonAccountdetailsResponse.dart'; import '../Models/commonModels/commonAccountdetailsResponse.dart';
import '../Models/commonModels/commonAccountlistResponse.dart'; import '../Models/commonModels/commonAccountlistResponse.dart';
import '../Models/crmModels/LeadDetailsResponse.dart';
import '../Models/financeModels/addPaymentRequestionResponse.dart'; import '../Models/financeModels/addPaymentRequestionResponse.dart';
import '../Models/financeModels/addReceiptPaymentResponse.dart'; import '../Models/financeModels/addReceiptPaymentResponse.dart';
import '../Models/financeModels/paymentRequesitionListsResponse.dart'; import '../Models/financeModels/paymentRequesitionListsResponse.dart';
...@@ -1266,7 +1268,7 @@ class ApiCalling { ...@@ -1266,7 +1268,7 @@ class ApiCalling {
} }
} }
static Future<addReceiptPaymentResponse?> addPaymentRequestionSubmitAPI( static Future<CommonResponse?> addPaymentRequestionSubmitAPI(
emp_id, emp_id,
session_id, session_id,
type, type,
...@@ -1303,6 +1305,7 @@ class ApiCalling { ...@@ -1303,6 +1305,7 @@ class ApiCalling {
var res; var res;
if (attachment != null) { if (attachment != null) {
res = await postImageNew( res = await postImageNew(
data, data,
{}, {},
...@@ -1311,10 +1314,11 @@ class ApiCalling { ...@@ -1311,10 +1314,11 @@ class ApiCalling {
"attachment", "attachment",
); );
res = jsonDecode(res); res = jsonDecode(res);
return CommonResponse.fromJson(res);
} else { } else {
res = await post(data, addPaymentRequestionSubmitUrl, {}); res = await post(data, addPaymentRequestionSubmitUrl, {});
res = jsonDecode(res.body); res = jsonDecode(res.body);
return addReceiptPaymentResponse.fromJson(res); return CommonResponse.fromJson(res);
} }
if (res != null) { if (res != null) {
return res; return res;
...@@ -1376,6 +1380,7 @@ class ApiCalling { ...@@ -1376,6 +1380,7 @@ class ApiCalling {
"attachment", "attachment",
); );
res = jsonDecode(res); res = jsonDecode(res);
return addDirectPaymentResponse.fromJson(res);
} else { } else {
res = await post(data, addDirectPaymentRequestionSubmitUrl, {}); res = await post(data, addDirectPaymentRequestionSubmitUrl, {});
res = jsonDecode(res.body); res = jsonDecode(res.body);
...@@ -1442,6 +1447,7 @@ class ApiCalling { ...@@ -1442,6 +1447,7 @@ class ApiCalling {
"attachment", "attachment",
); );
res = jsonDecode(res); res = jsonDecode(res);
return addReceiptPaymentResponse.fromJson(res);
} else { } else {
res = await post(data, addPaymentReceiptSubmitUrl, {}); res = await post(data, addPaymentReceiptSubmitUrl, {});
res = jsonDecode(res.body); res = jsonDecode(res.body);
...@@ -1524,6 +1530,7 @@ class ApiCalling { ...@@ -1524,6 +1530,7 @@ class ApiCalling {
}; };
final res = await post(data, approveRejectPaymentRequestUrl, {}); final res = await post(data, approveRejectPaymentRequestUrl, {});
if (res != null) { if (res != null) {
print(data);
debugPrint(res.body); debugPrint(res.body);
return approveRejectPaymentRequestResponse.fromJson( return approveRejectPaymentRequestResponse.fromJson(
jsonDecode(res.body), jsonDecode(res.body),
...@@ -1557,6 +1564,7 @@ class ApiCalling { ...@@ -1557,6 +1564,7 @@ class ApiCalling {
}; };
final res = await post(data, approveRejectPaymentRequestSubmitUrl, {}); final res = await post(data, approveRejectPaymentRequestSubmitUrl, {});
if (res != null) { if (res != null) {
print(data);
debugPrint(res.body); debugPrint(res.body);
return approveRejectPaymentRequestResponse.fromJson( return approveRejectPaymentRequestResponse.fromJson(
jsonDecode(res.body), jsonDecode(res.body),
...@@ -1593,6 +1601,7 @@ class ApiCalling { ...@@ -1593,6 +1601,7 @@ class ApiCalling {
}; };
final res = await post(data, approveRejectPaymentRequestSubmitUrl, {}); final res = await post(data, approveRejectPaymentRequestSubmitUrl, {});
if (res != null) { if (res != null) {
print(data);
debugPrint(res.body); debugPrint(res.body);
return approveRejectPaymentRequestResponse.fromJson( return approveRejectPaymentRequestResponse.fromJson(
jsonDecode(res.body), jsonDecode(res.body),
...@@ -1637,6 +1646,7 @@ class ApiCalling { ...@@ -1637,6 +1646,7 @@ class ApiCalling {
"attachment", "attachment",
); );
res = jsonDecode(res); res = jsonDecode(res);
return approveRejectPaymentRequestResponse.fromJson(res);
} else { } else {
res = await post(data, approveRejectPaymentRequestSubmitUrl, {}); res = await post(data, approveRejectPaymentRequestSubmitUrl, {});
res = jsonDecode(res.body); res = jsonDecode(res.body);
...@@ -2232,8 +2242,8 @@ class ApiCalling { ...@@ -2232,8 +2242,8 @@ class ApiCalling {
} else { } else {
res = await post(data, ordersAddOrderSubmitUrl, {}); res = await post(data, ordersAddOrderSubmitUrl, {});
res = jsonDecode(res.body); res = jsonDecode(res.body);
return CommonResponse.fromJson(res);
} }
return CommonResponse.fromJson(res);
} catch (e) { } catch (e) {
debugPrint('hello bev=bug $e '); debugPrint('hello bev=bug $e ');
...@@ -2352,8 +2362,8 @@ class ApiCalling { ...@@ -2352,8 +2362,8 @@ class ApiCalling {
} else { } else {
res = await post(data, ordersOrderDetailsFeedbackSubmitUrl, {}); res = await post(data, ordersOrderDetailsFeedbackSubmitUrl, {});
res = jsonDecode(res.body); res = jsonDecode(res.body);
return CommonResponse.fromJson(res);
} }
return CommonResponse.fromJson(res);
} catch (e) { } catch (e) {
debugPrint('hello bev=bug $e '); debugPrint('hello bev=bug $e ');
return null; return null;
...@@ -2499,8 +2509,9 @@ class ApiCalling { ...@@ -2499,8 +2509,9 @@ class ApiCalling {
} else { } else {
res = await post(data, ordersAddPaymentSubmitUrl, {}); res = await post(data, ordersAddPaymentSubmitUrl, {});
res = jsonDecode(res.body); res = jsonDecode(res.body);
return CommonResponse.fromJson(res); // return CommonResponse.fromJson(res);
} }
return CommonResponse.fromJson(res);
} catch (e) { } catch (e) {
debugPrint('hello bev=bug $e '); debugPrint('hello bev=bug $e ');
...@@ -2826,8 +2837,9 @@ class ApiCalling { ...@@ -2826,8 +2837,9 @@ class ApiCalling {
} else { } else {
res = await post(data, ordersAddTPCAgentUrl, {}); res = await post(data, ordersAddTPCAgentUrl, {});
res = jsonDecode(res.body); res = jsonDecode(res.body);
return CommonResponse.fromJson(res); // return CommonResponse.fromJson(res);
} }
return CommonResponse.fromJson(res);
} catch (e) { } catch (e) {
debugPrint('hello bev=bug $e '); debugPrint('hello bev=bug $e ');
return null; return null;
...@@ -2942,8 +2954,9 @@ class ApiCalling { ...@@ -2942,8 +2954,9 @@ class ApiCalling {
} else { } else {
res = await post(data, ordersApprovePendingTPCIssueListUrl, {}); res = await post(data, ordersApprovePendingTPCIssueListUrl, {});
res = jsonDecode(res.body); res = jsonDecode(res.body);
return CommonResponse.fromJson(res); // return CommonResponse.fromJson(res);
} }
return CommonResponse.fromJson(res);
} catch (e) { } catch (e) {
debugPrint('hello bev=bug $e '); debugPrint('hello bev=bug $e ');
return null; return null;
...@@ -2951,9 +2964,34 @@ class ApiCalling { ...@@ -2951,9 +2964,34 @@ class ApiCalling {
} }
///CRM Module ///CRM Module
static Future<AccessiblePagesResponse?> crmAccessiblePagesAPI(
empId,
session
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
};
final res = await post(data, crmAccessiblePagesUrl, {});
if (res != null) {
print(data);
debugPrint(res.body);
return AccessiblePagesResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
return null;
}
} catch (e) {
debugPrint('hello bev=bug $e ');
return null;
}
}
static Future<LeadListViewResponse?> crmLeadListViewAPI( static Future<LeadListViewResponse?> crmLeadListViewAPI(
empId, empId,
session,mode session,
mode
) async { ) async {
try { try {
Map<String, String> data = { Map<String, String> data = {
...@@ -2964,7 +3002,7 @@ class ApiCalling { ...@@ -2964,7 +3002,7 @@ class ApiCalling {
final res = await post(data, crmLeadListViewUrl, {}); final res = await post(data, crmLeadListViewUrl, {});
if (res != null) { if (res != null) {
print(data); print(data);
debugPrint(res.body); debugPrint("ListView: ${res.body}");
return LeadListViewResponse.fromJson(jsonDecode(res.body)); return LeadListViewResponse.fromJson(jsonDecode(res.body));
} else { } else {
debugPrint("Null Response"); debugPrint("Null Response");
...@@ -3014,7 +3052,7 @@ class ApiCalling { ...@@ -3014,7 +3052,7 @@ class ApiCalling {
}; };
final res = await post(data, crmLeadListFilterSubmitUrl, {}); final res = await post(data, crmLeadListFilterSubmitUrl, {});
if (res != null) { if (res != null) {
print(data); print("Filter:${data}");
debugPrint(res.body); debugPrint(res.body);
return SubmitLeadListFilterResponse.fromJson(jsonDecode(res.body)); return SubmitLeadListFilterResponse.fromJson(jsonDecode(res.body));
} else { } else {
...@@ -3137,7 +3175,7 @@ class ApiCalling { ...@@ -3137,7 +3175,7 @@ class ApiCalling {
'session_id': (session).toString(), 'session_id': (session).toString(),
'account_id': (account_id).toString(), 'account_id': (account_id).toString(),
}; };
final res = await post(data, crmLeadListSubLocOnDistrictUrl, {}); final res = await post(data, crmLeadListContactPopUpUrl, {});
if (res != null) { if (res != null) {
print(data); print(data);
debugPrint(res.body); debugPrint(res.body);
...@@ -3152,6 +3190,34 @@ class ApiCalling { ...@@ -3152,6 +3190,34 @@ class ApiCalling {
} }
} }
static Future<LeadDetailsResponse?> crmLeadDetailsAPI(
empId,
session,
lead_id,
mode
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'lead_id': (lead_id).toString(),
'mode':(mode).toString()
};
final res = await post(data, crmLeadDetailsUrl, {});
if (res != null) {
print(data);
debugPrint(res.body);
return LeadDetailsResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
return null;
}
} catch (e) {
debugPrint('hello bev=bug $e ');
return null;
}
}
// static Future<CommonResponse?> TpcIssueListApprovalAPI( // static Future<CommonResponse?> TpcIssueListApprovalAPI(
// empId, // empId,
......
...@@ -119,6 +119,7 @@ const ordersApprovePendingTPCIssueListUrl = "${baseUrl_test}update_pending_tpc_i ...@@ -119,6 +119,7 @@ const ordersApprovePendingTPCIssueListUrl = "${baseUrl_test}update_pending_tpc_i
///Crm Module ///Crm Module
const crmAccessiblePagesUrl = "${baseUrl_test}sales_executive_crm_accessible_pages";
const crmLeadListViewUrl = "${baseUrl_test}crm_lead_list_view"; const crmLeadListViewUrl = "${baseUrl_test}crm_lead_list_view";
const crmLeadListFilterSubmitUrl = "${baseUrl_test}submit_crm_lead_list_filter"; const crmLeadListFilterSubmitUrl = "${baseUrl_test}submit_crm_lead_list_filter";
const crmLeadListSourceOnReferenceUrl = "${baseUrl_test}get_source_on_reference"; const crmLeadListSourceOnReferenceUrl = "${baseUrl_test}get_source_on_reference";
......
...@@ -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.85+89 version: 1.0.86+90
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