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> {
borderRadius: BorderRadius.circular(14),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Container(
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(
"Search",
style: TextStyle(
height: 1,
color: AppColors.grey_thick,
fontSize: 14,
),
......@@ -232,22 +234,22 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
final colors = [
0xFFE7FFE5,
0xFFF3EDFF,
0xFFEEF1FF,
0xFFFFFCD5,
0xFFFFF6F0,
0xFFE7FFE5,
0xFFF3EDFF,
0xFFFFFCD5,
0xFFFFF6F0,
0xFFFFEFEF,
0xFFEDF7FF,
0xFFFFF1CE,
];
final textcolors = [
0xFF0D9C00,
0xFF493272,
0xFF6563FF,
0xFF605C00,
0xFF91481B,
0xFF0D9C00,
0xFF493272,
0xFF605C00,
0xFF91481B,
0xFFED3424,
0xFF586000,
0xFF326D72,
];
return InkResponse(
......@@ -261,11 +263,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
MaterialPageRoute(
builder:
(context) => Leadlistbymode(
pageTitleName:
provider
.allLeads[jndex]
.filter!
.pageName!,
pageTitleName: "${leadTitles[jndex]}",
mode:
provider
.allLeads[jndex]
......@@ -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(
padding: EdgeInsets.symmetric(horizontal: 13),
......@@ -441,7 +450,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
// },
// ),
Container(
height: MediaQuery.of(context).size.height * 0.2,
height: MediaQuery.of(context).size.height * 0.22,
margin: EdgeInsets.symmetric(horizontal: 10),
child: Row(
children: [
......@@ -492,7 +501,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
),
),
Text(
"Leads",
"Details,\nFollowup",
// "Product and \nservice orders",
style: TextStyle(
color: AppColors.grey_semi,
......@@ -559,7 +568,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
),
),
Text(
"Accounts",
"Account Details,\nLead Details",
// "Assigned agents, \nperformance",
style: TextStyle(
color: AppColors.grey_semi,
......@@ -617,7 +626,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
children: [
Expanded(
child: Text(
"Appointment",
"Appointment\nCalendar",
style: TextStyle(
color: AppColors.app_blue,
fontSize: 14,
......@@ -628,7 +637,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
),
),
Text(
"Calendar",
"",
// "Records,\nLedger",
style: TextStyle(
color: AppColors.grey_semi,
......@@ -664,7 +673,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
child: Row(
children: [
Text(
"NearBy Leads",
"Nearby Leads",
style: TextStyle(
fontSize: 16,
color: AppColors.grey_semi,
......@@ -727,16 +736,14 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
final longitude = location.lng;
return InkResponse(
onTap: () async {
await Navigator.push(
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => NearbyOpenLeads(
latitude: latitude,
longitude: longitude,
),
settings: RouteSettings(
name: "NearbyOpenLeads",
(context) => LeadDetailsByMode(
mode: "",
pageTitleName: "Lead Details",
leadId: provider.nearByLeads[index].id,
),
),
);
......@@ -789,6 +796,22 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
),
SizedBox(width: 10),
Expanded(
child: InkResponse(
onTap: () async {
await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => NearbyOpenLeads(
latitude: latitude,
longitude: longitude,
),
settings: RouteSettings(
name: "NearbyOpenLeads",
),
),
);
},
child: Container(
decoration: BoxDecoration(
border: Border.all(
......@@ -812,6 +835,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
),
),
),
),
],
),
),
......@@ -929,7 +953,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
Container(
width: double.infinity,
child: ListView.builder(
physics: AlwaysScrollableScrollPhysics(),
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
padding: EdgeInsets.symmetric(
vertical: 5,
......@@ -973,8 +997,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
...List.generate(3, (j) {
return Container(
Container(
padding: EdgeInsets.symmetric(
vertical: 3,
horizontal: 0,
......@@ -982,43 +1005,95 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
child: Column(
children: [
if (j == 2) ...[
Padding(
padding: const EdgeInsets.only(
top: 3.0,
bottom: 3.0,
Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
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,
),
),
),
Expanded(
child: Text(
"${provider.pendingTasksLists[index].appdate}",
textAlign: TextAlign.right,
maxLines: 1,
style: TextStyle(
color: AppColors.grey_semi,
fontFamily: "JakartaRegular",
fontSize: 14,
),
child: DottedLine(
dashGapLength: 4,
dashGapColor: Colors.white,
dashColor: AppColors.grey_semi,
dashLength: 4,
lineThickness: 0.5,
),
),
],
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.start,
children: [
Expanded(
child: Text(
"${subHeadings[j]}",
"Remarks",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color:
j == 0
? AppColors.semi_black
: AppColors.grey_semi,
color: AppColors.app_blue,
fontFamily: "JakartaRegular",
fontSize: 14,
),
),
),
Expanded(
child: Text(
"${provider.pendingTasksLists[index].anote}",
textAlign: TextAlign.right,
maxLines: 1,
style: TextStyle(
color: AppColors.semi_black,
fontFamily: "JakartaRegular",
fontSize: 14,
),
),
),
],
),
),
],
),
);
}),
),
],
),
),
......@@ -1043,9 +1118,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
context,
MaterialPageRoute(
builder: (context) => Addleadsprospectsscreen(),
settings: RouteSettings(
name: 'Addleadsprospectsscreen'
)
settings: RouteSettings(name: 'Addleadsprospectsscreen'),
),
);
// }
......
......@@ -518,7 +518,7 @@ class _EditProductsListState extends State<EditProductsList> {
.map((ord) => DropdownMenuItem<Products>(
value: ord,
child: Text(
"(Product Name: ${ord.name})",
"${ord.name}",
style: const TextStyle(fontSize: 14),
overflow: TextOverflow.ellipsis,
),
......
......@@ -215,6 +215,9 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> {
],
),
),
if(provider.followupError!=null)...[
errorWidget(context, provider.followupError)
],
textControllerWidget(
context,
provider.followUpFeedbackController,
......@@ -225,7 +228,9 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> {
false,
null,
),
if(provider.followupFeedbackError!=null)...[
errorWidget(context, provider.followupFeedbackError)
],
TextWidget(context, "Lead Status"),
DropdownButtonHideUnderline(
child: Row(
......@@ -245,7 +250,7 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> {
],
),
items:
<String>['Cold', 'Hot', 'Warm']
<String>['All','Cold', 'Hot', 'Warm']
.map(
(value) =>
DropdownMenuItem<String>(
......@@ -275,7 +280,9 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> {
],
),
),
if(provider.leadStatusError!=null)...[
errorWidget(context, provider.leadStatusError)
],
TextWidget(
context,
"Next Appointment/Update Order Status",
......@@ -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> {
),
items:
<String>[
'Order Gain',
// 'Order Gain',
'Order Lost',
'No Requirement',
]
......@@ -412,6 +422,9 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> {
],
),
),
if(provider.orderStatusError!=null)...[
errorWidget(context, provider.orderStatusError)
],
if (provider.selectOrderStatus == "Order Gain")
...[]
else
......@@ -483,6 +496,9 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> {
],
),
),
if(provider.competitorError!=null)...[
errorWidget(context, provider.competitorError)
]
] else
if (provider.selectOrderStatus ==
"No Requirement")
......@@ -497,11 +513,15 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> {
false,
null,
),
if(provider.reasonError!=null)...[
errorWidget(context, provider.reasonError)
]
],
],
),
),
] else
] else if(provider.nextAppointmentStatus ==
"Next Appointment")
...[
Container(
padding: EdgeInsets.only(left: 10),
......@@ -514,11 +534,7 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> {
),
),
),
GestureDetector(
onTap: () {
provider.showDatePickerDialog(context);
},
child: Container(
Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(15),
......@@ -531,7 +547,11 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> {
mainAxisAlignment: MainAxisAlignment.start,
children: [
TextWidget(context, "Next Appointment Date"),
Container(
GestureDetector(
onTap: () {
provider.showDatePickerDialog(context);
},
child: Container(
height: 50,
alignment: Alignment.center,
decoration: BoxDecoration(
......@@ -568,6 +588,10 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> {
),
),
),
),
if(provider.nextAppDateError!=null)...[
errorWidget(context, provider.nextAppDateError)
],
TextWidget(context, "Appointment Type"),
DropdownButtonHideUnderline(
child: Row(
......@@ -620,6 +644,10 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> {
],
),
),
if(provider.nextAppType!=null)...[
errorWidget(context, provider.nextAppType)
],
if (provider.selectNextAppointmentType ==
"Visit") ...[
CheckboxListTile(
......@@ -658,10 +686,13 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> {
false,
null,
),
if(provider.noteError!=null)...[
errorWidget(context, provider.noteError)
],
],
),
),
),
],
SizedBox(height: 150),
],
......
......@@ -61,8 +61,11 @@ class _GeneratequotationaddeditproductState
if (widget.type == "add") {
// Initialize controllers and dropdowns after API call
provider.addEditInitializeForm(context);
} else {
provider.preFillFormForEdit(widget.product);
} else if (widget.type == "edit"){
print(widget.index);
print(widget.product);
provider.preFillFormForEdit(widget.product,widget.index);
}
});
}
......@@ -149,7 +152,7 @@ class _GeneratequotationaddeditproductState
) => DropdownMenuItem<Products>(
value: ord,
child: Text(
"(Product Name: ${ord.name})",
"${ord.name}",
style: const TextStyle(
fontSize: 14,
),
......@@ -185,6 +188,7 @@ class _GeneratequotationaddeditproductState
value!.id!;
provider.selectedAddEditProductName =
value.name;
print(value.id.toString());
provider.crmSelectedProductDetailsApiFunction(context, value.id.toString());
}
},
......@@ -256,12 +260,13 @@ class _GeneratequotationaddeditproductState
FloatingActionButtonLocation.centerFloat,
floatingActionButton: InkWell(
onTap: () {
if (provider.selectedLeadProducts != null) {
if (provider.selectedProducts != null) {
var newProduct;
if (widget.type == "add") {
newProduct = LeadProducts(
id: provider.selectedAddEditLeadProductId,
productName: provider.selectedAddEditLeadProductName,
productId: provider.selectedAddEditProductId,
productName: provider.selectedAddEditProductName,
price: provider.addEditProductPriceController.text,
qty: provider.addEditQuantityController.text,
......@@ -269,16 +274,16 @@ class _GeneratequotationaddeditproductState
);
provider.leadProductsList.add(newProduct);
provider.productRows.add({
"product_id": provider.selectedAddEditLeadProductId!,
"product_id": provider.selectedAddEditProductId!,
"price": provider.addEditProductPriceController.text,
"qty": provider.addEditQuantityController.text,
"net_price": provider.addEditTotalAmountController.text,
});
Navigator.pop(context, newProduct);
} else {
} else if (widget.type == "edit"){
final updatedProduct = LeadProducts(
id: provider.selectedAddEditLeadProductId,
productName: provider.selectedAddEditLeadProductName,
productId: provider.selectedAddEditProductId,
productName: provider.selectedAddEditProductName,
price: provider.addEditProductPriceController.text,
qty: provider.addEditQuantityController.text,
prodTotalPrice: provider.addEditTotalAmountController.text,
......
......@@ -215,7 +215,7 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> {
type: "edit",
product:
provider
.leadProductsList[lp]!,
.leadProductsList[lp],
index: lp,
),
settings: RouteSettings(
......@@ -353,6 +353,7 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> {
),
),
],
errorWidget(context, provider.productRowsError),
// if (provider.leadProductsList.isNotEmpty ||
// provider
// .editProductPriceControllers
......@@ -674,13 +675,30 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> {
),
child: Row(
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(
child: InkResponse(
onTap:
provider.submitLoading
provider.buttonsLoading
? null
: () {
provider.buttonsLoading = true;
//genquotedown
final insertedData = provider.productRows;
print(insertedData);
......@@ -730,9 +748,10 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> {
Expanded(
child: InkResponse(
onTap:
provider.submitLoading
provider.buttonsLoading
? null
: () {
provider.buttonsLoading = true;
//genquotemail,
final insertedData = provider.getFormData();
provider
......@@ -781,9 +800,10 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> {
Expanded(
child: InkResponse(
onTap:
provider.submitLoading
provider.buttonsLoading
? null
: () {
provider.buttonsLoading = true;
//genquotewhatsapp,
final insertedData = provider.getFormData();
provider
......
......@@ -10,6 +10,7 @@ import 'package:generp/Utils/commonServices.dart';
import 'package:generp/screens/crm/LeadDetailsByMode.dart';
import 'package:generp/screens/crm/followUpUpdateScreen.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
import '../../Utils/commonWidgets.dart';
......@@ -170,11 +171,19 @@ class _PendingtasksdetailsState extends State<Pendingtasksdetails> {
child: Text(
"${subHeadings[j]}",
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:
j == 0
? AppColors.semi_black
: AppColors.grey_semi,
fontSize: 14,
),
),
),
......@@ -225,14 +234,30 @@ class _PendingtasksdetailsState extends State<Pendingtasksdetails> {
),
),
Expanded(
child: InkResponse(
onTap:belowHeads[i]=="Mobile Number"?(){
launch(
'tel://${belowSubHeads[i]}',
);
}: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> {
Container(
width: double.infinity,
child: ListView.builder(
physics: AlwaysScrollableScrollPhysics(),
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
padding: EdgeInsets.symmetric(
vertical: 5,
......@@ -156,7 +156,7 @@ class _PendingTasksListState extends State<PendingTasksList> {
color: Colors.white,
borderRadius: BorderRadius.circular(15),
),
margin: EdgeInsets.symmetric(vertical: 3,horizontal: 10),
margin: EdgeInsets.symmetric(vertical: 3),
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
......@@ -164,8 +164,7 @@ class _PendingTasksListState extends State<PendingTasksList> {
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
...List.generate(3, (j) {
return Container(
Container(
padding: EdgeInsets.symmetric(
vertical: 3,
horizontal: 0,
......@@ -173,47 +172,84 @@ class _PendingTasksListState extends State<PendingTasksList> {
child: Column(
children: [
if (j == 2) ...[
Padding(
padding:
const EdgeInsets.only(
top: 3.0,
bottom: 3.0,
),
child: DottedLine(
dashGapLength: 4,
dashGapColor: Colors.white,
dashColor:
AppColors.grey_semi,
dashLength: 4,
lineThickness: 0.5,
Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
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,
),
),
),
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.start,
children: [
Expanded(
child: Text(
"${subHeadings[j]}",
"Remarks",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: AppColors.app_blue,
fontFamily: "JakartaRegular",
fontSize: 14,
),
),
),
Expanded(
child: Text(
"${provider.pendingTasksLists[index].anote}",
textAlign: TextAlign.right,
maxLines: 1,
style: TextStyle(
color:
j == 0
? AppColors
.semi_black
: AppColors
.grey_semi,
color: AppColors.semi_black,
fontFamily: "JakartaRegular",
fontSize: 14,
),
),
),
],
),
),
],
),
);
}),
),
],
),
),
......
......@@ -42,15 +42,25 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> {
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
appBar: appbarNew(context, "Search", 0xFFFFFFFF),
appBar: AppBar(
backgroundColor: Colors.white,
automaticallyImplyLeading: false,
toolbarHeight: 20,
),
body: SingleChildScrollView(
child: Column(
children: [
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),
height: 50,
alignment: Alignment.center,
padding: const EdgeInsets.fromLTRB(
10.0,
0.0,
10,
10,
),
height: 55,
decoration: BoxDecoration(
color: AppColors.white,
borderRadius: BorderRadius.vertical(
......@@ -58,8 +68,19 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> {
),
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
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(
padding: const EdgeInsets.fromLTRB(
0.0,
......@@ -67,17 +88,12 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> {
10,
0,
),
margin: const EdgeInsets.fromLTRB(
10.0,
0.0,
10,
10,
),
child: TextFormField(
controller: provider.searchController,
keyboardType: TextInputType.text,
maxLines: 1,
autofocus: true,
onChanged: (value) {
Future.delayed(
Duration(milliseconds: 500),
......@@ -108,7 +124,19 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> {
),
suffixIcon: Container(
padding: EdgeInsets.only(right: 10),
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",
),
),
......
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>
>(
value: ord,
child: Text(
"(Product Name: ${ord.productName})",
"${ord.productName}",
style:
const TextStyle(
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> {
>(
value: ord,
child: Text(
"(Product Name: ${ord.productName})",
"${ord.productName}",
style:
const TextStyle(
fontSize:
......
......@@ -4433,7 +4433,7 @@ class ApiCalling {
};
final res = await post(data, crmProspectDetailsAddAccountUrl, {});
if (res != null) {
print("Filter:${data}");
print("crmProspectDetailsAddAccountAPI:${data}");
debugPrint(res.body);
return CommonResponse.fromJson(jsonDecode(res.body));
} 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