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

30-07-2025 By Sai Srinivas

CRM Module
parent 56ca3566
...@@ -149,15 +149,17 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -149,15 +149,17 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
borderRadius: BorderRadius.circular(14), borderRadius: BorderRadius.circular(14),
), ),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Expanded( Expanded(
child: Container( child: Container(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
padding: const EdgeInsets.fromLTRB(0.0, 0.0, 10, 0),
margin: const EdgeInsets.fromLTRB(10.0, 0.0, 10, 10),
child: Text( child: Text(
"Search", "Search",
style: TextStyle( style: TextStyle(
height: 1,
color: AppColors.grey_thick, color: AppColors.grey_thick,
fontSize: 14, fontSize: 14,
), ),
...@@ -232,22 +234,22 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -232,22 +234,22 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
final colors = [ final colors = [
0xFFE7FFE5, 0xFFE7FFE5,
0xFFF3EDFF, 0xFFF3EDFF,
0xFFEEF1FF,
0xFFFFFCD5, 0xFFFFFCD5,
0xFFFFF6F0, 0xFFFFF6F0,
0xFFE7FFE5, 0xFFFFEFEF,
0xFFF3EDFF, 0xFFEDF7FF,
0xFFFFFCD5, 0xFFFFF1CE,
0xFFFFF6F0,
]; ];
final textcolors = [ final textcolors = [
0xFF0D9C00, 0xFF0D9C00,
0xFF493272, 0xFF493272,
0xFF6563FF,
0xFF605C00, 0xFF605C00,
0xFF91481B, 0xFF91481B,
0xFF0D9C00, 0xFFED3424,
0xFF493272, 0xFF586000,
0xFF605C00, 0xFF326D72,
0xFF91481B,
]; ];
return InkResponse( return InkResponse(
...@@ -261,11 +263,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -261,11 +263,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
MaterialPageRoute( MaterialPageRoute(
builder: builder:
(context) => Leadlistbymode( (context) => Leadlistbymode(
pageTitleName: pageTitleName: "${leadTitles[jndex]}",
provider
.allLeads[jndex]
.filter!
.pageName!,
mode: mode:
provider provider
.allLeads[jndex] .allLeads[jndex]
...@@ -278,6 +276,17 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -278,6 +276,17 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
); );
} }
} }
if (leadTitles[jndex] == "Pending Tasks") {
await Navigator.push(
context,
MaterialPageRoute(
builder: (context) => PendingTasksList(),
settings: RouteSettings(
name: "PendingTasksList",
),
),
);
}
}, },
child: Container( child: Container(
padding: EdgeInsets.symmetric(horizontal: 13), padding: EdgeInsets.symmetric(horizontal: 13),
...@@ -441,7 +450,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -441,7 +450,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
// }, // },
// ), // ),
Container( Container(
height: MediaQuery.of(context).size.height * 0.2, height: MediaQuery.of(context).size.height * 0.22,
margin: EdgeInsets.symmetric(horizontal: 10), margin: EdgeInsets.symmetric(horizontal: 10),
child: Row( child: Row(
children: [ children: [
...@@ -492,7 +501,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -492,7 +501,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
), ),
), ),
Text( Text(
"Leads", "Details,\nFollowup",
// "Product and \nservice orders", // "Product and \nservice orders",
style: TextStyle( style: TextStyle(
color: AppColors.grey_semi, color: AppColors.grey_semi,
...@@ -559,7 +568,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -559,7 +568,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
), ),
), ),
Text( Text(
"Accounts", "Account Details,\nLead Details",
// "Assigned agents, \nperformance", // "Assigned agents, \nperformance",
style: TextStyle( style: TextStyle(
color: AppColors.grey_semi, color: AppColors.grey_semi,
...@@ -617,7 +626,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -617,7 +626,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
"Appointment", "Appointment\nCalendar",
style: TextStyle( style: TextStyle(
color: AppColors.app_blue, color: AppColors.app_blue,
fontSize: 14, fontSize: 14,
...@@ -628,7 +637,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -628,7 +637,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
), ),
), ),
Text( Text(
"Calendar", "",
// "Records,\nLedger", // "Records,\nLedger",
style: TextStyle( style: TextStyle(
color: AppColors.grey_semi, color: AppColors.grey_semi,
...@@ -664,7 +673,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -664,7 +673,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
child: Row( child: Row(
children: [ children: [
Text( Text(
"NearBy Leads", "Nearby Leads",
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
color: AppColors.grey_semi, color: AppColors.grey_semi,
...@@ -727,17 +736,15 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -727,17 +736,15 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
final longitude = location.lng; final longitude = location.lng;
return InkResponse( return InkResponse(
onTap: () async { onTap: () async {
await Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: builder:
(context) => NearbyOpenLeads( (context) => LeadDetailsByMode(
latitude: latitude, mode: "",
longitude: longitude, pageTitleName: "Lead Details",
leadId: provider.nearByLeads[index].id,
), ),
settings: RouteSettings(
name: "NearbyOpenLeads",
),
), ),
); );
}, },
...@@ -789,25 +796,42 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -789,25 +796,42 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
), ),
SizedBox(width: 10), SizedBox(width: 10),
Expanded( Expanded(
child: Container( child: InkResponse(
decoration: BoxDecoration( onTap: () async {
border: Border.all( await Navigator.push(
color: AppColors.semi_black.withAlpha( context,
10, MaterialPageRoute(
builder:
(context) => NearbyOpenLeads(
latitude: latitude,
longitude: longitude,
),
settings: RouteSettings(
name: "NearbyOpenLeads",
),
), ),
);
},
child: Container(
decoration: BoxDecoration(
border: Border.all(
color: AppColors.semi_black.withAlpha(
10,
),
),
borderRadius: BorderRadius.circular(16),
), ),
borderRadius: BorderRadius.circular(16), child: ClipRRect(
), borderRadius: BorderRadius.circular(16),
child: ClipRRect( child: Image.network(
borderRadius: BorderRadius.circular(16), provider.getSimpleOSMImage(
child: Image.network( latitude,
provider.getSimpleOSMImage( longitude,
latitude, ),
longitude, width: 400,
height: 400,
fit: BoxFit.cover,
), ),
width: 400,
height: 400,
fit: BoxFit.cover,
), ),
), ),
), ),
...@@ -929,7 +953,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -929,7 +953,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
Container( Container(
width: double.infinity, width: double.infinity,
child: ListView.builder( child: ListView.builder(
physics: AlwaysScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
shrinkWrap: true, shrinkWrap: true,
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
vertical: 5, vertical: 5,
...@@ -973,52 +997,103 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -973,52 +997,103 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
...List.generate(3, (j) { Container(
return Container( padding: EdgeInsets.symmetric(
padding: EdgeInsets.symmetric( vertical: 3,
vertical: 3, horizontal: 0,
horizontal: 0, ),
),
child: Column( child: Column(
children: [ children: [
if (j == 2) ...[ Row(
Padding( crossAxisAlignment:
padding: const EdgeInsets.only( CrossAxisAlignment.start,
top: 3.0, children: [
bottom: 3.0, Expanded(
child: Text(
"${provider.pendingTasksLists[index].aname}",
maxLines: 1,
overflow: TextOverflow.visible,
style: TextStyle(
decoration:
TextDecoration.underline,
height: 1,
decorationStyle:
TextDecorationStyle.dotted,
decorationColor: Color(
0xFF676767,
),
color: AppColors.semi_black,
fontFamily: "JakartaRegular",
fontSize: 14,
),
), ),
child: DottedLine( ),
dashGapLength: 4, Expanded(
dashGapColor: Colors.white, child: Text(
dashColor: AppColors.grey_semi, "${provider.pendingTasksLists[index].appdate}",
dashLength: 4, textAlign: TextAlign.right,
lineThickness: 0.5, maxLines: 1,
style: TextStyle(
color: AppColors.grey_semi,
fontFamily: "JakartaRegular",
fontSize: 14,
),
), ),
), ),
], ],
Row( ),
SizedBox(height: 10),
Container(
padding: EdgeInsets.symmetric(
vertical: 10,
horizontal: 10,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(
16,
),
gradient: LinearGradient(
colors: [
Color(0xFFFFFFFF),
Color(0xFFE8F7FF),
],
),
),
child: Row(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
"${subHeadings[j]}", "Remarks",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
color: color: AppColors.app_blue,
j == 0 fontFamily: "JakartaRegular",
? AppColors.semi_black fontSize: 14,
: AppColors.grey_semi, ),
),
),
Expanded(
child: Text(
"${provider.pendingTasksLists[index].anote}",
textAlign: TextAlign.right,
maxLines: 1,
style: TextStyle(
color: AppColors.semi_black,
fontFamily: "JakartaRegular",
fontSize: 14, fontSize: 14,
), ),
), ),
), ),
], ],
), ),
], ),
), ],
); ),
}), ),
], ],
), ),
), ),
...@@ -1043,9 +1118,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -1043,9 +1118,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => Addleadsprospectsscreen(), builder: (context) => Addleadsprospectsscreen(),
settings: RouteSettings( settings: RouteSettings(name: 'Addleadsprospectsscreen'),
name: 'Addleadsprospectsscreen'
)
), ),
); );
// } // }
......
...@@ -518,7 +518,7 @@ class _EditProductsListState extends State<EditProductsList> { ...@@ -518,7 +518,7 @@ class _EditProductsListState extends State<EditProductsList> {
.map((ord) => DropdownMenuItem<Products>( .map((ord) => DropdownMenuItem<Products>(
value: ord, value: ord,
child: Text( child: Text(
"(Product Name: ${ord.name})", "${ord.name}",
style: const TextStyle(fontSize: 14), style: const TextStyle(fontSize: 14),
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
......
...@@ -215,6 +215,9 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> { ...@@ -215,6 +215,9 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> {
], ],
), ),
), ),
if(provider.followupError!=null)...[
errorWidget(context, provider.followupError)
],
textControllerWidget( textControllerWidget(
context, context,
provider.followUpFeedbackController, provider.followUpFeedbackController,
...@@ -225,7 +228,9 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> { ...@@ -225,7 +228,9 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> {
false, false,
null, null,
), ),
if(provider.followupFeedbackError!=null)...[
errorWidget(context, provider.followupFeedbackError)
],
TextWidget(context, "Lead Status"), TextWidget(context, "Lead Status"),
DropdownButtonHideUnderline( DropdownButtonHideUnderline(
child: Row( child: Row(
...@@ -245,7 +250,7 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> { ...@@ -245,7 +250,7 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> {
], ],
), ),
items: items:
<String>['Cold', 'Hot', 'Warm'] <String>['All','Cold', 'Hot', 'Warm']
.map( .map(
(value) => (value) =>
DropdownMenuItem<String>( DropdownMenuItem<String>(
...@@ -275,7 +280,9 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> { ...@@ -275,7 +280,9 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> {
], ],
), ),
), ),
if(provider.leadStatusError!=null)...[
errorWidget(context, provider.leadStatusError)
],
TextWidget( TextWidget(
context, context,
"Next Appointment/Update Order Status", "Next Appointment/Update Order Status",
...@@ -331,6 +338,9 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> { ...@@ -331,6 +338,9 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> {
], ],
), ),
), ),
if(provider.appStatusError!=null)...[
errorWidget(context, provider.appStatusError)
]
], ],
), ),
), ),
...@@ -379,7 +389,7 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> { ...@@ -379,7 +389,7 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> {
), ),
items: items:
<String>[ <String>[
'Order Gain', // 'Order Gain',
'Order Lost', 'Order Lost',
'No Requirement', 'No Requirement',
] ]
...@@ -412,6 +422,9 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> { ...@@ -412,6 +422,9 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> {
], ],
), ),
), ),
if(provider.orderStatusError!=null)...[
errorWidget(context, provider.orderStatusError)
],
if (provider.selectOrderStatus == "Order Gain") if (provider.selectOrderStatus == "Order Gain")
...[] ...[]
else else
...@@ -483,6 +496,9 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> { ...@@ -483,6 +496,9 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> {
], ],
), ),
), ),
if(provider.competitorError!=null)...[
errorWidget(context, provider.competitorError)
]
] else ] else
if (provider.selectOrderStatus == if (provider.selectOrderStatus ==
"No Requirement") "No Requirement")
...@@ -497,11 +513,15 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> { ...@@ -497,11 +513,15 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> {
false, false,
null, null,
), ),
if(provider.reasonError!=null)...[
errorWidget(context, provider.reasonError)
]
], ],
], ],
), ),
), ),
] else ] else if(provider.nextAppointmentStatus ==
"Next Appointment")
...[ ...[
Container( Container(
padding: EdgeInsets.only(left: 10), padding: EdgeInsets.only(left: 10),
...@@ -514,24 +534,24 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> { ...@@ -514,24 +534,24 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> {
), ),
), ),
), ),
GestureDetector( Container(
onTap: () { decoration: BoxDecoration(
provider.showDatePickerDialog(context); color: Colors.white,
}, borderRadius: BorderRadius.circular(15),
child: Container( ),
decoration: BoxDecoration( margin: EdgeInsets.symmetric(vertical: 5, horizontal: 10),
color: Colors.white, padding: EdgeInsets.symmetric(
borderRadius: BorderRadius.circular(15), horizontal: 10, vertical: 5),
), child: Column(
margin: EdgeInsets.symmetric(vertical: 5, horizontal: 10), crossAxisAlignment: CrossAxisAlignment.start,
padding: EdgeInsets.symmetric( mainAxisAlignment: MainAxisAlignment.start,
horizontal: 10, vertical: 5), children: [
child: Column( TextWidget(context, "Next Appointment Date"),
crossAxisAlignment: CrossAxisAlignment.start, GestureDetector(
mainAxisAlignment: MainAxisAlignment.start, onTap: () {
children: [ provider.showDatePickerDialog(context);
TextWidget(context, "Next Appointment Date"), },
Container( child: Container(
height: 50, height: 50,
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
...@@ -568,100 +588,111 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> { ...@@ -568,100 +588,111 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> {
), ),
), ),
), ),
TextWidget(context, "Appointment Type"), ),
DropdownButtonHideUnderline( if(provider.nextAppDateError!=null)...[
child: Row( errorWidget(context, provider.nextAppDateError)
children: [ ],
Expanded( TextWidget(context, "Appointment Type"),
child: DropdownButton2<String>( DropdownButtonHideUnderline(
isExpanded: true, child: Row(
hint: const Row( children: [
children: [ Expanded(
Expanded( child: DropdownButton2<String>(
isExpanded: true,
hint: const Row(
children: [
Expanded(
child: Text(
'Select Appointment Type',
style: TextStyle(fontSize: 14),
overflow: TextOverflow.ellipsis,
),
),
],
),
items:
<String>['Phone', 'Visit']
.map(
(value) =>
DropdownMenuItem<String>(
value: value,
child: Text( child: Text(
'Select Appointment Type', value ?? '',
style: TextStyle(fontSize: 14), style: const TextStyle(
fontSize: 14,
),
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
), ),
], )
), .toList(),
items: value: provider.selectNextAppointmentType,
<String>['Phone', 'Visit'] onChanged: (String? newValue) {
.map( setState(() {
(value) => provider.selectNextAppointmentType =
DropdownMenuItem<String>( newValue!;
value: value, });
child: Text( },
value ?? '', buttonStyleData: ddtheme.buttonStyleData,
style: const TextStyle( iconStyleData: ddtheme.iconStyleData,
fontSize: 14, menuItemStyleData: ddtheme
), .menuItemStyleData,
overflow: TextOverflow.ellipsis, dropdownStyleData: ddtheme
), .dropdownStyleData,
),
)
.toList(),
value: provider.selectNextAppointmentType,
onChanged: (String? newValue) {
setState(() {
provider.selectNextAppointmentType =
newValue!;
});
},
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme
.menuItemStyleData,
dropdownStyleData: ddtheme
.dropdownStyleData,
),
), ),
], ),
), ],
), ),
if (provider.selectNextAppointmentType == ),
"Visit") ...[ if(provider.nextAppType!=null)...[
CheckboxListTile( errorWidget(context, provider.nextAppType)
activeColor: AppColors.app_blue, ],
checkboxShape: CircleBorder(),
controlAffinity: ListTileControlAffinity.leading, if (provider.selectNextAppointmentType ==
value: provider.checked, "Visit") ...[
contentPadding: EdgeInsets.symmetric( CheckboxListTile(
horizontal: 0), activeColor: AppColors.app_blue,
title: Text( checkboxShape: CircleBorder(),
"Send SMS reminder to Customer", controlAffinity: ListTileControlAffinity.leading,
style: TextStyle( value: provider.checked,
fontSize: 14, contentPadding: EdgeInsets.symmetric(
fontFamily: "JakartaRegular", horizontal: 0),
), title: Text(
"Send SMS reminder to Customer",
style: TextStyle(
fontSize: 14,
fontFamily: "JakartaRegular",
), ),
onChanged: (value) {
provider.checked = !provider.checked;
if (value == true) {
provider.smsSent = "1";
} else {
provider.smsSent = "0";
}
print(provider.smsSent +
provider.checked.toString());
},
), ),
], onChanged: (value) {
textControllerWidget( provider.checked = !provider.checked;
context, if (value == true) {
provider.noteController, provider.smsSent = "1";
"Note", } else {
"Write Note", provider.smsSent = "0";
provider.onNoteChanged, }
TextInputType.text, print(provider.smsSent +
false, provider.checked.toString());
null, },
), ),
], ],
), textControllerWidget(
context,
provider.noteController,
"Note",
"Write Note",
provider.onNoteChanged,
TextInputType.text,
false,
null,
),
if(provider.noteError!=null)...[
errorWidget(context, provider.noteError)
],
],
), ),
), ),
], ],
SizedBox(height: 150), SizedBox(height: 150),
], ],
......
...@@ -61,8 +61,11 @@ class _GeneratequotationaddeditproductState ...@@ -61,8 +61,11 @@ class _GeneratequotationaddeditproductState
if (widget.type == "add") { if (widget.type == "add") {
// Initialize controllers and dropdowns after API call // Initialize controllers and dropdowns after API call
provider.addEditInitializeForm(context); provider.addEditInitializeForm(context);
} else { } else if (widget.type == "edit"){
provider.preFillFormForEdit(widget.product); print(widget.index);
print(widget.product);
provider.preFillFormForEdit(widget.product,widget.index);
} }
}); });
} }
...@@ -149,7 +152,7 @@ class _GeneratequotationaddeditproductState ...@@ -149,7 +152,7 @@ class _GeneratequotationaddeditproductState
) => DropdownMenuItem<Products>( ) => DropdownMenuItem<Products>(
value: ord, value: ord,
child: Text( child: Text(
"(Product Name: ${ord.name})", "${ord.name}",
style: const TextStyle( style: const TextStyle(
fontSize: 14, fontSize: 14,
), ),
...@@ -185,6 +188,7 @@ class _GeneratequotationaddeditproductState ...@@ -185,6 +188,7 @@ class _GeneratequotationaddeditproductState
value!.id!; value!.id!;
provider.selectedAddEditProductName = provider.selectedAddEditProductName =
value.name; value.name;
print(value.id.toString());
provider.crmSelectedProductDetailsApiFunction(context, value.id.toString()); provider.crmSelectedProductDetailsApiFunction(context, value.id.toString());
} }
}, },
...@@ -256,12 +260,13 @@ class _GeneratequotationaddeditproductState ...@@ -256,12 +260,13 @@ class _GeneratequotationaddeditproductState
FloatingActionButtonLocation.centerFloat, FloatingActionButtonLocation.centerFloat,
floatingActionButton: InkWell( floatingActionButton: InkWell(
onTap: () { onTap: () {
if (provider.selectedLeadProducts != null) { if (provider.selectedProducts != null) {
var newProduct; var newProduct;
if (widget.type == "add") { if (widget.type == "add") {
newProduct = LeadProducts( newProduct = LeadProducts(
id: provider.selectedAddEditLeadProductId,
productName: provider.selectedAddEditLeadProductName, productId: provider.selectedAddEditProductId,
productName: provider.selectedAddEditProductName,
price: provider.addEditProductPriceController.text, price: provider.addEditProductPriceController.text,
qty: provider.addEditQuantityController.text, qty: provider.addEditQuantityController.text,
...@@ -269,16 +274,16 @@ class _GeneratequotationaddeditproductState ...@@ -269,16 +274,16 @@ class _GeneratequotationaddeditproductState
); );
provider.leadProductsList.add(newProduct); provider.leadProductsList.add(newProduct);
provider.productRows.add({ provider.productRows.add({
"product_id": provider.selectedAddEditLeadProductId!, "product_id": provider.selectedAddEditProductId!,
"price": provider.addEditProductPriceController.text, "price": provider.addEditProductPriceController.text,
"qty": provider.addEditQuantityController.text, "qty": provider.addEditQuantityController.text,
"net_price": provider.addEditTotalAmountController.text, "net_price": provider.addEditTotalAmountController.text,
}); });
Navigator.pop(context, newProduct); Navigator.pop(context, newProduct);
} else { } else if (widget.type == "edit"){
final updatedProduct = LeadProducts( final updatedProduct = LeadProducts(
id: provider.selectedAddEditLeadProductId, productId: provider.selectedAddEditProductId,
productName: provider.selectedAddEditLeadProductName, productName: provider.selectedAddEditProductName,
price: provider.addEditProductPriceController.text, price: provider.addEditProductPriceController.text,
qty: provider.addEditQuantityController.text, qty: provider.addEditQuantityController.text,
prodTotalPrice: provider.addEditTotalAmountController.text, prodTotalPrice: provider.addEditTotalAmountController.text,
......
...@@ -215,7 +215,7 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> { ...@@ -215,7 +215,7 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> {
type: "edit", type: "edit",
product: product:
provider provider
.leadProductsList[lp]!, .leadProductsList[lp],
index: lp, index: lp,
), ),
settings: RouteSettings( settings: RouteSettings(
...@@ -353,6 +353,7 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> { ...@@ -353,6 +353,7 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> {
), ),
), ),
], ],
errorWidget(context, provider.productRowsError),
// if (provider.leadProductsList.isNotEmpty || // if (provider.leadProductsList.isNotEmpty ||
// provider // provider
// .editProductPriceControllers // .editProductPriceControllers
...@@ -674,13 +675,30 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> { ...@@ -674,13 +675,30 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> {
), ),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children:provider.buttonsLoading?[
CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation(AppColors.app_blue),
),
SizedBox(width:25),
SvgPicture.asset("assets/svg/crm/vertical_line_ic.svg"),
SizedBox(width:25),
CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation(AppColors.app_blue),
),
SizedBox(width:25),
SvgPicture.asset("assets/svg/crm/vertical_line_ic.svg"),
SizedBox(width:25),
CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation(AppColors.app_blue),
)
]: [
Expanded( Expanded(
child: InkResponse( child: InkResponse(
onTap: onTap:
provider.submitLoading provider.buttonsLoading
? null ? null
: () { : () {
provider.buttonsLoading = true;
//genquotedown //genquotedown
final insertedData = provider.productRows; final insertedData = provider.productRows;
print(insertedData); print(insertedData);
...@@ -730,9 +748,10 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> { ...@@ -730,9 +748,10 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> {
Expanded( Expanded(
child: InkResponse( child: InkResponse(
onTap: onTap:
provider.submitLoading provider.buttonsLoading
? null ? null
: () { : () {
provider.buttonsLoading = true;
//genquotemail, //genquotemail,
final insertedData = provider.getFormData(); final insertedData = provider.getFormData();
provider provider
...@@ -781,9 +800,10 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> { ...@@ -781,9 +800,10 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> {
Expanded( Expanded(
child: InkResponse( child: InkResponse(
onTap: onTap:
provider.submitLoading provider.buttonsLoading
? null ? null
: () { : () {
provider.buttonsLoading = true;
//genquotewhatsapp, //genquotewhatsapp,
final insertedData = provider.getFormData(); final insertedData = provider.getFormData();
provider provider
......
...@@ -10,6 +10,7 @@ import 'package:generp/Utils/commonServices.dart'; ...@@ -10,6 +10,7 @@ import 'package:generp/Utils/commonServices.dart';
import 'package:generp/screens/crm/LeadDetailsByMode.dart'; import 'package:generp/screens/crm/LeadDetailsByMode.dart';
import 'package:generp/screens/crm/followUpUpdateScreen.dart'; import 'package:generp/screens/crm/followUpUpdateScreen.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
import '../../Utils/commonWidgets.dart'; import '../../Utils/commonWidgets.dart';
...@@ -170,11 +171,19 @@ class _PendingtasksdetailsState extends State<Pendingtasksdetails> { ...@@ -170,11 +171,19 @@ class _PendingtasksdetailsState extends State<Pendingtasksdetails> {
child: Text( child: Text(
"${subHeadings[j]}", "${subHeadings[j]}",
style: TextStyle( style: TextStyle(
decoration:j == 0
? TextDecoration.underline:TextDecoration.none,
height: j == 0
? 1:1.5,
decorationStyle: TextDecorationStyle.dotted,
decorationColor: Color(0xFF676767),
fontFamily: "JakartaRegular",
fontSize: 14,
color: color:
j == 0 j == 0
? AppColors.semi_black ? AppColors.semi_black
: AppColors.grey_semi, : AppColors.grey_semi,
fontSize: 14,
), ),
), ),
), ),
...@@ -225,11 +234,27 @@ class _PendingtasksdetailsState extends State<Pendingtasksdetails> { ...@@ -225,11 +234,27 @@ class _PendingtasksdetailsState extends State<Pendingtasksdetails> {
), ),
), ),
Expanded( Expanded(
child: Text( child: InkResponse(
"${belowSubHeads[i]}", onTap:belowHeads[i]=="Mobile Number"?(){
style: TextStyle( launch(
color: AppColors.grey_semi, 'tel://${belowSubHeads[i]}',
fontSize: 14, );
}:null,
child: Padding(
padding: const EdgeInsets.all(4.0),
child: Text(
"${belowSubHeads[i]}",
style: TextStyle(
decoration:belowHeads[i]=="Mobile Number"
? TextDecoration.underline:TextDecoration.none,
decorationStyle: TextDecorationStyle.dotted,
decorationColor: Color(0xFF676767),
color: AppColors.grey_semi,
fontSize: 14,
),
),
), ),
), ),
), ),
......
...@@ -124,7 +124,7 @@ class _PendingTasksListState extends State<PendingTasksList> { ...@@ -124,7 +124,7 @@ class _PendingTasksListState extends State<PendingTasksList> {
Container( Container(
width: double.infinity, width: double.infinity,
child: ListView.builder( child: ListView.builder(
physics: AlwaysScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
shrinkWrap: true, shrinkWrap: true,
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
vertical: 5, vertical: 5,
...@@ -156,7 +156,7 @@ class _PendingTasksListState extends State<PendingTasksList> { ...@@ -156,7 +156,7 @@ class _PendingTasksListState extends State<PendingTasksList> {
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(15), borderRadius: BorderRadius.circular(15),
), ),
margin: EdgeInsets.symmetric(vertical: 3,horizontal: 10), margin: EdgeInsets.symmetric(vertical: 3),
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
horizontal: 10, horizontal: 10,
vertical: 5, vertical: 5,
...@@ -164,56 +164,92 @@ class _PendingTasksListState extends State<PendingTasksList> { ...@@ -164,56 +164,92 @@ class _PendingTasksListState extends State<PendingTasksList> {
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
...List.generate(3, (j) { Container(
return Container( padding: EdgeInsets.symmetric(
padding: EdgeInsets.symmetric( vertical: 3,
vertical: 3, horizontal: 0,
horizontal: 0, ),
),
child: Column( child: Column(
children: [ children: [
if (j == 2) ...[ Row(
Padding( crossAxisAlignment:
padding: CrossAxisAlignment.start,
const EdgeInsets.only( children: [
top: 3.0, Expanded(
bottom: 3.0, child: Text(
), "${provider.pendingTasksLists[index].aname}",
child: DottedLine( maxLines: 1,
dashGapLength: 4, overflow: TextOverflow.visible,
dashGapColor: Colors.white, style: TextStyle(
dashColor: decoration: TextDecoration.underline,
AppColors.grey_semi, height: 1,
dashLength: 4, decorationStyle: TextDecorationStyle.dotted,
lineThickness: 0.5, decorationColor: Color(0xFF676767),
color: AppColors.semi_black,
fontFamily: "JakartaRegular",
fontSize: 14,
),
),
),
Expanded(
child: Text(
"${provider.pendingTasksLists[index].appdate}",
textAlign: TextAlign.right,
maxLines: 1,
style: TextStyle(
color: AppColors.grey_semi,
fontFamily: "JakartaRegular",
fontSize: 14,
),
), ),
), ),
], ],
Row( ),
SizedBox(height: 10,),
Container(
padding: EdgeInsets.symmetric(vertical: 10,horizontal: 10),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16),
gradient: LinearGradient(colors: [
Color(0xFFFFFFFF),
Color(0xFFE8F7FF)
])
),
child: Row(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
"${subHeadings[j]}", "Remarks",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
color: color: AppColors.app_blue,
j == 0 fontFamily: "JakartaRegular",
? AppColors fontSize: 14,
.semi_black ),
: AppColors ),
.grey_semi, ),
Expanded(
child: Text(
"${provider.pendingTasksLists[index].anote}",
textAlign: TextAlign.right,
maxLines: 1,
style: TextStyle(
color: AppColors.semi_black,
fontFamily: "JakartaRegular",
fontSize: 14, fontSize: 14,
), ),
), ),
), ),
], ],
), ),
], ),
), ],
); ),
}), ),
], ],
), ),
), ),
......
...@@ -42,15 +42,25 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> { ...@@ -42,15 +42,25 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> {
child: Scaffold( child: Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
appBar: appbarNew(context, "Search", 0xFFFFFFFF), appBar: AppBar(
backgroundColor: Colors.white,
automaticallyImplyLeading: false,
toolbarHeight: 20,
),
body: SingleChildScrollView( body: SingleChildScrollView(
child: Column( child: Column(
children: [ children: [
Container( Container(
padding: const EdgeInsets.fromLTRB(5.0, 0.0, 10, 0),
// padding: const EdgeInsets.fromLTRB(5.0, 0.0, 10, 0),
// margin: const EdgeInsets.fromLTRB(10.0, 0.0, 10, 10), // margin: const EdgeInsets.fromLTRB(10.0, 0.0, 10, 10),
height: 50, padding: const EdgeInsets.fromLTRB(
alignment: Alignment.center, 10.0,
0.0,
10,
10,
),
height: 55,
decoration: BoxDecoration( decoration: BoxDecoration(
color: AppColors.white, color: AppColors.white,
borderRadius: BorderRadius.vertical( borderRadius: BorderRadius.vertical(
...@@ -58,8 +68,19 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> { ...@@ -58,8 +68,19 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> {
), ),
), ),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Expanded( Expanded(
flex: 1,
child: InkResponse(
onTap: () => Navigator.pop(context, true),
child: Container(
child: SvgPicture.asset("assets/svg/appbar_back_button.svg", height: 25)),
),
),
Expanded(
flex: 9,
child: Container( child: Container(
padding: const EdgeInsets.fromLTRB( padding: const EdgeInsets.fromLTRB(
0.0, 0.0,
...@@ -67,17 +88,12 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> { ...@@ -67,17 +88,12 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> {
10, 10,
0, 0,
), ),
margin: const EdgeInsets.fromLTRB(
10.0,
0.0,
10,
10,
),
child: TextFormField( child: TextFormField(
controller: provider.searchController, controller: provider.searchController,
keyboardType: TextInputType.text, keyboardType: TextInputType.text,
maxLines: 1, maxLines: 1,
autofocus: true,
onChanged: (value) { onChanged: (value) {
Future.delayed( Future.delayed(
Duration(milliseconds: 500), Duration(milliseconds: 500),
...@@ -108,7 +124,19 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> { ...@@ -108,7 +124,19 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> {
), ),
suffixIcon: Container( suffixIcon: Container(
padding: EdgeInsets.only(right: 10), padding: EdgeInsets.only(right: 10),
child: SvgPicture.asset( child:provider.searchController.text.isNotEmpty?
InkResponse(
onTap: () {
provider.searchController.clear();
provider.crmUniversalSearchFunction(
context,
);
},
child: SvgPicture.asset(
"assets/svg/crm/clear_search.svg",
),
):
SvgPicture.asset(
"assets/svg/search_ic.svg", "assets/svg/search_ic.svg",
), ),
), ),
......
import 'dart:io';
import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_svg/svg.dart';
import 'package:generp/Notifiers/financeProvider/RequestionListProvider.dart';
import 'package:generp/Utils/GlobalConstants.dart';
import 'package:generp/Utils/app_colors.dart';
import 'package:generp/Utils/commonWidgets.dart';
import 'package:generp/screens/finance/FileViewer.dart';
import 'package:generp/screens/finance/PaymentRequestionListDetails.dart';
import 'package:provider/provider.dart';
import '../../Utils/commonServices.dart';
import '../commonDateRangeFilter.dart';
class Allpaymentrequesitionlistsbymodesold extends StatefulWidget {
final String mode;
final String pageTitleName;
const Allpaymentrequesitionlistsbymodesold({
super.key,
required this.mode,
required this.pageTitleName,
});
@override
State<Allpaymentrequesitionlistsbymodesold> createState() =>
_AllpaymentrequesitionlistsbymodesoldState();
}
class _AllpaymentrequesitionlistsbymodesoldState
extends State<Allpaymentrequesitionlistsbymodesold> {
Map _source = {ConnectivityResult.mobile: true};
final MyConnectivity _connectivity = MyConnectivity.instance;
late Commondaterangefilter cf;
@override
void initState() {
// TODO: implement initState
super.initState();
_connectivity.initialise();
_connectivity.myStream.listen((source) {
setState(() => _source = source);
});
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
cf = Commondaterangefilter();
var provider = Provider.of<Requestionlistprovider>(
context,
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, "", "");
});
}
@override
void dispose() {
// TODO: implement dispose
super.dispose();
_connectivity.disposeStream();
}
@override
Widget build(BuildContext context) {
switch (_source.keys.toList()[0]) {
case ConnectivityResult.mobile:
connection = 'Online';
break;
case ConnectivityResult.wifi:
connection = 'Online';
break;
case ConnectivityResult.none:
default:
connection = 'Offline';
}
return connection == "Online"
? Platform.isAndroid
? WillPopScope(
onWillPop: () {
return onBackPressed(context);
},
child: SafeArea(
top: false,
bottom: true,
child: _scaffold(context),
),
)
: _scaffold(context)
: NoNetwork(context);
}
Widget _scaffold(BuildContext context) {
return Consumer<Requestionlistprovider>(
builder: (context, provider, child) {
final requestLists = provider.requisitionList;
return Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar2(
context,
widget.pageTitleName,
provider.resetForm,
Row(
children: [
// InkResponse(
// onTap: () {
// _showOptionsSheet(context);
// },
// child: SvgPicture.asset("assets/svg/ic_download.svg",),
// ),
InkResponse(
onTap: () async {
var cf = Commondaterangefilter();
var result = await cf.showFilterBottomSheet(context);
if (result != null) {
var dateRange = result['dateRange'] as DateTimeRange?;
print("dateRange: $dateRange");
var formatted = result['formatted'] as List<String>;
print("formatted: $formatted");
if (formatted.isNotEmpty) {
var fromDate = formatted[0]; // From date
var toDate = formatted[1]; // To date
print("from_date: $fromDate");
print("to_date: $toDate");
provider.paymentRequestionListsAPIFunction(
context,
widget.mode,
fromDate,
toDate,
);
// You can now use fromDate and toDate as needed
// For example, store them or pass to another function
} else {
print("No valid date range selected");
}
} else {
print("Bottom sheet closed without selection");
}
},
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,
),
),
)
: requestLists.isNotEmpty
? SizedBox(
child: Scrollbar(
thumbVisibility: false,
child: ListView.builder(
itemCount: requestLists.length,
shrinkWrap: true,
physics: AlwaysScrollableScrollPhysics(),
itemBuilder: (context, index) {
if (requestLists.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),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
requestLists[index].accountName!,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
),
),
Text(
"₹"
"${requestLists[index].amount}",
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(
requestLists[index].status!,
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: Color(0xFF0D9C00),
),
),
),
),
),
],
),
Divider(
thickness: 0.5,
color: Color(0xFFD7D7D7),
),
...List.generate(4, (j) {
final headings = [
"Requesting Propose",
"Attachment",
"Requested Date",
"Note",
];
final subHeadings = [
requestLists[index].requestingPurpose,
"View",
// requestLists[index].attachmentDirFilePath
requestLists[index].date,
requestLists[index].description,
];
if (j == 1 &&
requestLists[index]
.attachmentViewFileName ==
"") {
return SizedBox.shrink();
}
return Container(
padding: EdgeInsets.symmetric(vertical: 5),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
headings[j],
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
),
),
),
Expanded(
child: InkResponse(
onTap:
j != 1
? null
: () {
Navigator.push(
context,
MaterialPageRoute(
builder:
(
context,
) => Fileviewer(
fileName:
requestLists[index]
.attachmentViewFileName!,
fileUrl:
requestLists[index]
.attachmentDirFilePath!,
),
),
);
},
child: Text(
subHeadings[j]!,
style: TextStyle(
fontSize: 14,
color:
j == 1
? AppColors.app_blue
: Color(0xFF818181),
decoration:
j == 1
? TextDecoration
.underline
: TextDecoration.none,
decorationColor:
j == 1
? AppColors.app_blue
: AppColors.white,
),
),
),
),
],
),
);
}),
InkResponse(
onTap: () async {
var res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
Paymentrequestionlistdetails(
pageName:
widget.pageTitleName,
mode: widget.mode,
paymentRequestId:
requestLists[index].id,
),
settings: RouteSettings(
name: "Paymentrequestionlistdetails",
),
),
);
if (routeSettingName ==
"Paymentrequestionlistdetails") {
print("croos refresh");
provider
.paymentRequestionListsAPIFunction(
context,
widget.mode,
"",
"",
);
}
// if (res == true) {
// print("android refresh");
// provider
// .paymentRequestionListsAPIFunction(
// context,
// widget.mode,
// "",
// "",
// );
// }
// if (Platform.isIOS) {
// print("IOS Refresh");
// if (didPushed == "true" ||
// didPopped == "true") {
// provider
// .paymentRequestionListsAPIFunction(
// context,
// widget.mode,
// "",
// "",
// );
// }
// }
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 5),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Text(
"View Details",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
SizedBox(width: 5),
SvgPicture.asset(
"assets/svg/next_button.svg",
),
],
),
),
),
],
),
);
},
),
),
)
: 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: () {
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",
),
);
}),
],
),
),
);
},
),
);
},
);
},
);
}
}
...@@ -227,7 +227,7 @@ class _GeneratequotationscreenoldState extends State<Generatequotationscreenold> ...@@ -227,7 +227,7 @@ class _GeneratequotationscreenoldState extends State<Generatequotationscreenold>
>( >(
value: ord, value: ord,
child: Text( child: Text(
"(Product Name: ${ord.productName})", "${ord.productName}",
style: style:
const TextStyle( const TextStyle(
fontSize: fontSize:
......
import 'dart:io';
import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:generp/Utils/GlobalConstants.dart';
import 'package:generp/screens/finance/FileViewer.dart';
import 'package:generp/screens/finance/paymentDetailsPaymentRequisition.dart';
import 'package:provider/provider.dart';
import '../../Notifiers/financeProvider/paymentRequisitionPaymentsListProvider.dart';
import '../../Utils/app_colors.dart';
import '../../Utils/commonServices.dart';
import '../../Utils/commonWidgets.dart';
import '../commonDateRangeFilter.dart';
class PaymentlistpaymentrequisitionOld extends StatefulWidget {
final String pageTitleName;
const PaymentlistpaymentrequisitionOld({super.key, required this.pageTitleName});
@override
State<PaymentlistpaymentrequisitionOld> createState() =>
_PaymentlistpaymentrequisitionOldState();
}
class _PaymentlistpaymentrequisitionOldState
extends State<PaymentlistpaymentrequisitionOld> {
late Commondaterangefilter cf;
Map _source = {ConnectivityResult.mobile: true};
final MyConnectivity _connectivity = MyConnectivity.instance;
@override
void initState() {
// TODO: implement initState
super.initState();
_connectivity.initialise();
_connectivity.myStream.listen((source) {
setState(() => _source = source);
});
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
cf = Commondaterangefilter();
var provider = Provider.of<Paymentrequisitionpaymentslistprovider>(
context,
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);
provider.paymentsListAPI(context, '', '');
});
}
@override
void dispose() {
// TODO: implement dispose
super.dispose();
_connectivity.disposeStream();
}
@override
Widget build(BuildContext context) {
switch (_source.keys.toList()[0]) {
case ConnectivityResult.mobile:
connection = 'Online';
break;
case ConnectivityResult.wifi:
connection = 'Online';
break;
case ConnectivityResult.none:
default:
connection = 'Offline';
}
return (connection == "Online")
? Platform.isAndroid
? WillPopScope(
onWillPop: () => onBackPressed(context),
child: SafeArea(
top: false,
bottom: true,
child: _scaffold(context),
),
)
: _scaffold(context)
: NoNetwork(context);
}
Widget _scaffold(BuildContext context) {
return Consumer<Paymentrequisitionpaymentslistprovider>(
builder: (context, provider, child) {
final requestLists = provider.paymentsList;
return Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar2(
context,
widget.pageTitleName,
provider.resetForm,
Row(
children: [
// InkResponse(
// onTap: () {
// _showOptionsSheet(context);
// },
// child: SvgPicture.asset("assets/svg/ic_download.svg",),
// ),
InkResponse(
onTap: () async {
var cf = Commondaterangefilter();
var result = await cf.showFilterBottomSheet(context);
if (result != null) {
var dateRange = result['dateRange'] as DateTimeRange?;
print("dateRange: $dateRange");
var formatted = result['formatted'] as List<String>;
print("formatted: $formatted");
if (formatted.isNotEmpty) {
var fromDate = formatted[0]; // From date
var toDate = formatted[1]; // To date
print("from_date: $fromDate");
print("to_date: $toDate");
provider.paymentsListAPI(context, fromDate, toDate);
// You can now use fromDate and toDate as needed
// For example, store them or pass to another function
} else {
print("No valid date range selected");
}
} else {
print("Bottom sheet closed without selection");
}
},
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,
),
),
)
: requestLists.isNotEmpty
? SizedBox(
child: Scrollbar(
thumbVisibility: false,
child: ListView.builder(
itemCount: requestLists.length,
shrinkWrap: true,
physics: AlwaysScrollableScrollPhysics(),
itemBuilder: (context, index) {
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),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
requestLists[index]
.receipientAccount!,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
),
),
Text(
"₹${requestLists[index].amount}",
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(
// requestLists[index].refType!,
// textAlign: TextAlign.center,
// style: TextStyle(
// fontFamily: "JakartaMedium",
// fontSize: 14,
// color: Color(0xFF0D9C00),
// ),
// ),
// ),
// ),
// ),
],
),
Divider(
thickness: 0.5,
color: Color(0xFFD7D7D7),
),
...List.generate(5, (j) {
final headings = [
"To Account",
"Attachment",
"Request Mode",
"Payment Date",
"Note",
];
final subHeadings = [
requestLists[index].payAccount,
"View",
requestLists[index].requestMode,
// requestLists[index].attachmentDirFilePath
requestLists[index].paymentDate,
requestLists[index].description,
];
if (headings[j] == "Attachment" &&
requestLists[index]
.attachmentViewFileName ==
"") {
return SizedBox.shrink();
}
return Container(
padding: EdgeInsets.symmetric(vertical: 5),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
headings[j],
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
),
),
),
Expanded(
child: InkResponse(
onTap:
j != 1
? null
: () {
Navigator.push(
context,
MaterialPageRoute(
builder:
(
context,
) => Fileviewer(
fileName:
requestLists[index]
.attachmentViewFileName!,
fileUrl:
requestLists[index]
.attachmentDirFilePath!,
),
),
);
},
child: Text(
subHeadings[j] == ""
? "-"
: subHeadings[j] ?? "-",
style: TextStyle(
fontSize: 14,
color:
j == 1
? AppColors.app_blue
: Color(0xFF818181),
decoration:
j == 1
? TextDecoration
.underline
: TextDecoration.none,
decorationColor:
j == 1
? AppColors.app_blue
: AppColors.white,
),
),
),
),
],
),
);
}),
InkResponse(
onTap: () async {
var res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
Paymentdetailspaymentrequisition(
pageName:
widget.pageTitleName,
paymentRequestId:
requestLists[index].id,
),
settings: RouteSettings(
name:
"Paymentdetailspaymentrequisition",
),
),
);
if (routeSettingName ==
"Paymentdetailspaymentrequisition") {
print("pld");
provider.paymentsListAPI(context, '', '');
}
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 5),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Text(
"View Details",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
SizedBox(width: 5),
SvgPicture.asset(
"assets/svg/next_button.svg",
),
],
),
),
),
],
),
);
},
),
),
)
: 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<Paymentrequisitionpaymentslistprovider>(
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: () {
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",
),
);
}),
],
),
),
);
},
),
);
},
);
},
);
}
}
import 'dart:io';
import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:generp/Utils/GlobalConstants.dart';
import 'package:generp/screens/finance/FileViewer.dart';
import 'package:generp/screens/finance/paymentReceiptDetails.dart';
import 'package:provider/provider.dart';
import '../../Notifiers/financeProvider/paymentReceiptsProvider.dart';
import '../../Notifiers/financeProvider/paymentRequisitionPaymentsListProvider.dart';
import '../../Utils/app_colors.dart';
import '../../Utils/commonServices.dart';
import '../../Utils/commonWidgets.dart';
import '../commonDateRangeFilter.dart';
class PaymentreceiptlistOld extends StatefulWidget {
final String pageTitleName;
const PaymentreceiptlistOld({super.key, required this.pageTitleName});
@override
State<PaymentreceiptlistOld> createState() => _PaymentreceiptlistOldState();
}
class _PaymentreceiptlistOldState extends State<PaymentreceiptlistOld> {
Map _source = {ConnectivityResult.mobile: true};
final MyConnectivity _connectivity = MyConnectivity.instance;
@override
void initState() {
// TODO: implement initState
super.initState();
_connectivity.initialise();
_connectivity.myStream.listen((source) {
setState(() => _source = source);
});
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
var provider = Provider.of<Paymentreceiptsprovider>(
context,
listen: false,
);
provider.paymentsListAPI(context, '', '');
});
}
@override
Widget build(BuildContext context) {
switch (_source.keys.toList()[0]) {
case ConnectivityResult.mobile:
connection = 'Online';
break;
case ConnectivityResult.wifi:
connection = 'Online';
break;
case ConnectivityResult.none:
default:
connection = 'Offline';
}
return (connection == "Online")
? Platform.isAndroid
? WillPopScope(
onWillPop: () => onBackPressed(context),
child: SafeArea(
top: false,
bottom: true,
child: _scaffold(context),
),
)
: _scaffold(context)
: NoNetwork(context);
}
Widget _scaffold(BuildContext context) {
return Consumer<Paymentreceiptsprovider>(
builder: (context, provider, child) {
final requestLists = provider.receiptsList;
return Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar2(
context,
widget.pageTitleName,
provider.resetForm,
Row(
children: [
// InkResponse(
// onTap: () {
// _showOptionsSheet(context);
// },
// child: SvgPicture.asset("assets/svg/ic_download.svg",),
// ),
InkResponse(
onTap: () async {
var cf = Commondaterangefilter();
var result = await cf.showFilterBottomSheet(context);
if (result != null) {
var dateRange = result['dateRange'] as DateTimeRange?;
print("dateRange: $dateRange");
var formatted = result['formatted'] as List<String>;
print("formatted: $formatted");
if (formatted.isNotEmpty) {
var fromDate = formatted[0]; // From date
var toDate = formatted[1]; // To date
print("from_date: $fromDate");
print("to_date: $toDate");
provider.paymentsListAPI(context, fromDate, toDate);
// You can now use fromDate and toDate as needed
// For example, store them or pass to another function
} else {
print("No valid date range selected");
}
} else {
print("Bottom sheet closed without selection");
}
},
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,
),
),
)
: requestLists.isNotEmpty
? SizedBox(
child: Scrollbar(
child: ListView.builder(
itemCount: requestLists.length,
shrinkWrap: true,
physics: AlwaysScrollableScrollPhysics(),
itemBuilder: (context, index) {
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),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
requestLists[index]
.receipientAccount!,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
),
),
Text(
"₹${requestLists[index].amount}",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
],
),
),
),
],
),
Divider(
thickness: 0.5,
color: Color(0xFFD7D7D7),
),
...List.generate(5, (j) {
final headings = [
"Receipt Account",
"Attachment",
"Request Mode",
"Receipt Date",
"Note",
];
final subHeadings = [
requestLists[index].receipientAccount,
"View",
requestLists[index].requestMode,
// requestLists[index].attachmentDirFilePath
requestLists[index].receiptDate,
requestLists[index].description,
];
if (headings[j] == "Attachment" &&
requestLists[index]
.attachmentViewFileName ==
"") {
return SizedBox.shrink();
}
return Container(
padding: EdgeInsets.symmetric(vertical: 5),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
headings[j],
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
),
),
),
Expanded(
child: InkResponse(
onTap:
j != 1
? null
: () {
Navigator.push(
context,
MaterialPageRoute(
builder:
(
context,
) => Fileviewer(
fileName:
requestLists[index]
.attachmentViewFileName!,
fileUrl:
requestLists[index]
.attachmentDirFilePath!,
),
),
);
},
child: Text(
subHeadings[j] == ""
? "-"
: subHeadings[j] ?? "-",
style: TextStyle(
fontSize: 14,
color:
j == 1
? AppColors.app_blue
: Color(0xFF818181),
decoration:
j == 1
? TextDecoration
.underline
: TextDecoration.none,
decorationColor:
j == 1
? AppColors.app_blue
: AppColors.white,
),
),
),
),
],
),
);
}),
InkResponse(
onTap: () async {
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(vertical: 5),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Text(
"View Details",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
SizedBox(width: 5),
SvgPicture.asset(
"assets/svg/next_button.svg",
),
],
),
),
),
],
),
);
},
),
),
)
: 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<Paymentrequisitionpaymentslistprovider>(
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: () {
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",
),
);
}),
],
),
),
);
},
),
);
},
);
},
);
}
}
...@@ -1186,7 +1186,7 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> { ...@@ -1186,7 +1186,7 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
>( >(
value: ord, value: ord,
child: Text( child: Text(
"(Product Name: ${ord.productName})", "${ord.productName}",
style: style:
const TextStyle( const TextStyle(
fontSize: fontSize:
......
...@@ -4433,7 +4433,7 @@ class ApiCalling { ...@@ -4433,7 +4433,7 @@ class ApiCalling {
}; };
final res = await post(data, crmProspectDetailsAddAccountUrl, {}); final res = await post(data, crmProspectDetailsAddAccountUrl, {});
if (res != null) { if (res != null) {
print("Filter:${data}"); print("crmProspectDetailsAddAccountAPI:${data}");
debugPrint(res.body); debugPrint(res.body);
return CommonResponse.fromJson(jsonDecode(res.body)); return CommonResponse.fromJson(jsonDecode(res.body));
} else { } else {
......
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