Commit 7210793a authored by Sai Srinivas's avatar Sai Srinivas
Browse files

17-09

parent 185e0896
...@@ -382,22 +382,21 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> { ...@@ -382,22 +382,21 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> {
} }
return (connection == "Online") return (connection == "Online")
? Platform.isAndroid ? Platform.isAndroid
? WillPopScope( ? WillPopScope(
onWillPop: () => onBackPressed(context), onWillPop: () => onBackPressed(context),
child: SafeArea( child: SafeArea(
top: false, top: false,
bottom: true, bottom: true,
child: _buildScreen(context), child: _buildScreen(context),
), ),
) )
: _buildScreen(context) : _buildScreen(context)
: NoNetwork(context); : NoNetwork(context);
} }
Widget _buildScreen(BuildContext context) { Widget _buildScreen(BuildContext context) {
return Consumer<crmNearbyOpenLeadsProvider>( return Consumer<crmNearbyOpenLeadsProvider>(
builder: (context, provider, child) { builder: (context, provider, child) {
// { // {
// return Scaffold( // return Scaffold(
// backgroundColor: AppColors.scaffold_bg_color, // backgroundColor: AppColors.scaffold_bg_color,
...@@ -446,7 +445,7 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> { ...@@ -446,7 +445,7 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> {
topLeft: Radius.circular(30.0), topLeft: Radius.circular(30.0),
topRight: Radius.circular(30.0), topRight: Radius.circular(30.0),
), ),
child: Container( child: SizedBox(
height: MediaQuery.of(context).size.height, height: MediaQuery.of(context).size.height,
child: Stack( child: Stack(
children: [ children: [
...@@ -456,19 +455,24 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> { ...@@ -456,19 +455,24 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> {
zoomControlsEnabled: true, zoomControlsEnabled: true,
gestureRecognizers: { gestureRecognizers: {
Factory<OneSequenceGestureRecognizer>( Factory<OneSequenceGestureRecognizer>(
() => EagerGestureRecognizer(), () => EagerGestureRecognizer(),
), ),
Factory<PanGestureRecognizer>( Factory<PanGestureRecognizer>(
() => PanGestureRecognizer(), () => PanGestureRecognizer(),
), ),
Factory<ScaleGestureRecognizer>( Factory<ScaleGestureRecognizer>(
() => ScaleGestureRecognizer(), () => ScaleGestureRecognizer(),
), ),
}, },
initialCameraPosition: CameraPosition( initialCameraPosition: CameraPosition(
target: widget.latitude != null && widget.longitude != null target:
? LatLng(widget.latitude!, widget.longitude!) widget.latitude != null &&
: provider.startLocation, widget.longitude != null
? LatLng(
widget.latitude!,
widget.longitude!,
)
: provider.startLocation,
zoom: 14.0, zoom: 14.0,
), ),
markers: provider.markers.toSet(), markers: provider.markers.toSet(),
...@@ -480,11 +484,12 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> { ...@@ -480,11 +484,12 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> {
provider.onCameraMove(context, position); provider.onCameraMove(context, position);
}, },
onTap: (position) { onTap: (position) {
provider.mapController?.hideMarkerInfoWindow( provider.mapController
provider.markers.isNotEmpty ?.hideMarkerInfoWindow(
? provider.markers.first.markerId provider.markers.isNotEmpty
: MarkerId(''), ? provider.markers.first.markerId
); : MarkerId(''),
);
}, },
), ),
], ],
...@@ -495,11 +500,11 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> { ...@@ -495,11 +500,11 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> {
), ),
), ),
), ),
if (provider.isLoading || (provider.markers.isEmpty))...[ if (provider.isLoading || (provider.markers.isEmpty)) ...[
Container( Container(
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height, height: MediaQuery.of(context).size.height,
color: Colors.white38, color: Colors.white38,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
...@@ -507,12 +512,15 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> { ...@@ -507,12 +512,15 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> {
SizedBox(height: 16), SizedBox(height: 16),
Text( Text(
'Loading nearby leads...', 'Loading nearby leads...',
style: TextStyle(fontSize: 16, color: AppColors.app_blue), style: TextStyle(
fontSize: 16,
color: AppColors.app_blue,
),
), ),
], ],
), ),
) ),
] ],
], ],
), ),
), ),
...@@ -588,7 +596,7 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> { ...@@ -588,7 +596,7 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> {
vertical: 0, vertical: 0,
), ),
iconSize: 0.0, iconSize: 0.0,
initialProgress: provider.currentValue/50, initialProgress: provider.currentValue / 50,
enabled: true, enabled: true,
foregroundColor: AppColors.app_blue, foregroundColor: AppColors.app_blue,
segmentDividerColor: Color(0xFFF6F6F8), segmentDividerColor: Color(0xFFF6F6F8),
...@@ -602,7 +610,10 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> { ...@@ -602,7 +610,10 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> {
Container( Container(
child: InkWell( child: InkWell(
onTap: () { onTap: () {
provider.applyFilter(context, provider.currentValue); provider.applyFilter(
context,
provider.currentValue,
);
Navigator.pop(context); Navigator.pop(context);
}, },
child: Container( child: Container(
...@@ -641,4 +652,4 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> { ...@@ -641,4 +652,4 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> {
}, },
); );
} }
} }
\ No newline at end of file
...@@ -74,7 +74,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -74,7 +74,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
context, context,
widget.leadId, widget.leadId,
); );
provider.showMoreDetails = false; provider.showMoreDetails = false;
provider.crmProspectDetailsAPIFunction(context, widget.leadId); provider.crmProspectDetailsAPIFunction(context, widget.leadId);
}); });
} }
...@@ -122,17 +122,15 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -122,17 +122,15 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
element.id!.trim() == editProvider.accountDetails.state!.trim(), element.id!.trim() == editProvider.accountDetails.state!.trim(),
); );
if (selectedState != null) { editProvider.selectedStates = selectedState;
editProvider.selectedStates = selectedState; editProvider.selectedStateId = selectedState.id;
editProvider.selectedStateId = selectedState.id; editProvider.selectedStateValue = selectedState.name;
editProvider.selectedStateValue = selectedState.name;
await editProvider.crmLeadListDistrictsOnStateAPIFunction( await editProvider.crmLeadListDistrictsOnStateAPIFunction(
context, context,
widget.mode, widget.mode,
editProvider.selectedStateId, editProvider.selectedStateId,
); );
}
} }
// Prefill district // Prefill district
...@@ -142,17 +140,15 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -142,17 +140,15 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
(element) => (element) =>
element.id!.trim() == editProvider.accountDetails.district!.trim(), element.id!.trim() == editProvider.accountDetails.district!.trim(),
); );
if (selectedDistrict != null) { editProvider.selectedDistricts = selectedDistrict;
editProvider.selectedDistricts = selectedDistrict; editProvider.selectedDistrictId = selectedDistrict.id;
editProvider.selectedDistrictId = selectedDistrict.id; editProvider.selectedDistrictValue = selectedDistrict.district;
editProvider.selectedDistrictValue = selectedDistrict.district;
await editProvider.crmLeadListSubLocOnDistrictAPIFunction( await editProvider.crmLeadListSubLocOnDistrictAPIFunction(
context, context,
widget.mode, widget.mode,
editProvider.selectedDistrictId, editProvider.selectedDistrictId,
); );
}
} }
if (editProvider.subLocationsList.isNotEmpty && if (editProvider.subLocationsList.isNotEmpty &&
...@@ -160,11 +156,9 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -160,11 +156,9 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
final selectedSubLocation = editProvider.subLocationsList.firstWhere( final selectedSubLocation = editProvider.subLocationsList.firstWhere(
(element) => element.id == editProvider.accountDetails.subLocality, (element) => element.id == editProvider.accountDetails.subLocality,
); );
if (selectedSubLocation != null) { editProvider.selectedSubLocations = selectedSubLocation;
editProvider.selectedSubLocations = selectedSubLocation; editProvider.selectedSubLocationId = selectedSubLocation.id;
editProvider.selectedSubLocationId = selectedSubLocation.id; editProvider.selectedSubLocationValue = selectedSubLocation.subLocality;
editProvider.selectedSubLocationValue = selectedSubLocation.subLocality;
}
} }
print("Company Name: ${editProvider.editCompanyNameController.text}"); print("Company Name: ${editProvider.editCompanyNameController.text}");
...@@ -240,7 +234,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -240,7 +234,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
"PinCode", "PinCode",
]; ];
var subHeadings2 = [ var subHeadings2 = [
leadDetails!.address ?? "-", leadDetails.address ?? "-",
leadDetails.state ?? "-", leadDetails.state ?? "-",
leadDetails.district ?? "-", leadDetails.district ?? "-",
leadDetails.subLocality ?? "-", leadDetails.subLocality ?? "-",
...@@ -254,7 +248,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -254,7 +248,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
leadDetails.segment ?? "-", leadDetails.segment ?? "-",
]; ];
var headings4 = ["Lead Age"]; var headings4 = ["Lead Age"];
var subHeadings4 = ["${leadDetails!.aage ?? "-"} days old"]; var subHeadings4 = ["${leadDetails.aage ?? "-"} days old"];
var leadListNotEmpty = leadsList.isNotEmpty; var leadListNotEmpty = leadsList.isNotEmpty;
var contactNotEmpty = provider.contactList.isNotEmpty; var contactNotEmpty = provider.contactList.isNotEmpty;
...@@ -346,10 +340,9 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -346,10 +340,9 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
), ),
), ),
elevation: 2, elevation: 2,
child: Column( child: Column(
children: [ children: [
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
...@@ -368,7 +361,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -368,7 +361,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
children: [ children: [
Expanded( Expanded(
flex: 1, flex: 1,
child: Container( child: SizedBox(
height: 50, height: 50,
width: 35, width: 35,
child: SvgPicture.asset( child: SvgPicture.asset(
...@@ -396,7 +389,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -396,7 +389,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
), ),
), ),
), ),
if (provider.showTransferAccount == "1") ...[ if (provider.showTransferAccount == "1") ...[
SizedBox(width: 5), SizedBox(width: 5),
Expanded( Expanded(
...@@ -478,7 +471,9 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -478,7 +471,9 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
), ),
...List.generate(subHeadings1.length, (j) { ...List.generate(subHeadings1.length, (j) {
return Container( return Container(
padding: EdgeInsets.symmetric(vertical: 7), padding: EdgeInsets.symmetric(
vertical: 7,
),
child: Row( child: Row(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
...@@ -537,7 +532,9 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -537,7 +532,9 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
), ),
...List.generate(subHeadings2.length, (j) { ...List.generate(subHeadings2.length, (j) {
return Container( return Container(
padding: EdgeInsets.symmetric(vertical: 7), padding: EdgeInsets.symmetric(
vertical: 7,
),
child: Row( child: Row(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
...@@ -596,7 +593,9 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -596,7 +593,9 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
), ),
...List.generate(subHeadings3.length, (j) { ...List.generate(subHeadings3.length, (j) {
return Container( return Container(
padding: EdgeInsets.symmetric(vertical: 7), padding: EdgeInsets.symmetric(
vertical: 7,
),
child: Row( child: Row(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
...@@ -655,7 +654,9 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -655,7 +654,9 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
), ),
...List.generate(subHeadings4.length, (j) { ...List.generate(subHeadings4.length, (j) {
return Container( return Container(
padding: EdgeInsets.symmetric(vertical: 7), padding: EdgeInsets.symmetric(
vertical: 7,
),
child: Row( child: Row(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
...@@ -671,43 +672,44 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -671,43 +672,44 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
), ),
), ),
Expanded( Expanded(
child: subHeadings4[j] == "Lead Age" child:
? Tooltip( subHeadings4[j] == "Lead Age"
triggerMode: ? Tooltip(
TooltipTriggerMode triggerMode:
.tap, TooltipTriggerMode
.tap,
message:
"${leadDetails.createdDatetime}", message:
child: Text( "${leadDetails.createdDatetime}",
subHeadings4[j] == "" child: Text(
? "-" subHeadings4[j] == ""
: subHeadings4[j], ? "-"
style: TextStyle( : subHeadings4[j],
fontSize: 14, style: TextStyle(
color: Color( fontSize: 14,
0xFF818181, color: Color(
0xFF818181,
),
decorationColor:
AppColors
.grey_semi,
decoration:
TextDecoration
.underline,
),
),
)
: Text(
subHeadings4[j] == ""
? "-"
: subHeadings4[j],
style: TextStyle(
fontSize: 14,
color: Color(
0xFF818181,
),
), ),
decorationColor:
AppColors
.grey_semi,
decoration:
TextDecoration
.underline,
),
),
)
: Text(
subHeadings4[j] == ""
? "-"
: subHeadings4[j],
style: TextStyle(
fontSize: 14,
color: Color(
0xFF818181,
), ),
),
),
), ),
], ],
), ),
...@@ -716,7 +718,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -716,7 +718,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
], ],
), ),
), ),
InkResponse( InkResponse(
onTap: () async { onTap: () async {
HapticFeedback.selectionClick(); HapticFeedback.selectionClick();
...@@ -741,7 +743,9 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -741,7 +743,9 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
), ),
Transform.flip( Transform.flip(
flipY: flipY:
provider.showMoreDetails ? true : false, provider.showMoreDetails
? true
: false,
child: SvgPicture.asset( child: SvgPicture.asset(
"assets/svg/arrow_dropdown.svg", "assets/svg/arrow_dropdown.svg",
height: 25, height: 25,
...@@ -829,20 +833,15 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -829,20 +833,15 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: builder:
( (context) => LeadDetailsByMode(
context, mode: "",
) => LeadDetailsByMode( pageTitleName: "Lead Details",
mode: "", leadId: widget.leadId,
pageTitleName: ),
"Lead Details",
leadId:
widget.leadId,
),
), ),
); );
if (res == true) { if (res == true) {
provider provider.crmProspectDetailsAPIFunction(
.crmProspectDetailsAPIFunction(
context, context,
widget.leadId, widget.leadId,
); );
...@@ -927,7 +926,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -927,7 +926,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
child: Center( child: Center(
child: Text( child: Text(
textAlign: TextAlign.right, textAlign: TextAlign.right,
"${leadsList[index].status ?? "-"}", leadsList[index].status ?? "-",
style: TextStyle( style: TextStyle(
fontFamily: "JakartaMedium", fontFamily: "JakartaMedium",
fontSize: 14, fontSize: 14,
...@@ -1041,9 +1040,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -1041,9 +1040,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
), ),
), ),
...List.generate(1, (j) { ...List.generate(1, (j) {
final textheads = [ final textheads = ["Lead Open / Close"];
"Lead Open / Close",
];
final textSubheads = [ final textSubheads = [
leadsList[index].openStatus ?? "-", leadsList[index].openStatus ?? "-",
]; ];
...@@ -1067,19 +1064,18 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -1067,19 +1064,18 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
), ),
), ),
Expanded( Expanded(
child: Text( child: Text(
textAlign: TextAlign.right, textAlign: TextAlign.right,
textSubheads[j] == "" textSubheads[j] == ""
? "-" ? "-"
: textSubheads[j], : textSubheads[j],
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
color: Color(0xFF818181), color: Color(0xFF818181),
),
), ),
), ),
),
], ],
), ),
); );
...@@ -1126,7 +1122,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -1126,7 +1122,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
), ),
), ),
], ],
///Contact Details ///Contact Details
Container( Container(
padding: EdgeInsets.only(left: 10, right: 10, top: 10), padding: EdgeInsets.only(left: 10, right: 10, top: 10),
...@@ -1146,14 +1142,17 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -1146,14 +1142,17 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
if (contactNotEmpty) ...[ if (contactNotEmpty) ...[
Expanded( Expanded(
child: InkResponse( child: InkResponse(
onTap:provider.addContactSelected?null: () { onTap:
HapticFeedback.selectionClick(); provider.addContactSelected
provider.addContactSelected = true; ? null
_showAddContactSheet( : () {
context, HapticFeedback.selectionClick();
provider.accountDetails.id!, provider.addContactSelected = true;
); _showAddContactSheet(
}, context,
provider.accountDetails.id!,
);
},
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Text( child: Text(
...@@ -1183,27 +1182,35 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -1183,27 +1182,35 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
itemCount: provider.contactList.length, itemCount: provider.contactList.length,
itemBuilder: (context, lp) { itemBuilder: (context, lp) {
return InkResponse( return InkResponse(
onTap:provider.addContactSelected?null: () async { onTap:
provider.addContactSelected = true; provider.addContactSelected
HapticFeedback.selectionClick(); ? null
provider.editNameController.text = : () async {
provider.contactList[lp].name ?? ""; provider.addContactSelected = true;
provider.editDesignationController.text = HapticFeedback.selectionClick();
provider.contactList[lp].designation ?? ""; provider.editNameController.text =
provider.editMobileNumberController.text = provider.contactList[lp].name ?? "";
provider.contactList[lp].mob1 ?? ""; provider.editDesignationController.text =
provider.editAlternativeMobileController.text = provider
provider.contactList[lp].mob2 ?? ""; .contactList[lp]
provider.editTelephoneController.text = .designation ??
provider.contactList[lp].tel ?? ""; "";
provider.editEmailController.text = provider.editMobileNumberController.text =
provider.contactList[lp].email ?? ""; provider.contactList[lp].mob1 ?? "";
_showEditContactSheet( provider
context, .editAlternativeMobileController
lp, .text =
provider.accountDetails.id!, provider.contactList[lp].mob2 ?? "";
); provider.editTelephoneController.text =
}, provider.contactList[lp].tel ?? "";
provider.editEmailController.text =
provider.contactList[lp].email ?? "";
_showEditContactSheet(
context,
lp,
provider.accountDetails.id!,
);
},
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
...@@ -1214,7 +1221,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -1214,7 +1221,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
vertical: 10, vertical: 10,
), ),
margin: EdgeInsets.symmetric(vertical: 5), margin: EdgeInsets.symmetric(vertical: 5),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
...@@ -1246,11 +1253,9 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -1246,11 +1253,9 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
.name ?? .name ??
"-", "-",
style: TextStyle( style: TextStyle(
fontFamily: fontFamily: "JakartaMedium",
"JakartaMedium",
fontSize: 14, fontSize: 14,
color: color: AppColors.semi_black,
AppColors.semi_black,
), ),
), ),
), ),
...@@ -1264,12 +1269,20 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -1264,12 +1269,20 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
}, },
child: Text( child: Text(
textAlign: TextAlign.right, textAlign: TextAlign.right,
"${provider.contactList[lp].mob1 ?? "-"}", provider
.contactList[lp]
.mob1 ??
"-",
style: TextStyle( style: TextStyle(
height: 1, height: 1,
decorationColor: AppColors.grey_thick, decorationColor:
decoration: TextDecoration.underline, AppColors.grey_thick,
decorationStyle: TextDecorationStyle.dotted, decoration:
TextDecoration
.underline,
decorationStyle:
TextDecorationStyle
.dotted,
fontFamily: fontFamily:
"JakartaMedium", "JakartaMedium",
fontSize: 14, fontSize: 14,
...@@ -1282,8 +1295,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -1282,8 +1295,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
], ],
), ),
Text( Text(
provider.contactList[lp].email == provider.contactList[lp].email == ""
""
? "-" ? "-"
: provider : provider
.contactList[lp] .contactList[lp]
...@@ -1307,14 +1319,17 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -1307,14 +1319,17 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
), ),
] else ...[ ] else ...[
InkResponse( InkResponse(
onTap:provider.addContactSelected?null: () { onTap:
HapticFeedback.selectionClick(); provider.addContactSelected
provider.addContactSelected = true; ? null
_showAddContactSheet( : () {
context, HapticFeedback.selectionClick();
provider.accountDetails.id!, provider.addContactSelected = true;
); _showAddContactSheet(
}, context,
provider.accountDetails.id!,
);
},
child: Container( child: Container(
height: 50, height: 50,
margin: EdgeInsets.symmetric( margin: EdgeInsets.symmetric(
...@@ -1339,15 +1354,11 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -1339,15 +1354,11 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
), ),
), ),
], ],
///Order Details ///Order Details
if (orderNotEmpty) ...[ if (orderNotEmpty) ...[
Container( Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(left: 10, right: 10, top: 10),
left: 10,
right: 10,
top: 10,
),
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(
...@@ -1380,7 +1391,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -1380,7 +1391,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
return Container( return Container(
height: 250, height: 250,
width: MediaQuery.of(context).size.width * 0.9, width: MediaQuery.of(context).size.width * 0.9,
margin: EdgeInsets.symmetric(vertical: 5), margin: EdgeInsets.symmetric(vertical: 5),
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
horizontal: 15, horizontal: 15,
...@@ -1394,8 +1405,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -1394,8 +1405,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.start,
MainAxisAlignment.start,
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
...@@ -1424,7 +1434,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -1424,7 +1434,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
color: AppColors.semi_black, color: AppColors.semi_black,
), ),
), ),
Text( Text(
"${orderList[index].id}", "${orderList[index].id}",
style: TextStyle( style: TextStyle(
...@@ -1442,8 +1452,9 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -1442,8 +1452,9 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
flex: 2, flex: 2,
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius: BorderRadius.circular(
BorderRadius.circular(8), 8,
),
color: Color(0xFFF3FFD5), color: Color(0xFFF3FFD5),
), ),
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
...@@ -1453,7 +1464,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -1453,7 +1464,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
child: Center( child: Center(
child: Text( child: Text(
textAlign: TextAlign.right, textAlign: TextAlign.right,
"${orderList[index].status ?? "-"}", orderList[index].status ?? "-",
style: TextStyle( style: TextStyle(
fontFamily: "JakartaMedium", fontFamily: "JakartaMedium",
fontSize: 14, fontSize: 14,
...@@ -1466,9 +1477,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -1466,9 +1477,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
], ],
), ),
Container( Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(vertical: 3),
vertical: 3,
),
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(
...@@ -1518,7 +1527,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -1518,7 +1527,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
), ),
), ),
), ),
Expanded( Expanded(
child: Text( child: Text(
textAlign: TextAlign.right, textAlign: TextAlign.right,
...@@ -1535,11 +1544,9 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -1535,11 +1544,9 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
), ),
); );
}), }),
Container( Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(vertical: 4),
vertical: 4,
),
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(
...@@ -1618,15 +1625,13 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -1618,15 +1625,13 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
textSubheads[j] == "" textSubheads[j] == ""
? "-" ? "-"
: textSubheads[j], : textSubheads[j],
overflow: overflow: TextOverflow.ellipsis,
TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
color: AppColors.app_blue, color: AppColors.app_blue,
decorationColor: decorationColor:
AppColors.app_blue, AppColors.app_blue,
decoration: decoration:
TextDecoration TextDecoration.underline,
.underline,
), ),
), ),
), ),
...@@ -1642,15 +1647,11 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -1642,15 +1647,11 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
), ),
), ),
], ],
///Payment Details ///Payment Details
if (paymentsNotEmpty) ...[ if (paymentsNotEmpty) ...[
Container( Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(left: 10, right: 10, top: 10),
left: 10,
right: 10,
top: 10,
),
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(
...@@ -1667,7 +1668,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -1667,7 +1668,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
], ],
), ),
), ),
SizedBox( SizedBox(
width: double.infinity, width: double.infinity,
height: 200, height: 200,
...@@ -1687,21 +1688,15 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -1687,21 +1688,15 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: builder:
( (context) => Paymentdetailsbymode(
context, mode: "",
) => Paymentdetailsbymode( pageTitleName: "Payment Details",
mode: "", paymentId: paymentList[index].id,
pageTitleName: ),
"Payment Details",
paymentId:
paymentList[index]
.id,
),
), ),
); );
if (res == true) { if (res == true) {
provider provider.crmProspectDetailsAPIFunction(
.crmProspectDetailsAPIFunction(
context, context,
paymentList[index].id, paymentList[index].id,
); );
...@@ -1711,7 +1706,10 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -1711,7 +1706,10 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
height: 200, height: 200,
width: MediaQuery.of(context).size.width * 0.9, width: MediaQuery.of(context).size.width * 0.9,
margin: EdgeInsets.symmetric(vertical: 5,horizontal: 7.5), margin: EdgeInsets.symmetric(
vertical: 5,
horizontal: 7.5,
),
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
horizontal: 15, horizontal: 15,
vertical: 10, vertical: 10,
...@@ -1783,7 +1781,9 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -1783,7 +1781,9 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
child: Center( child: Center(
child: Text( child: Text(
textAlign: TextAlign.right, textAlign: TextAlign.right,
"${paymentList[index].paymentType ?? "-"}", paymentList[index]
.paymentType ??
"-",
style: TextStyle( style: TextStyle(
fontFamily: "JakartaMedium", fontFamily: "JakartaMedium",
fontSize: 14, fontSize: 14,
...@@ -1871,9 +1871,6 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -1871,9 +1871,6 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
), ),
); );
}), }),
], ],
), ),
), ),
...@@ -2099,7 +2096,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -2099,7 +2096,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
); );
provider.crmProspectDetailsAPIFunction(context, widget.leadId); provider.crmProspectDetailsAPIFunction(context, widget.leadId);
}); });
},); });
} }
Future<void> _showEditContactSheet(BuildContext context, index, accid) { Future<void> _showEditContactSheet(BuildContext context, index, accid) {
...@@ -2311,7 +2308,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -2311,7 +2308,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
); );
provider.crmProspectDetailsAPIFunction(context, widget.leadId); provider.crmProspectDetailsAPIFunction(context, widget.leadId);
}); });
},); });
} }
Future<void> _showTransferAccountSheet(BuildContext context, accID) { Future<void> _showTransferAccountSheet(BuildContext context, accID) {
...@@ -2397,10 +2394,10 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -2397,10 +2394,10 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
editProsProvider.selectedEmployees = editProsProvider.selectedEmployees =
value; value;
editProsProvider.selectedEmployeeId = editProsProvider.selectedEmployeeId =
value!.id!; value.id!;
editProsProvider editProsProvider
.selectedEmployeeValue = .selectedEmployeeValue =
value!.name!; value.name!;
} }
} }
}, },
...@@ -2526,7 +2523,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -2526,7 +2523,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
); );
provider.crmProspectDetailsAPIFunction(context, widget.leadId); provider.crmProspectDetailsAPIFunction(context, widget.leadId);
}); });
},); });
} }
Future<void> _showEditAccountSheet(BuildContext context, accID) { Future<void> _showEditAccountSheet(BuildContext context, accID) {
...@@ -2672,9 +2669,9 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -2672,9 +2669,9 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
if (value != null) { if (value != null) {
if (provider.statesList.isNotEmpty) { if (provider.statesList.isNotEmpty) {
provider.selectedStates = value; provider.selectedStates = value;
provider.selectedStateId = value!.id!; provider.selectedStateId = value.id!;
provider.selectedStateValue = provider.selectedStateValue =
value!.name!; value.name!;
if (provider if (provider
.districtsList .districtsList
.isNotEmpty) { .isNotEmpty) {
...@@ -2742,9 +2739,9 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -2742,9 +2739,9 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
if (provider.districtsList.isNotEmpty) { if (provider.districtsList.isNotEmpty) {
provider.selectedDistricts = value; provider.selectedDistricts = value;
provider.selectedDistrictId = provider.selectedDistrictId =
value!.id!; value.id!;
provider.selectedDistrictValue = provider.selectedDistrictValue =
value!.district!; value.district!;
if (provider if (provider
.subLocationsList .subLocationsList
.isNotEmpty) { .isNotEmpty) {
...@@ -2823,9 +2820,9 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -2823,9 +2820,9 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
.isNotEmpty) { .isNotEmpty) {
provider.selectedSubLocations = value; provider.selectedSubLocations = value;
provider.selectedSubLocationId = provider.selectedSubLocationId =
value!.id!; value.id!;
provider.selectedSubLocationValue = provider.selectedSubLocationValue =
value!.subLocality!; value.subLocality!;
} }
} }
}, },
...@@ -2939,7 +2936,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -2939,7 +2936,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
); );
provider.crmProspectDetailsAPIFunction(context, widget.leadId); provider.crmProspectDetailsAPIFunction(context, widget.leadId);
}); });
},); });
} }
Future<void> _showOptionsSheet(BuildContext context) { Future<void> _showOptionsSheet(BuildContext context) {
...@@ -3250,24 +3247,22 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -3250,24 +3247,22 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
items: items:
addleadProvider.leadProductsList addleadProvider.leadProductsList
.map( .map(
( (ord) =>
ord, DropdownMenuItem<Products>(
) => DropdownMenuItem<Products>( value: ord,
value: ord, child: Text(
child: Text( "${ord.name}",
"${ord.name}", style: const TextStyle(
style: const TextStyle( fontSize: 14,
fontSize: 14, ),
overflow:
TextOverflow.ellipsis,
),
), ),
overflow:
TextOverflow.ellipsis,
),
),
) )
.toList(), .toList(),
value: value:
addleadProvider.selectedProducts != addleadProvider.selectedProducts != null
null
? addleadProvider.leadProductsList ? addleadProvider.leadProductsList
.firstWhere( .firstWhere(
(ord) => (ord) =>
...@@ -3296,12 +3291,11 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -3296,12 +3291,11 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
value.id; value.id;
addleadProvider.selectedProductsID = addleadProvider.selectedProductsID =
value.name; value.name;
addleadProvider addleadProvider
.crmSelectedProductDetailsApiFunction( .crmSelectedProductDetailsApiFunction(
context, context,
value.id.toString(), value.id.toString(),
); );
} }
}, },
buttonStyleData: ddtheme.buttonStyleData, buttonStyleData: ddtheme.buttonStyleData,
......
...@@ -170,7 +170,7 @@ class _ProspectListByModeState extends State<ProspectListByMode> { ...@@ -170,7 +170,7 @@ class _ProspectListByModeState extends State<ProspectListByMode> {
children: [ children: [
Expanded( Expanded(
flex: 1, flex: 1,
child: Container( child: SizedBox(
height: 50, height: 50,
width: 35, width: 35,
...@@ -353,7 +353,7 @@ class _ProspectListByModeState extends State<ProspectListByMode> { ...@@ -353,7 +353,7 @@ class _ProspectListByModeState extends State<ProspectListByMode> {
if (widget.mode != "executive") { if (widget.mode != "executive") {
headings.add("Employee"); headings.add("Employee");
} }
return Container( return SizedBox(
height: MediaQuery.of(context).size.height * 0.3, height: MediaQuery.of(context).size.height * 0.3,
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
...@@ -550,7 +550,7 @@ class _ProspectListByModeState extends State<ProspectListByMode> { ...@@ -550,7 +550,7 @@ class _ProspectListByModeState extends State<ProspectListByMode> {
EdgeInsets.zero, EdgeInsets.zero,
), ),
); );
}).toList(), }),
], ],
], ],
), ),
......
...@@ -40,14 +40,14 @@ class _AddleadproductscreenState extends State<Addleadproductscreen> { ...@@ -40,14 +40,14 @@ class _AddleadproductscreenState extends State<Addleadproductscreen> {
context, context,
listen: false, listen: false,
); );
if(widget.type == "Add"){ if (widget.type == "Add") {
provider.selectedProducts = null; provider.selectedProducts = null;
provider.selectedProductsId = null; provider.selectedProductsId = null;
provider.selectedProductsValue = null; provider.selectedProductsValue = null;
provider.addProductPriceController.clear(); provider.addProductPriceController.clear();
provider.addQuantityController.clear(); provider.addQuantityController.clear();
provider.addTotalAmountController.clear(); provider.addTotalAmountController.clear();
}else{ } else {
provider.prefillProductForEdit(widget.editIndex!); provider.prefillProductForEdit(widget.editIndex!);
} }
...@@ -165,7 +165,7 @@ class _AddleadproductscreenState extends State<Addleadproductscreen> { ...@@ -165,7 +165,7 @@ class _AddleadproductscreenState extends State<Addleadproductscreen> {
onChanged: (Products? value) { onChanged: (Products? value) {
if (value != null) { if (value != null) {
provider.selectedProducts = value; provider.selectedProducts = value;
provider.selectedProductsId = value!.id!; provider.selectedProductsId = value.id!;
provider.selectedProductsValue = value.name; provider.selectedProductsValue = value.name;
} }
...@@ -177,44 +177,34 @@ class _AddleadproductscreenState extends State<Addleadproductscreen> { ...@@ -177,44 +177,34 @@ class _AddleadproductscreenState extends State<Addleadproductscreen> {
dropdownSearchData: DropdownSearchData( dropdownSearchData: DropdownSearchData(
searchInnerWidgetHeight: 50, searchInnerWidgetHeight: 50,
searchController: searchController:
provider provider.productSearchController,
.productSearchController,
searchInnerWidget: Padding( searchInnerWidget: Padding(
padding: const EdgeInsets.all( padding: const EdgeInsets.all(8),
8,
),
child: TextFormField( child: TextFormField(
controller: controller:
provider provider.productSearchController,
.productSearchController,
decoration: InputDecoration( decoration: InputDecoration(
isDense: true, isDense: true,
contentPadding: contentPadding:
const EdgeInsets.symmetric( const EdgeInsets.symmetric(
horizontal: 10, horizontal: 10,
vertical: 8, vertical: 8,
), ),
hintText: hintText: 'Search Product...',
'Search Product...',
border: OutlineInputBorder( border: OutlineInputBorder(
borderRadius: borderRadius: BorderRadius.circular(
BorderRadius.circular(
8, 8,
), ),
), ),
), ),
), ),
), ),
searchMatchFn: ( searchMatchFn: (item, searchValue) {
item,
searchValue,
) {
return item.value?.name return item.value?.name
?.toLowerCase() ?.toLowerCase()
.contains( .contains(
searchValue searchValue.toLowerCase(),
.toLowerCase(), ) ??
) ??
false; false;
}, },
), ),
...@@ -292,24 +282,21 @@ class _AddleadproductscreenState extends State<Addleadproductscreen> { ...@@ -292,24 +282,21 @@ class _AddleadproductscreenState extends State<Addleadproductscreen> {
floatingActionButton: InkWell( floatingActionButton: InkWell(
onTap: () { onTap: () {
HapticFeedback.selectionClick(); HapticFeedback.selectionClick();
if (provider.selectedProducts != null) { if (provider.selectedProducts != null) {
final productData = {
final productData = { "product_id": provider.selectedProductsId!,
"product_id": provider.selectedProductsId!, "price": provider.addProductPriceController.text,
"price": provider.addProductPriceController.text, "qty": provider.addQuantityController.text,
"qty": provider.addQuantityController.text, "net_price": provider.addTotalAmountController.text,
"net_price": provider.addTotalAmountController.text, };
}; if (widget.editIndex != null) {
if (widget.editIndex != null) { provider.updateProduct(widget.editIndex!, productData);
provider.updateProduct(widget.editIndex!, productData); } else {
} else { provider.addProduct(productData);
provider.addProduct(productData);
}
print(provider.getJsonEncodedProducts());
Navigator.pop(context, provider.getJsonEncodedProducts());
} }
print(provider.getJsonEncodedProducts());
Navigator.pop(context, provider.getJsonEncodedProducts());
}
}, },
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
......
...@@ -45,7 +45,7 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> { ...@@ -45,7 +45,7 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
_nameController.dispose(); _nameController.dispose();
_emailController.dispose(); _emailController.dispose();
_addressController.dispose(); _addressController.dispose();
focusNodes.map((e) => e.dispose(),); focusNodes.map((e) => e.dispose());
super.dispose(); super.dispose();
} }
...@@ -80,6 +80,7 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> { ...@@ -80,6 +80,7 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
const SnackBar(content: Text('Form submitted successfully!')), const SnackBar(content: Text('Form submitted successfully!')),
); );
} }
Future<bool> onBackPressed(BuildContext context) async { Future<bool> onBackPressed(BuildContext context) async {
if (_currentStep > 0) { if (_currentStep > 0) {
_previousStep(); _previousStep();
...@@ -88,6 +89,7 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> { ...@@ -88,6 +89,7 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
return true; return true;
} }
} }
@override @override
void initState() { void initState() {
super.initState(); super.initState();
...@@ -120,15 +122,15 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> { ...@@ -120,15 +122,15 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
} }
return (connection == "Online") return (connection == "Online")
? Platform.isAndroid ? Platform.isAndroid
? WillPopScope( ? WillPopScope(
onWillPop: () => onBackPressed(context), onWillPop: () => onBackPressed(context),
child: SafeArea( child: SafeArea(
top: false, top: false,
bottom: true, bottom: true,
child: _scaffold(context), child: _scaffold(context),
), ),
) )
: _scaffold(context) : _scaffold(context)
: NoNetwork(context); : NoNetwork(context);
} }
...@@ -257,8 +259,7 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> { ...@@ -257,8 +259,7 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
fontSize: 14, fontSize: 14,
), ),
overflow: overflow:
TextOverflow TextOverflow.ellipsis,
.ellipsis,
), ),
), ),
) )
...@@ -292,9 +293,9 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> { ...@@ -292,9 +293,9 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
TextInputType.name, TextInputType.name,
false, false,
null, null,
focusNodes[0], focusNodes[0],
focusNodes[1], focusNodes[1],
TextInputAction.next TextInputAction.next,
), ),
errorWidget(context, provider.companynameError), errorWidget(context, provider.companynameError),
...@@ -307,9 +308,9 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> { ...@@ -307,9 +308,9 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
TextInputType.name, TextInputType.name,
false, false,
null, null,
focusNodes[1], focusNodes[1],
focusNodes[2], focusNodes[2],
TextInputAction.next TextInputAction.next,
), ),
errorWidget(context, provider.nameError), errorWidget(context, provider.nameError),
...@@ -337,10 +338,10 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> { ...@@ -337,10 +338,10 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
provider.onChangemailId, provider.onChangemailId,
TextInputType.emailAddress, TextInputType.emailAddress,
false, false,
null,focusNodes[3], null,
focusNodes[3],
focusNodes[4], focusNodes[4],
TextInputAction.next, TextInputAction.next,
), ),
errorWidget(context, provider.mailIdError), errorWidget(context, provider.mailIdError),
...@@ -406,7 +407,7 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> { ...@@ -406,7 +407,7 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
false, false,
FilteringTextInputFormatter.digitsOnly, FilteringTextInputFormatter.digitsOnly,
focusNodes[6], focusNodes[6],
null, null,
TextInputAction.done, TextInputAction.done,
), ),
errorWidget(context, provider.TelephoneError), errorWidget(context, provider.TelephoneError),
...@@ -436,23 +437,37 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> { ...@@ -436,23 +437,37 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
) )
.toList(), .toList(),
// value: provider.selectedSources, // value: provider.selectedSources,
value: provider.sourcesList.isNotEmpty?provider.selectedSources!=null? value:
provider.sourcesList.firstWhere((element) => element.id==provider.selectedSourcesId, provider.sourcesList.isNotEmpty
orElse: () => provider.sourcesList[0], ? provider.selectedSources != null
):null:null, ? provider.sourcesList.firstWhere(
(element) =>
element.id ==
provider
.selectedSourcesId,
orElse:
() =>
provider
.sourcesList[0],
)
: null
: null,
onChanged: (Sources? value) { onChanged: (Sources? value) {
if (value != null) { if (value != null) {
if (provider.sourcesList.isNotEmpty) { if (provider.sourcesList.isNotEmpty) {
provider.selectedSources = value; provider.selectedSources = value;
provider.selectedSourcesId = provider.selectedSourcesId =
value!.id!; value.id!;
provider.selectedSourcesValue = provider.selectedSourcesValue =
value!.name!; value.name!;
if(provider.referencesList.isNotEmpty){ if (provider
.referencesList
.isNotEmpty) {
provider.referencesList.clear(); provider.referencesList.clear();
provider.selectedReferenceId = null; provider.selectedReferenceId = null;
provider.selectedReferenceValue = null; provider.selectedReferenceValue =
null;
} }
provider provider
...@@ -468,44 +483,33 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> { ...@@ -468,44 +483,33 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
dropdownSearchData: DropdownSearchData( dropdownSearchData: DropdownSearchData(
searchInnerWidgetHeight: 50, searchInnerWidgetHeight: 50,
searchController: searchController:
provider provider.sourceSearchController,
.sourceSearchController,
searchInnerWidget: Padding( searchInnerWidget: Padding(
padding: const EdgeInsets.all( padding: const EdgeInsets.all(8),
8,
),
child: TextFormField( child: TextFormField(
controller: controller:
provider provider.sourceSearchController,
.sourceSearchController,
decoration: InputDecoration( decoration: InputDecoration(
isDense: true, isDense: true,
contentPadding: contentPadding:
const EdgeInsets.symmetric( const EdgeInsets.symmetric(
horizontal: 10, horizontal: 10,
vertical: 8, vertical: 8,
), ),
hintText: hintText: 'Search Source...',
'Search Source...',
border: OutlineInputBorder( border: OutlineInputBorder(
borderRadius: borderRadius:
BorderRadius.circular( BorderRadius.circular(8),
8,
),
), ),
), ),
), ),
), ),
searchMatchFn: ( searchMatchFn: (item, searchValue) {
item,
searchValue,
) {
return item.value?.name return item.value?.name
?.toLowerCase() ?.toLowerCase()
.contains( .contains(
searchValue searchValue.toLowerCase(),
.toLowerCase(), ) ??
) ??
false; false;
}, },
), ),
...@@ -539,24 +543,34 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> { ...@@ -539,24 +543,34 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
items: items:
provider.referencesList provider.referencesList
.map( .map(
(slist) => DropdownMenuItem< (slist) =>
References DropdownMenuItem<References>(
>( value: slist,
value: slist, child: Text(
child: Text( slist.name!,
slist.name!, style: TextStyle(
style: TextStyle( fontSize: 14,
fontSize: 14, ),
),
), ),
),
),
) )
.toList(), .toList(),
// value: provider.selectedReference, // value: provider.selectedReference,
value: provider.referencesList.isNotEmpty?provider.selectedReference!=null? value:
provider.referencesList.firstWhere((element) => element.id==provider.selectedReferenceId, provider.referencesList.isNotEmpty
orElse: () => provider.referencesList[0], ? provider.selectedReference != null
):null:null, ? provider.referencesList.firstWhere(
(element) =>
element.id ==
provider
.selectedReferenceId,
orElse:
() =>
provider
.referencesList[0],
)
: null
: null,
onChanged: (References? value) { onChanged: (References? value) {
if (value != null) { if (value != null) {
if (provider if (provider
...@@ -564,9 +578,9 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> { ...@@ -564,9 +578,9 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
.isNotEmpty) { .isNotEmpty) {
provider.selectedReference = value; provider.selectedReference = value;
provider.selectedReferenceId = provider.selectedReferenceId =
value!.id!; value.id!;
provider.selectedReferenceValue = provider.selectedReferenceValue =
value!.name!; value.name!;
} }
} }
}, },
...@@ -574,50 +588,41 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> { ...@@ -574,50 +588,41 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
dropdownSearchData: DropdownSearchData( dropdownSearchData: DropdownSearchData(
searchInnerWidgetHeight: 50, searchInnerWidgetHeight: 50,
searchController: searchController:
provider provider.referenceSearchController,
.referenceSearchController,
searchInnerWidget: Padding( searchInnerWidget: Padding(
padding: const EdgeInsets.all( padding: const EdgeInsets.all(8),
8,
),
child: TextFormField( child: TextFormField(
controller: controller:
provider provider
.referenceSearchController, .referenceSearchController,
decoration: InputDecoration( decoration: InputDecoration(
isDense: true, isDense: true,
contentPadding: contentPadding:
const EdgeInsets.symmetric( const EdgeInsets.symmetric(
horizontal: 10, horizontal: 10,
vertical: 8, vertical: 8,
), ),
hintText: hintText: 'Search Reference...',
'Search Reference...',
border: OutlineInputBorder( border: OutlineInputBorder(
borderRadius: borderRadius:
BorderRadius.circular( BorderRadius.circular(8),
8,
),
), ),
), ),
), ),
), ),
searchMatchFn: ( searchMatchFn: (item, searchValue) {
item,
searchValue,
) {
return item.value?.name return item.value?.name
?.toLowerCase() ?.toLowerCase()
.contains( .contains(
searchValue searchValue.toLowerCase(),
.toLowerCase(), ) ??
) ??
false; false;
}, },
), ),
onMenuStateChange: (isOpen) { onMenuStateChange: (isOpen) {
if (!isOpen) { if (!isOpen) {
provider.referenceSearchController.clear(); provider.referenceSearchController
.clear();
} }
}, },
buttonStyleData: ddtheme.buttonStyleData, buttonStyleData: ddtheme.buttonStyleData,
...@@ -658,23 +663,34 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> { ...@@ -658,23 +663,34 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
) )
.toList(), .toList(),
// value: provider.selectedTeams, // value: provider.selectedTeams,
value: provider.teamsList.isNotEmpty?provider.selectedTeams!=null? value:
provider.teamsList.firstWhere((element) => element.id==provider.selectedTeamsId, provider.teamsList.isNotEmpty
orElse: () => provider.teamsList[0], ? provider.selectedTeams != null
):null:null, ? provider.teamsList.firstWhere(
(element) =>
element.id ==
provider.selectedTeamsId,
orElse:
() =>
provider.teamsList[0],
)
: null
: null,
onChanged: (Teams? value) { onChanged: (Teams? value) {
if (value != null) { if (value != null) {
if (provider.teamsList.isNotEmpty) { if (provider.teamsList.isNotEmpty) {
provider.selectedTeams = value; provider.selectedTeams = value;
provider.selectedTeamsId = provider.selectedTeamsId = value.id!;
value!.id!;
provider.selectedTeamsValue = provider.selectedTeamsValue =
value!.name!; value.name!;
if(provider.segmentsList.isNotEmpty){ if (provider
.segmentsList
.isNotEmpty) {
provider.segmentsList.clear(); provider.segmentsList.clear();
provider.selectedSegmentId = null; provider.selectedSegmentId = null;
provider.selectedSegmentValue = null; provider.selectedSegmentValue =
null;
} }
provider provider
.crmLeadListSegmentOnTeamAPIFunction( .crmLeadListSegmentOnTeamAPIFunction(
...@@ -689,44 +705,33 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> { ...@@ -689,44 +705,33 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
dropdownSearchData: DropdownSearchData( dropdownSearchData: DropdownSearchData(
searchInnerWidgetHeight: 50, searchInnerWidgetHeight: 50,
searchController: searchController:
provider provider.teamSearchController,
.teamSearchController,
searchInnerWidget: Padding( searchInnerWidget: Padding(
padding: const EdgeInsets.all( padding: const EdgeInsets.all(8),
8,
),
child: TextFormField( child: TextFormField(
controller: controller:
provider provider.teamSearchController,
.teamSearchController,
decoration: InputDecoration( decoration: InputDecoration(
isDense: true, isDense: true,
contentPadding: contentPadding:
const EdgeInsets.symmetric( const EdgeInsets.symmetric(
horizontal: 10, horizontal: 10,
vertical: 8, vertical: 8,
), ),
hintText: hintText: 'Search Team...',
'Search Team...',
border: OutlineInputBorder( border: OutlineInputBorder(
borderRadius: borderRadius:
BorderRadius.circular( BorderRadius.circular(8),
8,
),
), ),
), ),
), ),
), ),
searchMatchFn: ( searchMatchFn: (item, searchValue) {
item,
searchValue,
) {
return item.value?.name return item.value?.name
?.toLowerCase() ?.toLowerCase()
.contains( .contains(
searchValue searchValue.toLowerCase(),
.toLowerCase(), ) ??
) ??
false; false;
}, },
), ),
...@@ -773,20 +778,29 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> { ...@@ -773,20 +778,29 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
) )
.toList(), .toList(),
// value: provider.selectedSegment, // value: provider.selectedSegment,
value: provider.segmentsList.isNotEmpty?provider.selectedSegment!=null? value:
provider.segmentsList.firstWhere((element) => element.id==provider.selectedSegmentId, provider.segmentsList.isNotEmpty
orElse: () => provider.segmentsList[0], ? provider.selectedSegment != null
):null:null, ? provider.segmentsList.firstWhere(
(element) =>
element.id ==
provider
.selectedSegmentId,
orElse:
() =>
provider
.segmentsList[0],
)
: null
: null,
onChanged: (Segments? value) { onChanged: (Segments? value) {
if (value != null) { if (value != null) {
if (provider if (provider.segmentsList.isNotEmpty) {
.segmentsList
.isNotEmpty) {
provider.selectedSegment = value; provider.selectedSegment = value;
provider.selectedSegmentId = provider.selectedSegmentId =
value!.id!; value.id!;
provider.selectedSegmentValue = provider.selectedSegmentValue =
value!.name!; value.name!;
} }
} }
}, },
...@@ -794,50 +808,40 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> { ...@@ -794,50 +808,40 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
dropdownSearchData: DropdownSearchData( dropdownSearchData: DropdownSearchData(
searchInnerWidgetHeight: 50, searchInnerWidgetHeight: 50,
searchController: searchController:
provider provider.segmentSearchController,
.segmentSearchController,
searchInnerWidget: Padding( searchInnerWidget: Padding(
padding: const EdgeInsets.all( padding: const EdgeInsets.all(8),
8,
),
child: TextFormField( child: TextFormField(
controller: controller:
provider provider.segmentSearchController,
.segmentSearchController,
decoration: InputDecoration( decoration: InputDecoration(
isDense: true, isDense: true,
contentPadding: contentPadding:
const EdgeInsets.symmetric( const EdgeInsets.symmetric(
horizontal: 10, horizontal: 10,
vertical: 8, vertical: 8,
), ),
hintText: hintText: 'Search Segment...',
'Search Segment...',
border: OutlineInputBorder( border: OutlineInputBorder(
borderRadius: borderRadius:
BorderRadius.circular( BorderRadius.circular(8),
8,
),
), ),
), ),
), ),
), ),
searchMatchFn: ( searchMatchFn: (item, searchValue) {
item,
searchValue,
) {
return item.value?.name return item.value?.name
?.toLowerCase() ?.toLowerCase()
.contains( .contains(
searchValue searchValue.toLowerCase(),
.toLowerCase(), ) ??
) ??
false; false;
}, },
), ),
onMenuStateChange: (isOpen) { onMenuStateChange: (isOpen) {
if (!isOpen) { if (!isOpen) {
provider.segmentSearchController.clear(); provider.segmentSearchController
.clear();
} }
}, },
buttonStyleData: ddtheme.buttonStyleData, buttonStyleData: ddtheme.buttonStyleData,
...@@ -882,17 +886,15 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> { ...@@ -882,17 +886,15 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: builder:
(context) => Addleadproductscreen( (context) =>
type: "Add", Addleadproductscreen(type: "Add"),
),
settings: RouteSettings( settings: RouteSettings(
name: name: 'Generatequotationaddeditproduct',
'Generatequotationaddeditproduct',
), ),
), ),
); );
if (res != null) { if (res != null) {
print("result ${res}"); print("result $res");
} }
}, },
child: Container( child: Container(
...@@ -944,8 +946,7 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> { ...@@ -944,8 +946,7 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
), ),
) )
.name; .name;
final prodPrice = final prodPrice = product['price'] ?? '-';
product['price'] ?? '-';
final prodQty = product['qty'] ?? '-'; final prodQty = product['qty'] ?? '-';
final totalPrice = final totalPrice =
product['net_price'] ?? '-'; product['net_price'] ?? '-';
...@@ -968,7 +969,7 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> { ...@@ -968,7 +969,7 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
), ),
); );
if (res != null) { if (res != null) {
print("result ${res}"); print("result $res");
} }
}, },
child: Container( child: Container(
...@@ -995,8 +996,9 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> { ...@@ -995,8 +996,9 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFFE6F6FF), color: Color(0xFFE6F6FF),
borderRadius: borderRadius: BorderRadius.circular(
BorderRadius.circular(14), 14,
),
), ),
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment:
...@@ -1015,8 +1017,7 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> { ...@@ -1015,8 +1017,7 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
flex: 6, flex: 6,
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment CrossAxisAlignment.start,
.start,
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.start, MainAxisAlignment.start,
children: [ children: [
...@@ -1025,8 +1026,7 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> { ...@@ -1025,8 +1026,7 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
Expanded( Expanded(
flex: 4, flex: 4,
child: Text( child: Text(
productName ?? productName ?? "-",
"-",
maxLines: 2, maxLines: 2,
overflow: overflow:
TextOverflow TextOverflow
...@@ -1045,8 +1045,7 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> { ...@@ -1045,8 +1045,7 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
flex: 3, flex: 3,
child: Text( child: Text(
textAlign: textAlign:
TextAlign TextAlign.right,
.right,
"₹$prodPrice", "₹$prodPrice",
style: TextStyle( style: TextStyle(
fontFamily: fontFamily:
...@@ -1067,8 +1066,7 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> { ...@@ -1067,8 +1066,7 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
"JakartaMedium", "JakartaMedium",
fontSize: 14, fontSize: 14,
color: color:
AppColors AppColors.grey_semi,
.grey_semi,
), ),
), ),
SizedBox(height: 5), SizedBox(height: 5),
...@@ -1112,11 +1110,14 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> { ...@@ -1112,11 +1110,14 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
), ),
], ],
if(provider.productRows.isEmpty)...[ if (provider.productRows.isEmpty) ...[
if(provider.productsEmptyError!=null)...[ if (provider.productsEmptyError != null) ...[
errorWidget(context, provider.productsEmptyError) errorWidget(
] context,
] provider.productsEmptyError,
),
],
],
], ],
), ),
), ),
...@@ -1147,17 +1148,16 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> { ...@@ -1147,17 +1148,16 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
items: items:
provider.statesList provider.statesList
.map( .map(
(slist) => DropdownMenuItem< (slist) =>
States DropdownMenuItem<States>(
>( value: slist,
value: slist, child: Text(
child: Text( slist.name!,
slist.name!, style: TextStyle(
style: TextStyle( fontSize: 14,
fontSize: 14, ),
),
), ),
),
),
) )
.toList(), .toList(),
...@@ -1166,7 +1166,7 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> { ...@@ -1166,7 +1166,7 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
provider.statesList.isNotEmpty provider.statesList.isNotEmpty
? provider.selectedStates != ? provider.selectedStates !=
null null
? provider.statesList!.firstWhere( ? provider.statesList.firstWhere(
(ord) => (ord) =>
ord.id == ord.id ==
provider provider
...@@ -1174,7 +1174,7 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> { ...@@ -1174,7 +1174,7 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
orElse: orElse:
() => () =>
provider provider
.statesList![0]!, .statesList[0],
) )
: null : null
: null, : null,
...@@ -1185,31 +1185,32 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> { ...@@ -1185,31 +1185,32 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
.isNotEmpty) { .isNotEmpty) {
provider.selectedStates = value; provider.selectedStates = value;
provider.selectedStatesId = provider.selectedStatesId =
value!.id!; value.id!;
provider.selectedStatesValue = provider.selectedStatesValue =
value!.name!; value.name!;
provider provider
.crmLeadListDistrictsOnStateAPIFunction( .crmLeadListDistrictsOnStateAPIFunction(
context, context,
"", "",
value!.id!, value.id!,
); );
if (provider if (provider
.districtsList .districtsList
.isNotEmpty) { .isNotEmpty) {
provider.districtsList provider.districtsList.clear();
provider.subLocationsList
.clear(); .clear();
provider.subLocationsList.clear();
// provider.selectedDistricts = null; // provider.selectedDistricts = null;
provider.selectedDistrictId = provider.selectedDistrictId =
null; null;
provider.selectedDistrictValue = provider.selectedDistrictValue =
""; "";
provider.selectedSubLocationId = null; provider.selectedSubLocationId =
provider.selectedSubLocationValue = ""; null;
provider.selectedSubLocationValue =
"";
} }
} }
} }
}, },
...@@ -1259,17 +1260,16 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> { ...@@ -1259,17 +1260,16 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
provider.districtsList.isNotEmpty provider.districtsList.isNotEmpty
? provider.selectedDistricts != ? provider.selectedDistricts !=
null null
? provider.districtsList! ? provider.districtsList.firstWhere(
.firstWhere( (ord) =>
(ord) => ord.id ==
ord.id == provider
.selectedDistrictId,
orElse:
() =>
provider provider
.selectedDistrictId, .districtsList[0],
orElse: )
() =>
provider
.districtsList![0]!,
)
: null : null
: null, : null,
onChanged: (Districts? value) { onChanged: (Districts? value) {
...@@ -1280,15 +1280,15 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> { ...@@ -1280,15 +1280,15 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
provider.selectedDistricts = provider.selectedDistricts =
value; value;
provider.selectedDistrictId = provider.selectedDistrictId =
value!.id!; value.id!;
provider.selectedDistrictValue = provider.selectedDistrictValue =
value!.district!; value.district!;
provider provider
.crmLeadListSubLocOnDistrictAPIFunction( .crmLeadListSubLocOnDistrictAPIFunction(
context, context,
"", "",
value!.id!, value.id!,
); );
if (provider if (provider
.subLocationsList .subLocationsList
.isNotEmpty) { .isNotEmpty) {
...@@ -1301,7 +1301,6 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> { ...@@ -1301,7 +1301,6 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
provider.selectedSubLocationValue = provider.selectedSubLocationValue =
""; "";
} }
} }
} }
}, },
...@@ -1348,13 +1347,10 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> { ...@@ -1348,13 +1347,10 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
// value: provider.selectedSubLocations, // value: provider.selectedSubLocations,
value: value:
provider provider.subLocationsList.isNotEmpty
.subLocationsList
.isNotEmpty
? provider.selectedSubLocations != ? provider.selectedSubLocations !=
null null
? provider ? provider.subLocationsList
.subLocationsList!
.firstWhere( .firstWhere(
(ord) => (ord) =>
ord.id == ord.id ==
...@@ -1363,7 +1359,7 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> { ...@@ -1363,7 +1359,7 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
orElse: orElse:
() => () =>
provider provider
.subLocationsList![0]!, .subLocationsList[0],
) )
: null : null
: null, : null,
...@@ -1375,9 +1371,9 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> { ...@@ -1375,9 +1371,9 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
provider.selectedSubLocations = provider.selectedSubLocations =
value; value;
provider.selectedSubLocationId = provider.selectedSubLocationId =
value!.id!; value.id!;
provider.selectedSubLocationValue = provider.selectedSubLocationValue =
value!.subLocality!; value.subLocality!;
} }
} }
}, },
...@@ -1407,11 +1403,8 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> { ...@@ -1407,11 +1403,8 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
Expanded( Expanded(
child: Text( child: Text(
'Select Lead Status', 'Select Lead Status',
style: TextStyle( style: TextStyle(fontSize: 14),
fontSize: 14, overflow: TextOverflow.ellipsis,
),
overflow:
TextOverflow.ellipsis,
), ),
), ),
], ],
...@@ -1419,9 +1412,9 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> { ...@@ -1419,9 +1412,9 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
items: items:
<String>['Cold', 'Hot', 'Warm'] <String>['Cold', 'Hot', 'Warm']
.map( .map(
(value) => DropdownMenuItem< (
String value,
>( ) => DropdownMenuItem<String>(
value: value, value: value,
child: Text( child: Text(
value ?? '', value ?? '',
...@@ -1429,8 +1422,7 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> { ...@@ -1429,8 +1422,7 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
fontSize: 14, fontSize: 14,
), ),
overflow: overflow:
TextOverflow TextOverflow.ellipsis,
.ellipsis,
), ),
), ),
) )
...@@ -1521,7 +1513,7 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> { ...@@ -1521,7 +1513,7 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
onTap: () { onTap: () {
HapticFeedback.selectionClick(); HapticFeedback.selectionClick();
if (provider.validateStep3()) { if (provider.validateStep3()) {
if(provider.productRows.isNotEmpty){ if (provider.productRows.isNotEmpty) {
provider.crmAddNewLeadsAndProspectsAPIFunction( provider.crmAddNewLeadsAndProspectsAPIFunction(
context, context,
"", "",
...@@ -1537,10 +1529,9 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> { ...@@ -1537,10 +1529,9 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
provider.selectedLeadStatus, provider.selectedLeadStatus,
provider.getJsonEncodedProducts(), provider.getJsonEncodedProducts(),
); );
}else{ } else {
toast(context, "Add min. 1 product"); toast(context, "Add min. 1 product");
} }
} }
details.onStepContinue; details.onStepContinue;
......
...@@ -114,13 +114,14 @@ class _AddProspectLeadsState extends State<AddProspectLeads> { ...@@ -114,13 +114,14 @@ class _AddProspectLeadsState extends State<AddProspectLeads> {
items: items:
editProvider.employeeList editProvider.employeeList
.map( .map(
(slist) => DropdownMenuItem<LeadEmployees>( (slist) =>
value: slist, DropdownMenuItem<LeadEmployees>(
child: Text( value: slist,
slist.name!, child: Text(
style: TextStyle(fontSize: 14), slist.name!,
), style: TextStyle(fontSize: 14),
), ),
),
) )
.toList(), .toList(),
value: value:
...@@ -135,9 +136,9 @@ class _AddProspectLeadsState extends State<AddProspectLeads> { ...@@ -135,9 +136,9 @@ class _AddProspectLeadsState extends State<AddProspectLeads> {
if (value != null) { if (value != null) {
if (editProvider.employeeList.isNotEmpty) { if (editProvider.employeeList.isNotEmpty) {
editProvider.selectedEmployee = value; editProvider.selectedEmployee = value;
editProvider.selectedEmployeeId = value!.id!; editProvider.selectedEmployeeId = value.id!;
editProvider.selectedEmployeeValue = editProvider.selectedEmployeeValue =
value!.name!; value.name!;
} }
} }
}, },
......
...@@ -261,7 +261,7 @@ class _AppointmentcalendarState extends State<Appointmentcalendar> { ...@@ -261,7 +261,7 @@ class _AppointmentcalendarState extends State<Appointmentcalendar> {
children: [ children: [
Expanded( Expanded(
flex: 1, flex: 1,
child: Container( child: SizedBox(
height: 50, height: 50,
width: 35, width: 35,
child: SvgPicture.asset( child: SvgPicture.asset(
...@@ -341,9 +341,7 @@ class _AppointmentcalendarState extends State<Appointmentcalendar> { ...@@ -341,9 +341,7 @@ class _AppointmentcalendarState extends State<Appointmentcalendar> {
decoration: BoxDecoration( decoration: BoxDecoration(
color: AppColors.scaffold_bg_color, color: AppColors.scaffold_bg_color,
), ),
child: Center( child: Center(child: Text("No Data Available")),
child: Text("No Data Available"),
),
), ),
), ),
], ],
...@@ -459,7 +457,7 @@ class _AppointmentcalendarState extends State<Appointmentcalendar> { ...@@ -459,7 +457,7 @@ class _AppointmentcalendarState extends State<Appointmentcalendar> {
), ),
), ),
const SizedBox(height: 8), const SizedBox(height: 8),
Container( SizedBox(
height: 70, // Increased height to accommodate weekday text height: 70, // Increased height to accommodate weekday text
child: ListView.builder( child: ListView.builder(
controller: scrollController, controller: scrollController,
......
...@@ -192,7 +192,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -192,7 +192,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
physics: AlwaysScrollableScrollPhysics(), physics: AlwaysScrollableScrollPhysics(),
child: Column( child: Column(
children: [ children: [
if (provider.allLeads.length > 0) ...[ if (provider.allLeads.isNotEmpty) ...[
Container( Container(
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5), padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
margin: EdgeInsets.only(bottom: 10), margin: EdgeInsets.only(bottom: 10),
...@@ -274,7 +274,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -274,7 +274,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
MaterialPageRoute( MaterialPageRoute(
builder: builder:
(context) => Leadlistbymode( (context) => Leadlistbymode(
pageTitleName: "${leadTitles[jndex]}", pageTitleName: leadTitles[jndex],
mode: mode:
provider provider
.allLeads[jndex] .allLeads[jndex]
...@@ -527,8 +527,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -527,8 +527,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
builder: builder:
(context) => Leadlistbymode( (context) => Leadlistbymode(
mode: "executive", mode: "executive",
pageTitleName: pageTitleName: "Lead List",
"Lead List",
), ),
), ),
); );
...@@ -948,7 +947,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -948,7 +947,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
), ),
], ],
if (provider.pendingTasksLists.length > 0) ...[ if (provider.pendingTasksLists.isNotEmpty) ...[
Align( Align(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
child: Padding( child: Padding(
...@@ -1003,7 +1002,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -1003,7 +1002,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
), ),
), ),
), ),
Container( SizedBox(
width: double.infinity, width: double.infinity,
child: ListView.builder( child: ListView.builder(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
......
...@@ -17,14 +17,19 @@ class EditAccountDetails extends StatefulWidget { ...@@ -17,14 +17,19 @@ class EditAccountDetails extends StatefulWidget {
final accountID; final accountID;
final companyName; final companyName;
const EditAccountDetails({super.key,required this.leadID,required this.mode,required this.accountID,required this.companyName}); const EditAccountDetails({
super.key,
required this.leadID,
required this.mode,
required this.accountID,
required this.companyName,
});
@override @override
State<EditAccountDetails> createState() => _EditAccountDetailsState(); State<EditAccountDetails> createState() => _EditAccountDetailsState();
} }
class _EditAccountDetailsState extends State<EditAccountDetails> { class _EditAccountDetailsState extends State<EditAccountDetails> {
Dropdowntheme ddtheme = Dropdowntheme(); Dropdowntheme ddtheme = Dropdowntheme();
@override @override
void initState() { void initState() {
...@@ -36,7 +41,11 @@ class _EditAccountDetailsState extends State<EditAccountDetails> { ...@@ -36,7 +41,11 @@ class _EditAccountDetailsState extends State<EditAccountDetails> {
listen: false, listen: false,
); );
provider.editCompanyNameController.text = widget.companyName!; provider.editCompanyNameController.text = widget.companyName!;
provider.crmLeadDetailsEditAccountAPIFunction(context, widget.leadID, widget.mode); provider.crmLeadDetailsEditAccountAPIFunction(
context,
widget.leadID,
widget.mode,
);
}); });
} }
...@@ -48,25 +57,23 @@ class _EditAccountDetailsState extends State<EditAccountDetails> { ...@@ -48,25 +57,23 @@ class _EditAccountDetailsState extends State<EditAccountDetails> {
onWillPop: () => onBackPressed(context), onWillPop: () => onBackPressed(context),
child: SafeArea( child: SafeArea(
top: false, top: false,
bottom: Platform.isIOS?false:true, bottom: Platform.isIOS ? false : true,
child: Scaffold( child: Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
appBar: appbar(context, "Edit Account"), appBar: appbar(context, "Edit Account"),
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
body: Container( body: Container(
padding: EdgeInsets.symmetric(horizontal: 10,vertical: 10), padding: EdgeInsets.symmetric(horizontal: 10, vertical: 10),
margin: EdgeInsets.symmetric(horizontal: 10,vertical: 5), margin: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(12.0), borderRadius: BorderRadius.circular(12.0),
), ),
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
textControllerWidget( textControllerWidget(
context, context,
provider.editCompanyNameController, provider.editCompanyNameController,
...@@ -90,30 +97,31 @@ class _EditAccountDetailsState extends State<EditAccountDetails> { ...@@ -90,30 +97,31 @@ class _EditAccountDetailsState extends State<EditAccountDetails> {
style: TextStyle(fontSize: 14), style: TextStyle(fontSize: 14),
), ),
items: items:
provider.teamsList provider.teamsList
.map( .map(
(slist) => (slist) => DropdownMenuItem<Teams>(
DropdownMenuItem<Teams>( value: slist,
value: slist, child: Text(
child: Text( slist.name!,
slist.name!, style: TextStyle(fontSize: 14),
style: TextStyle( ),
fontSize: 14,
), ),
), )
), .toList(),
)
.toList(),
value: provider.selectedTeams, value: provider.selectedTeams,
onChanged: (Teams? value) { onChanged: (Teams? value) {
if (value != null) { if (value != null) {
if(provider.teamsList.isNotEmpty){ if (provider.teamsList.isNotEmpty) {
provider.selectedTeams = value; provider.selectedTeams = value;
provider.selectedTeamId = value!.id!; provider.selectedTeamId = value.id!;
provider.selectedTeamValue = value!.name!; provider.selectedTeamValue = value.name!;
provider.crmLeadListSegmentOnTeamAPIFunction(context, widget.mode, provider.selectedTeamId); provider
.crmLeadListSegmentOnTeamAPIFunction(
context,
widget.mode,
provider.selectedTeamId,
);
} }
} }
}, },
isExpanded: true, isExpanded: true,
...@@ -138,29 +146,26 @@ class _EditAccountDetailsState extends State<EditAccountDetails> { ...@@ -138,29 +146,26 @@ class _EditAccountDetailsState extends State<EditAccountDetails> {
style: TextStyle(fontSize: 14), style: TextStyle(fontSize: 14),
), ),
items: items:
provider.segmentsList provider.segmentsList
.map( .map(
(slist) => (slist) => DropdownMenuItem<Segments>(
DropdownMenuItem<Segments>( value: slist,
value: slist, child: Text(
child: Text( slist.name!,
slist.name!, style: TextStyle(fontSize: 14),
style: TextStyle( ),
fontSize: 14,
), ),
), )
), .toList(),
)
.toList(),
value: provider.selectedSegments, value: provider.selectedSegments,
onChanged: (Segments? value) { onChanged: (Segments? value) {
if (value != null) { if (value != null) {
if(provider.segmentsList.isNotEmpty){ if (provider.segmentsList.isNotEmpty) {
provider.selectedSegments = value; provider.selectedSegments = value;
provider.selectedSegmentId = value!.id!; provider.selectedSegmentId = value.id!;
provider.selectedSegmentValue = value!.name!; provider.selectedSegmentValue =
value.name!;
} }
} }
}, },
isExpanded: true, isExpanded: true,
...@@ -173,12 +178,21 @@ class _EditAccountDetailsState extends State<EditAccountDetails> { ...@@ -173,12 +178,21 @@ class _EditAccountDetailsState extends State<EditAccountDetails> {
], ],
), ),
), ),
SizedBox(height: 25,), SizedBox(height: 25),
InkWell( InkWell(
onTap: provider.isLoading?null:(){ onTap:
provider.isLoading = true; provider.isLoading
provider.crmLeadDetailsEditAccountSubmitAPIFunction(context, widget.accountID, provider.selectedSegmentId, provider.selectedTeamId); ? null
}, : () {
provider.isLoading = true;
provider
.crmLeadDetailsEditAccountSubmitAPIFunction(
context,
widget.accountID,
provider.selectedSegmentId,
provider.selectedTeamId,
);
},
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
height: 45, height: 45,
...@@ -193,11 +207,18 @@ class _EditAccountDetailsState extends State<EditAccountDetails> { ...@@ -193,11 +207,18 @@ class _EditAccountDetailsState extends State<EditAccountDetails> {
borderRadius: BorderRadius.circular(14.0), borderRadius: BorderRadius.circular(14.0),
), ),
child: Center( child: Center(
child: provider.isLoading?CircularProgressIndicator.adaptive(valueColor: AlwaysStoppedAnimation(AppColors.white),):Text( child:
"Submit", provider.isLoading
textAlign: TextAlign.center, ? CircularProgressIndicator.adaptive(
style: TextStyle(color: Colors.white), valueColor: AlwaysStoppedAnimation(
), AppColors.white,
),
)
: Text(
"Submit",
textAlign: TextAlign.center,
style: TextStyle(color: Colors.white),
),
), ),
), ),
), ),
...@@ -205,13 +226,10 @@ class _EditAccountDetailsState extends State<EditAccountDetails> { ...@@ -205,13 +226,10 @@ class _EditAccountDetailsState extends State<EditAccountDetails> {
), ),
), ),
), ),
), ),
), ),
); );
}, },
); );
} }
} }
...@@ -16,7 +16,7 @@ import 'followUpUpdateScreen.dart'; ...@@ -16,7 +16,7 @@ import 'followUpUpdateScreen.dart';
class Followuplistontype extends StatefulWidget { class Followuplistontype extends StatefulWidget {
final type; final type;
const Followuplistontype({super.key,required this.type}); const Followuplistontype({super.key, required this.type});
@override @override
State<Followuplistontype> createState() => _FollowuplistontypeState(); State<Followuplistontype> createState() => _FollowuplistontypeState();
...@@ -62,22 +62,22 @@ class _FollowuplistontypeState extends State<Followuplistontype> { ...@@ -62,22 +62,22 @@ class _FollowuplistontypeState extends State<Followuplistontype> {
} }
return (connection == "Online") return (connection == "Online")
? Platform.isAndroid ? Platform.isAndroid
? WillPopScope( ? WillPopScope(
onWillPop: () => onBackPressed(context), onWillPop: () => onBackPressed(context),
child: SafeArea( child: SafeArea(
top: false, top: false,
bottom: true, bottom: true,
child: _scaffold(context), child: _scaffold(context),
), ),
) )
: _scaffold(context) : _scaffold(context)
: NoNetwork(context); : NoNetwork(context);
} }
Widget _scaffold(BuildContext context) { Widget _scaffold(BuildContext context) {
return Consumer<Crmdashboardprovider>( return Consumer<Crmdashboardprovider>(
builder: (context, provider, child) { builder: (context, provider, child) {
var followUps = provider.dashboardFollowUps; var followUps = provider.dashboardFollowUps;
return Scaffold( return Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
...@@ -114,162 +114,186 @@ class _FollowuplistontypeState extends State<Followuplistontype> { ...@@ -114,162 +114,186 @@ class _FollowuplistontypeState extends State<Followuplistontype> {
), ),
), ),
body: body:
(followUps.isNotEmpty) (followUps.isNotEmpty)
? SingleChildScrollView( ? SingleChildScrollView(
physics: AlwaysScrollableScrollPhysics(), physics: AlwaysScrollableScrollPhysics(),
child: Column( child: Column(
children: [ children: [
Container( SizedBox(
width: double.infinity, width: double.infinity,
child: ListView.builder( child: ListView.builder(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
shrinkWrap: true, shrinkWrap: true,
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
vertical: 5, vertical: 5,
horizontal: 10, horizontal: 10,
),
itemCount: followUps.length,
itemBuilder: (context, index) {
final subHeadings = [
followUps[index].aname ?? "-",
followUps[index].appdate ??
"-",
followUps[index].anote ?? "-",
];
return InkResponse(
onTap: () async {
var res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
Followupupdatescreen(
leadID:
followUps[index]
.leadid,
mode: "",
),
settings: RouteSettings(
name: 'Followupupdatescreen',
),
), ),
); itemCount: followUps.length,
if(routeSettingName=="Followupupdatescreen"){ itemBuilder: (context, index) {
provider.crmDashboardFollowUpAPIFunction(context, widget.type); final subHeadings = [
} followUps[index].aname ?? "-",
}, followUps[index].appdate ?? "-",
child: Container( followUps[index].anote ?? "-",
decoration: BoxDecoration( ];
color: Colors.white, return InkResponse(
borderRadius: BorderRadius.circular(15), onTap: () async {
), var res = await Navigator.push(
margin: EdgeInsets.symmetric(vertical: 3), context,
padding: EdgeInsets.symmetric( MaterialPageRoute(
horizontal: 10, builder:
vertical: 5, (context) => Followupupdatescreen(
), leadID: followUps[index].leadid,
child: Column( mode: "",
mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.symmetric(
vertical: 3,
horizontal: 0,
),
child: Column(
children: [
Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
"${followUps[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,
),
), ),
settings: RouteSettings(
name: 'Followupupdatescreen',
),
),
);
if (routeSettingName ==
"Followupupdatescreen") {
provider.crmDashboardFollowUpAPIFunction(
context,
widget.type,
);
}
},
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(15),
),
margin: EdgeInsets.symmetric(vertical: 3),
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.symmetric(
vertical: 3,
horizontal: 0,
), ),
Expanded(
child: Text( child: Column(
"${followUps[index].appdate}", children: [
textAlign: TextAlign.right, Row(
maxLines: 1, crossAxisAlignment:
style: TextStyle( CrossAxisAlignment.start,
color: AppColors.grey_semi, children: [
fontFamily: "JakartaRegular", Expanded(
fontSize: 14, child: Text(
"${followUps[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(
"${followUps[index].appdate}",
textAlign: TextAlign.right,
maxLines: 1,
style: TextStyle(
color:
AppColors.grey_semi,
fontFamily:
"JakartaRegular",
fontSize: 14,
),
),
),
],
), ),
), SizedBox(height: 10),
), Container(
], padding: EdgeInsets.symmetric(
), vertical: 10,
SizedBox(height: 10,), horizontal: 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(
"Remarks",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: AppColors.app_blue,
fontFamily: "JakartaRegular",
fontSize: 14,
), ),
), decoration: BoxDecoration(
), borderRadius:
Expanded( BorderRadius.circular(16),
child: Text( gradient: LinearGradient(
"${followUps[index].anote}", colors: [
textAlign: TextAlign.right, Color(0xFFFFFFFF),
maxLines: 1, Color(0xFFE8F7FF),
style: TextStyle( ],
color: AppColors.semi_black, ),
fontFamily: "JakartaRegular", ),
fontSize: 14, child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
"Remarks",
maxLines: 1,
overflow:
TextOverflow.ellipsis,
style: TextStyle(
color:
AppColors.app_blue,
fontFamily:
"JakartaRegular",
fontSize: 14,
),
),
),
Expanded(
child: Text(
"${followUps[index].anote}",
textAlign:
TextAlign.right,
maxLines: 1,
style: TextStyle(
color:
AppColors
.semi_black,
fontFamily:
"JakartaRegular",
fontSize: 14,
),
),
),
],
), ),
), ),
), ],
], ),
), ),
), ],
], ),
), ),
), );
], },
), ),
), ),
);
},
),
),
SizedBox(height: 150), SizedBox(height: 150),
], ],
), ),
) )
: Emptywidget(context), : Emptywidget(context),
); );
}, },
); );
......
...@@ -15,7 +15,12 @@ class Followupupdatescreen extends StatefulWidget { ...@@ -15,7 +15,12 @@ class Followupupdatescreen extends StatefulWidget {
final leadID; final leadID;
final mode; final mode;
final from; final from;
const Followupupdatescreen({super.key,required this.leadID, this.mode, this.from}); const Followupupdatescreen({
super.key,
required this.leadID,
this.mode,
this.from,
});
@override @override
State<Followupupdatescreen> createState() => _FollowupupdatescreenState(); State<Followupupdatescreen> createState() => _FollowupupdatescreenState();
...@@ -26,7 +31,6 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> { ...@@ -26,7 +31,6 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> {
Map _source = {ConnectivityResult.mobile: true}; Map _source = {ConnectivityResult.mobile: true};
final MyConnectivity _connectivity = MyConnectivity.instance; final MyConnectivity _connectivity = MyConnectivity.instance;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
...@@ -35,7 +39,10 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> { ...@@ -35,7 +39,10 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> {
setState(() => _source = event); setState(() => _source = event);
}); });
WidgetsBinding.instance.addPostFrameCallback((timeStamp) { WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
final provider = Provider.of<followUpUpdateProvider>(context,listen: false); final provider = Provider.of<followUpUpdateProvider>(
context,
listen: false,
);
provider.getCurrentLocation(context); provider.getCurrentLocation(context);
}); });
} }
...@@ -62,15 +69,15 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> { ...@@ -62,15 +69,15 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> {
} }
return (connection == "Online") return (connection == "Online")
? Platform.isAndroid ? Platform.isAndroid
? WillPopScope( ? WillPopScope(
onWillPop: () => onBackPressed(context), onWillPop: () => onBackPressed(context),
child: SafeArea( child: SafeArea(
top: false, top: false,
bottom: true, bottom: true,
child: _scaffold(context), child: _scaffold(context),
), ),
) )
: _scaffold(context) : _scaffold(context)
: NoNetwork(context); : NoNetwork(context);
} }
...@@ -116,7 +123,7 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> { ...@@ -116,7 +123,7 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> {
child: Column( child: Column(
children: [ children: [
Container( Container(
padding: EdgeInsets.only(left: 10,top: 10), padding: EdgeInsets.only(left: 10, top: 10),
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: Text( child: Text(
"Follow up Details", "Follow up Details",
...@@ -154,10 +161,7 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> { ...@@ -154,10 +161,7 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> {
child: Row( child: Row(
children: [ children: [
Text( Text(
provider.selectedTime.hour.toString() + "${provider.selectedTime.hour}:${provider.selectedTime.minute}" ??
":" +
provider.selectedTime.minute
.toString() ??
"Enter in Time", "Enter in Time",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle(fontWeight: FontWeight.w400), style: TextStyle(fontWeight: FontWeight.w400),
...@@ -186,21 +190,20 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> { ...@@ -186,21 +190,20 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> {
], ],
), ),
items: items:
<String>['Phone', 'Visit'] <String>['Phone', 'Visit']
.map( .map(
(value) => (value) => DropdownMenuItem<String>(
DropdownMenuItem<String>( value: value,
value: value, child: Text(
child: Text( value ?? '',
value ?? '', style: const TextStyle(
style: const TextStyle( fontSize: 14,
fontSize: 14, ),
overflow: TextOverflow.ellipsis,
),
), ),
overflow: TextOverflow.ellipsis, )
), .toList(),
),
)
.toList(),
value: provider.selectedFollowupType, value: provider.selectedFollowupType,
onChanged: (String? newValue) { onChanged: (String? newValue) {
setState(() { setState(() {
...@@ -216,8 +219,8 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> { ...@@ -216,8 +219,8 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> {
], ],
), ),
), ),
if(provider.followupError!=null)...[ if (provider.followupError != null) ...[
errorWidget(context, provider.followupError) errorWidget(context, provider.followupError),
], ],
textControllerWidget( textControllerWidget(
context, context,
...@@ -229,8 +232,8 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> { ...@@ -229,8 +232,8 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> {
false, false,
null, null,
), ),
if(provider.followupFeedbackError!=null)...[ if (provider.followupFeedbackError != null) ...[
errorWidget(context, provider.followupFeedbackError) errorWidget(context, provider.followupFeedbackError),
], ],
TextWidget(context, "Lead Status"), TextWidget(context, "Lead Status"),
DropdownButtonHideUnderline( DropdownButtonHideUnderline(
...@@ -251,21 +254,20 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> { ...@@ -251,21 +254,20 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> {
], ],
), ),
items: items:
<String>['All','Cold', 'Hot', 'Warm'] <String>['All', 'Cold', 'Hot', 'Warm']
.map( .map(
(value) => (value) => DropdownMenuItem<String>(
DropdownMenuItem<String>( value: value,
value: value, child: Text(
child: Text( value ?? '',
value ?? '', style: const TextStyle(
style: const TextStyle( fontSize: 14,
fontSize: 14, ),
overflow: TextOverflow.ellipsis,
),
), ),
overflow: TextOverflow.ellipsis, )
), .toList(),
),
)
.toList(),
value: provider.selectedLeadStatus, value: provider.selectedLeadStatus,
onChanged: (String? newValue) { onChanged: (String? newValue) {
setState(() { setState(() {
...@@ -281,8 +283,8 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> { ...@@ -281,8 +283,8 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> {
], ],
), ),
), ),
if(provider.leadStatusError!=null)...[ if (provider.leadStatusError != null) ...[
errorWidget(context, provider.leadStatusError) errorWidget(context, provider.leadStatusError),
], ],
TextWidget( TextWidget(
context, context,
...@@ -306,24 +308,23 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> { ...@@ -306,24 +308,23 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> {
], ],
), ),
items: items:
<String>[ <String>[
'Next Appointment', 'Next Appointment',
'Update Order Status', 'Update Order Status',
] ]
.map( .map(
(value) => (value) => DropdownMenuItem<String>(
DropdownMenuItem<String>( value: value,
value: value, child: Text(
child: Text( value ?? '',
value ?? '', style: const TextStyle(
style: const TextStyle( fontSize: 14,
fontSize: 14, ),
overflow: TextOverflow.ellipsis,
),
), ),
overflow: TextOverflow.ellipsis, )
), .toList(),
),
)
.toList(),
value: provider.nextAppointmentStatus, value: provider.nextAppointmentStatus,
onChanged: (String? newValue) { onChanged: (String? newValue) {
setState(() { setState(() {
...@@ -339,9 +340,9 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> { ...@@ -339,9 +340,9 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> {
], ],
), ),
), ),
if(provider.appStatusError!=null)...[ if (provider.appStatusError != null) ...[
errorWidget(context, provider.appStatusError) errorWidget(context, provider.appStatusError),
] ],
], ],
), ),
), ),
...@@ -389,25 +390,24 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> { ...@@ -389,25 +390,24 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> {
], ],
), ),
items: items:
<String>[ <String>[
// 'Order Gain', // 'Order Gain',
'Order Lost', 'Order Lost',
'No Requirement', 'No Requirement',
] ]
.map( .map(
(value) => (value) => DropdownMenuItem<String>(
DropdownMenuItem<String>( value: value,
value: value, child: Text(
child: Text( value ?? '',
value ?? '', style: const TextStyle(
style: const TextStyle( fontSize: 14,
fontSize: 14, ),
overflow: TextOverflow.ellipsis,
),
), ),
overflow: TextOverflow.ellipsis, )
), .toList(),
),
)
.toList(),
value: provider.selectOrderStatus, value: provider.selectOrderStatus,
onChanged: (String? newValue) { onChanged: (String? newValue) {
setState(() { setState(() {
...@@ -423,301 +423,296 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> { ...@@ -423,301 +423,296 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> {
], ],
), ),
), ),
if(provider.orderStatusError!=null)...[ if (provider.orderStatusError != null) ...[
errorWidget(context, provider.orderStatusError) errorWidget(context, provider.orderStatusError),
], ],
if (provider.selectOrderStatus == "Order Gain") if (provider.selectOrderStatus == "Order Gain")
...[] ...[]
else else ...[
...[ if (provider.selectOrderStatus == "Order Lost") ...[
if (provider.selectOrderStatus == "Order Lost") ...[ TextWidget(context, "Select Competitor"),
TextWidget(context, "Select Competitor"), DropdownButtonHideUnderline(
DropdownButtonHideUnderline( child: Row(
child: Row( children: [
children: [ Expanded(
Expanded( child: DropdownButton2<String>(
child: DropdownButton2<String>( isExpanded: true,
isExpanded: true, hint: const Row(
hint: const Row( children: [
children: [ Expanded(
Expanded( child: Text(
child: Text( 'Select Competitor',
'Select Competitor', style: TextStyle(fontSize: 14),
style: TextStyle(fontSize: 14), overflow: TextOverflow.ellipsis,
overflow: TextOverflow.ellipsis,
),
), ),
], ),
), ],
items:
<String>[
"Mahindra",
"Kirloskar",
"Cummins",
"Ashok Leyland",
"Escorts",
"Eicher",
"Eicher Volovo",
"Ecogen",
"Crompton Greaves",
"Caterpillar",
]
.map(
(value) =>
DropdownMenuItem<String>(
value: value,
child: Text(
value ?? '',
style: const TextStyle(
fontSize: 14,
),
overflow:
TextOverflow
.ellipsis,
),
),
)
.toList(),
value: provider.selectedCompetitor,
onChanged: (String? newValue) {
setState(() {
provider.selectedCompetitor =
newValue!;
});
},
buttonStyleData: ddtheme
.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData:
ddtheme.menuItemStyleData,
dropdownStyleData:
ddtheme.dropdownStyleData,
), ),
items:
<String>[
"Mahindra",
"Kirloskar",
"Cummins",
"Ashok Leyland",
"Escorts",
"Eicher",
"Eicher Volovo",
"Ecogen",
"Crompton Greaves",
"Caterpillar",
]
.map(
(value) =>
DropdownMenuItem<String>(
value: value,
child: Text(
value ?? '',
style: const TextStyle(
fontSize: 14,
),
overflow:
TextOverflow
.ellipsis,
),
),
)
.toList(),
value: provider.selectedCompetitor,
onChanged: (String? newValue) {
setState(() {
provider.selectedCompetitor =
newValue!;
});
},
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData:
ddtheme.menuItemStyleData,
dropdownStyleData:
ddtheme.dropdownStyleData,
), ),
], ),
), ],
), ),
if(provider.competitorError!=null)...[
errorWidget(context, provider.competitorError)
]
] else
if (provider.selectOrderStatus ==
"No Requirement")
...[],
textControllerWidget(
context,
provider.reasonController,
"Reason",
"Reason (Description)",
provider.onReasonChanged,
TextInputType.text,
false,
null,
), ),
if(provider.reasonError!=null)...[ if (provider.competitorError != null) ...[
errorWidget(context, provider.reasonError) errorWidget(context, provider.competitorError),
] ],
] else if (provider.selectOrderStatus ==
"No Requirement")
...[],
textControllerWidget(
context,
provider.reasonController,
"Reason",
"Reason (Description)",
provider.onReasonChanged,
TextInputType.text,
false,
null,
),
if (provider.reasonError != null) ...[
errorWidget(context, provider.reasonError),
], ],
],
], ],
), ),
), ),
SizedBox(height: 25), SizedBox(height: 25),
] else if(provider.nextAppointmentStatus == ] else if (provider.nextAppointmentStatus ==
"Next Appointment") "Next Appointment") ...[
...[ Container(
Container( padding: EdgeInsets.only(left: 10),
padding: EdgeInsets.only(left: 10), alignment: Alignment.topLeft,
alignment: Alignment.topLeft, child: Text(
child: Text( "Next Appointment",
"Next Appointment", style: TextStyle(
style: TextStyle( color: AppColors.grey_thick,
color: AppColors.grey_thick, fontSize: 16,
fontSize: 16,
),
), ),
), ),
Container( ),
decoration: BoxDecoration( Container(
color: Colors.white, decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15), color: Colors.white,
), borderRadius: BorderRadius.circular(15),
margin: EdgeInsets.symmetric(vertical: 5, horizontal: 10), ),
padding: EdgeInsets.symmetric( margin: EdgeInsets.symmetric(vertical: 5, horizontal: 10),
horizontal: 10, vertical: 5), padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
TextWidget(context, "Next Appointment Date"), TextWidget(context, "Next Appointment Date"),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
provider.showDatePickerDialog(context); provider.showDatePickerDialog(context);
}, },
child: Container( child: Container(
height: 50, height: 50,
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
color: AppColors.text_field_color, color: AppColors.text_field_color,
borderRadius: BorderRadius.circular(14), borderRadius: BorderRadius.circular(14),
),
child: Padding(
padding: const EdgeInsets.fromLTRB(
10.0,
0.0,
10,
0,
), ),
child: Padding( child: TextFormField(
padding: const EdgeInsets.fromLTRB( controller:
10.0, provider.nextAppointmentDateController,
0.0, keyboardType: TextInputType.text,
10, enabled: false,
0, maxLines: 1,
), readOnly: true,
child: TextFormField( onChanged: (value) {},
controller: decoration: InputDecoration(
provider.nextAppointmentDateController, hintText: "Enter Date",
keyboardType: TextInputType.text, hintStyle: TextStyle(
enabled: false, fontWeight: FontWeight.w400,
maxLines: 1, color: Color(0xFFB4BEC0),
readOnly: true, fontSize: 14,
onChanged: (value) {},
decoration: InputDecoration(
hintText: "Enter Date",
hintStyle: TextStyle(
fontWeight: FontWeight.w400,
color: Color(0xFFB4BEC0),
fontSize: 14,
),
enabledBorder: InputBorder.none,
disabledBorder: InputBorder.none,
focusedBorder: InputBorder.none,
), ),
enabledBorder: InputBorder.none,
disabledBorder: InputBorder.none,
focusedBorder: InputBorder.none,
), ),
), ),
), ),
), ),
if(provider.nextAppDateError!=null)...[ ),
errorWidget(context, provider.nextAppDateError) if (provider.nextAppDateError != null) ...[
], errorWidget(context, provider.nextAppDateError),
TextWidget(context, "Appointment Type"), ],
DropdownButtonHideUnderline( TextWidget(context, "Appointment Type"),
child: Row( DropdownButtonHideUnderline(
children: [ child: Row(
Expanded( children: [
child: DropdownButton2<String>( Expanded(
isExpanded: true, child: DropdownButton2<String>(
hint: const Row( isExpanded: true,
children: [ hint: const Row(
Expanded( children: [
child: Text( Expanded(
'Select Appointment Type', child: Text(
style: TextStyle(fontSize: 14), 'Select Appointment Type',
overflow: TextOverflow.ellipsis, style: TextStyle(fontSize: 14),
), overflow: TextOverflow.ellipsis,
), ),
], ),
), ],
items: ),
<String>['Phone', 'Visit'] items:
.map( <String>['Phone', 'Visit']
(value) => .map(
DropdownMenuItem<String>( (value) => DropdownMenuItem<String>(
value: value, value: value,
child: Text( child: Text(
value ?? '', value ?? '',
style: const TextStyle( style: const TextStyle(
fontSize: 14, fontSize: 14,
),
overflow: TextOverflow.ellipsis,
), ),
overflow: TextOverflow.ellipsis,
), ),
), )
) .toList(),
.toList(), value: provider.selectNextAppointmentType,
value: provider.selectNextAppointmentType, onChanged: (String? newValue) {
onChanged: (String? newValue) { setState(() {
setState(() { provider.selectNextAppointmentType =
provider.selectNextAppointmentType = newValue!;
newValue!; });
}); },
}, buttonStyleData: ddtheme.buttonStyleData,
buttonStyleData: ddtheme.buttonStyleData, iconStyleData: ddtheme.iconStyleData,
iconStyleData: ddtheme.iconStyleData, menuItemStyleData: ddtheme.menuItemStyleData,
menuItemStyleData: ddtheme dropdownStyleData: ddtheme.dropdownStyleData,
.menuItemStyleData,
dropdownStyleData: ddtheme
.dropdownStyleData,
),
), ),
], ),
), ],
), ),
if(provider.nextAppType!=null)...[ ),
errorWidget(context, provider.nextAppType) if (provider.nextAppType != null) ...[
], errorWidget(context, provider.nextAppType),
],
if (provider.selectNextAppointmentType == if (provider.selectNextAppointmentType == "Visit") ...[
"Visit") ...[ CheckboxListTile(
CheckboxListTile( activeColor: AppColors.app_blue,
activeColor: AppColors.app_blue, checkboxShape: CircleBorder(),
checkboxShape: CircleBorder(), controlAffinity: ListTileControlAffinity.leading,
controlAffinity: ListTileControlAffinity.leading, value: provider.checked,
value: provider.checked, contentPadding: EdgeInsets.symmetric(horizontal: 0),
contentPadding: EdgeInsets.symmetric( title: Text(
horizontal: 0), "Send SMS reminder to Customer",
title: Text( style: TextStyle(
"Send SMS reminder to Customer", fontSize: 14,
style: TextStyle( fontFamily: "JakartaRegular",
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(
false, provider.smsSent + provider.checked.toString(),
null, );
},
), ),
if(provider.noteError!=null)...[
errorWidget(context, provider.noteError)
],
], ],
), textControllerWidget(
context,
provider.noteController,
"Note",
"Write Note",
provider.onNoteChanged,
TextInputType.text,
false,
null,
),
if (provider.noteError != null) ...[
errorWidget(context, provider.noteError),
],
],
), ),
SizedBox(height: 25), ),
], SizedBox(height: 25),
],
SizedBox(height: 150), SizedBox(height: 150),
], ],
), ),
), ),
floatingActionButtonLocation: floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat, FloatingActionButtonLocation.centerFloat,
floatingActionButton: InkResponse( floatingActionButton: InkResponse(
onTap:provider.submitLoading?null: () { onTap:
provider.submitLoading = true; provider.submitLoading
provider.crmAddFollowUpAPIFunction( ? null
context, : () {
widget.from, provider.submitLoading = true;
provider.nextAppointmentStatus, provider.crmAddFollowUpAPIFunction(
provider.selectOrderStatus, context,
widget.leadID, widget.from,
provider.selectedFollowupType, provider.nextAppointmentStatus,
provider.selectedCompetitor, provider.selectOrderStatus,
provider.selectedLeadStatus, widget.leadID,
provider.selectNextAppointmentType, provider.selectedFollowupType,
provider.smsSent, provider.selectedCompetitor,
widget.mode); provider.selectedLeadStatus,
}, provider.selectNextAppointmentType,
provider.smsSent,
widget.mode,
);
},
child: Container( child: Container(
height: 45, height: 45,
alignment: Alignment.center, alignment: Alignment.center,
...@@ -727,16 +722,19 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> { ...@@ -727,16 +722,19 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> {
color: AppColors.app_blue, color: AppColors.app_blue,
borderRadius: BorderRadius.circular(15), borderRadius: BorderRadius.circular(15),
), ),
child:provider.submitLoading?CircularProgressIndicator.adaptive( child:
valueColor: AlwaysStoppedAnimation(AppColors.white), provider.submitLoading
): Text( ? CircularProgressIndicator.adaptive(
"Submit", valueColor: AlwaysStoppedAnimation(AppColors.white),
style: TextStyle( )
fontSize: 15, : Text(
fontFamily: "JakartaMedium", "Submit",
color: Colors.white, style: TextStyle(
), fontSize: 15,
), fontFamily: "JakartaMedium",
color: Colors.white,
),
),
), ),
), ),
); );
......
...@@ -61,11 +61,11 @@ class _GeneratequotationaddeditproductState ...@@ -61,11 +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 if (widget.type == "edit"){ } else if (widget.type == "edit") {
print(widget.index); print(widget.index);
print(widget.product); print(widget.product);
provider.preFillFormForEdit(widget.product,widget.index); provider.preFillFormForEdit(widget.product, widget.index);
} }
}); });
} }
...@@ -147,9 +147,7 @@ class _GeneratequotationaddeditproductState ...@@ -147,9 +147,7 @@ class _GeneratequotationaddeditproductState
items: items:
provider.productsList provider.productsList
.map( .map(
( (ord) => DropdownMenuItem<Products>(
ord,
) => DropdownMenuItem<Products>(
value: ord, value: ord,
child: Text( child: Text(
"${ord.name}", "${ord.name}",
...@@ -161,6 +159,7 @@ class _GeneratequotationaddeditproductState ...@@ -161,6 +159,7 @@ class _GeneratequotationaddeditproductState
), ),
) )
.toList(), .toList(),
// provider.selectedOrderIds[index] != null? // provider.selectedOrderIds[index] != null?
// provider // provider
// .orderList // .orderList
...@@ -171,25 +170,27 @@ class _GeneratequotationaddeditproductState ...@@ -171,25 +170,27 @@ class _GeneratequotationaddeditproductState
// provider // provider
// .selectedOrderIds[index], // .selectedOrderIds[index],
// ) // )
value: value:
provider.selectedProducts != null provider.selectedProducts != null
? provider.productsList.firstWhere( ? provider.productsList.firstWhere(
(element) => (element) =>
element.id == element.id ==
provider provider.selectedAddEditProductId,
.selectedAddEditProductId,
) )
: null, : null,
onChanged: (Products? value) { onChanged: (Products? value) {
if (value != null) { if (value != null) {
provider.selectedProducts = value; provider.selectedProducts = value;
provider.selectedAddEditProductId = provider.selectedAddEditProductId =
value!.id!; value.id!;
provider.selectedAddEditProductName = provider.selectedAddEditProductName =
value.name; value.name;
print(value.id.toString()); print(value.id.toString());
provider.crmSelectedProductDetailsApiFunction(context, value.id.toString()); provider
.crmSelectedProductDetailsApiFunction(
context,
value.id.toString(),
);
} }
}, },
buttonStyleData: ddtheme.buttonStyleData, buttonStyleData: ddtheme.buttonStyleData,
...@@ -261,10 +262,9 @@ class _GeneratequotationaddeditproductState ...@@ -261,10 +262,9 @@ class _GeneratequotationaddeditproductState
floatingActionButton: InkWell( floatingActionButton: InkWell(
onTap: () { onTap: () {
if (provider.selectedProducts != null) { if (provider.selectedProducts != null) {
var newProduct; LeadProducts newProduct;
if (widget.type == "add") { if (widget.type == "add") {
newProduct = LeadProducts( newProduct = LeadProducts(
productId: provider.selectedAddEditProductId, productId: provider.selectedAddEditProductId,
productName: provider.selectedAddEditProductName, productName: provider.selectedAddEditProductName,
price: provider.addEditProductPriceController.text, price: provider.addEditProductPriceController.text,
...@@ -280,7 +280,7 @@ class _GeneratequotationaddeditproductState ...@@ -280,7 +280,7 @@ class _GeneratequotationaddeditproductState
"net_price": provider.addEditTotalAmountController.text, "net_price": provider.addEditTotalAmountController.text,
}); });
Navigator.pop(context, newProduct); Navigator.pop(context, newProduct);
} else if (widget.type == "edit"){ } else if (widget.type == "edit") {
final updatedProduct = LeadProducts( final updatedProduct = LeadProducts(
productId: provider.selectedAddEditProductId, productId: provider.selectedAddEditProductId,
productName: provider.selectedAddEditProductName, productName: provider.selectedAddEditProductName,
......
...@@ -176,7 +176,7 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> { ...@@ -176,7 +176,7 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> {
), ),
); );
if (res != null) { if (res != null) {
print("result ${res}"); print("result $res");
// provider // provider
// .crmLeadDetailsGenerateQuoteViewAPIFunction( // .crmLeadDetailsGenerateQuoteViewAPIFunction(
...@@ -245,7 +245,7 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> { ...@@ -245,7 +245,7 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> {
), ),
); );
if (res != null) { if (res != null) {
print("result ${res}"); print("result $res");
} }
}, },
child: Container( child: Container(
......
...@@ -14,7 +14,6 @@ import 'package:provider/provider.dart'; ...@@ -14,7 +14,6 @@ import 'package:provider/provider.dart';
import 'LeadDetailsByMode.dart'; import 'LeadDetailsByMode.dart';
class Generatedquoteslist extends StatefulWidget { class Generatedquoteslist extends StatefulWidget {
const Generatedquoteslist({super.key}); const Generatedquoteslist({super.key});
@override @override
...@@ -46,9 +45,8 @@ class _GeneratedquoteslistState extends State<Generatedquoteslist> { ...@@ -46,9 +45,8 @@ class _GeneratedquoteslistState extends State<Generatedquoteslist> {
_connectivity.disposeStream(); _connectivity.disposeStream();
} }
getDecorationColor(value) {
getDecorationColor(value){ switch (value) {
switch (value){
case "Hot": case "Hot":
return AppColors.processed_bg_color; return AppColors.processed_bg_color;
case "Warm": case "Warm":
...@@ -60,8 +58,8 @@ class _GeneratedquoteslistState extends State<Generatedquoteslist> { ...@@ -60,8 +58,8 @@ class _GeneratedquoteslistState extends State<Generatedquoteslist> {
} }
} }
getTextColor(value){ getTextColor(value) {
switch (value){ switch (value) {
case "Hot": case "Hot":
return AppColors.processed_text_color; return AppColors.processed_text_color;
case "Warm": case "Warm":
...@@ -73,7 +71,6 @@ class _GeneratedquoteslistState extends State<Generatedquoteslist> { ...@@ -73,7 +71,6 @@ class _GeneratedquoteslistState extends State<Generatedquoteslist> {
} }
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
switch (_source.keys.toList()[0]) { switch (_source.keys.toList()[0]) {
...@@ -89,15 +86,15 @@ class _GeneratedquoteslistState extends State<Generatedquoteslist> { ...@@ -89,15 +86,15 @@ class _GeneratedquoteslistState extends State<Generatedquoteslist> {
} }
return (connection == "Online") return (connection == "Online")
? Platform.isAndroid ? Platform.isAndroid
? WillPopScope( ? WillPopScope(
onWillPop: () => onBackPressed(context), onWillPop: () => onBackPressed(context),
child: SafeArea( child: SafeArea(
top: false, top: false,
bottom: true, bottom: true,
child: _scaffold(context), child: _scaffold(context),
), ),
) )
: _scaffold(context) : _scaffold(context)
: NoNetwork(context); : NoNetwork(context);
} }
...@@ -141,103 +138,113 @@ class _GeneratedquoteslistState extends State<Generatedquoteslist> { ...@@ -141,103 +138,113 @@ class _GeneratedquoteslistState extends State<Generatedquoteslist> {
), ),
), ),
body: body:
(quotess.isNotEmpty) (quotess.isNotEmpty)
? SingleChildScrollView( ? SingleChildScrollView(
physics: AlwaysScrollableScrollPhysics(), physics: AlwaysScrollableScrollPhysics(),
child: Column( child: Column(
children: [ children: [
Container( SizedBox(
width: double.infinity, width: double.infinity,
child: ListView.builder( child: ListView.builder(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
shrinkWrap: true, shrinkWrap: true,
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
vertical: 5, vertical: 5,
horizontal: 10, horizontal: 10,
),
itemCount: quotess.length,
itemBuilder: (context, index) {
return InkResponse(
onTap: () async {
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => LeadDetailsByMode(
pageTitleName: "Lead Details",
mode: "",
leadId: quotess[index].leadid,
),
), ),
); itemCount: quotess.length,
}, itemBuilder: (context, index) {
child: Container( return InkResponse(
decoration: BoxDecoration( onTap: () async {
color: Colors.white, Navigator.push(
borderRadius: BorderRadius.circular(15), context,
), MaterialPageRoute(
margin: EdgeInsets.symmetric(vertical: 3), builder:
padding: EdgeInsets.symmetric( (context) => LeadDetailsByMode(
horizontal: 10, pageTitleName: "Lead Details",
vertical: 10, mode: "",
), leadId: quotess[index].leadid,
child: Row( ),
),
children: [ );
SvgPicture.asset("assets/svg/finance/fin_payments_ic.svg",), },
SizedBox(width: 10,),
Expanded(
flex: 4,
child: Text(
"${quotess[index].aname}",
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
decoration: TextDecoration.underline,
height: 1.5,
decorationStyle: TextDecorationStyle.dotted,
decorationColor: Color(0xFF676767),
color: AppColors.semi_black,
fontFamily: "JakartaRegular",
fontSize: 14,
),
),
),
SizedBox(width: 10,),
Expanded(
flex: 2,
child: Container( child: Container(
padding: EdgeInsets.symmetric(vertical: 5),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8), color: Colors.white,
color: getDecorationColor(quotess[index].lstatus) borderRadius: BorderRadius.circular(15),
), ),
child: Text( margin: EdgeInsets.symmetric(vertical: 3),
"${quotess[index].lstatus}", padding: EdgeInsets.symmetric(
textAlign: TextAlign.center, horizontal: 10,
maxLines: 1, vertical: 10,
style: TextStyle( ),
color: getTextColor(quotess[index].lstatus), child: Row(
fontFamily: "JakartaRegular", children: [
fontSize: 14, SvgPicture.asset(
), "assets/svg/finance/fin_payments_ic.svg",
),
SizedBox(width: 10),
Expanded(
flex: 4,
child: Text(
"${quotess[index].aname}",
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
decoration:
TextDecoration.underline,
height: 1.5,
decorationStyle:
TextDecorationStyle.dotted,
decorationColor: Color(0xFF676767),
color: AppColors.semi_black,
fontFamily: "JakartaRegular",
fontSize: 14,
),
),
),
SizedBox(width: 10),
Expanded(
flex: 2,
child: Container(
padding: EdgeInsets.symmetric(
vertical: 5,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(
8,
),
color: getDecorationColor(
quotess[index].lstatus,
),
),
child: Text(
"${quotess[index].lstatus}",
textAlign: TextAlign.center,
maxLines: 1,
style: TextStyle(
color: getTextColor(
quotess[index].lstatus,
),
fontFamily: "JakartaRegular",
fontSize: 14,
),
),
),
),
],
), ),
), ),
), );
], },
), ),
), ),
);
},
),
),
SizedBox(height: 150), SizedBox(height: 150),
], ],
), ),
) )
: Emptywidget(context), : Emptywidget(context),
); );
}, },
); );
......
...@@ -176,21 +176,26 @@ class _PendingtasksdetailsState extends State<Pendingtasksdetails> { ...@@ -176,21 +176,26 @@ class _PendingtasksdetailsState extends State<Pendingtasksdetails> {
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
"${subHeadings[j]}", subHeadings[j],
style: TextStyle( style: TextStyle(
decoration:j == 0 decoration:
? TextDecoration.underline:TextDecoration.none, j == 0
height: j == 0 ? TextDecoration
? 1:1.5, .underline
decorationStyle: TextDecorationStyle.dotted, : TextDecoration.none,
decorationColor: Color(0xFF676767), height: j == 0 ? 1 : 1.5,
decorationStyle:
TextDecorationStyle
.dotted,
decorationColor: Color(
0xFF676767,
),
fontFamily: "JakartaRegular", fontFamily: "JakartaRegular",
fontSize: 14, fontSize: 14,
color: color:
j == 0 j == 0
? AppColors.semi_black ? AppColors.semi_black
: AppColors.grey_semi, : AppColors.grey_semi,
), ),
), ),
), ),
...@@ -233,7 +238,7 @@ class _PendingtasksdetailsState extends State<Pendingtasksdetails> { ...@@ -233,7 +238,7 @@ class _PendingtasksdetailsState extends State<Pendingtasksdetails> {
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
"${belowHeads[i]}", belowHeads[i],
style: TextStyle( style: TextStyle(
color: AppColors.semi_black, color: AppColors.semi_black,
fontSize: 14, fontSize: 14,
...@@ -242,24 +247,39 @@ class _PendingtasksdetailsState extends State<Pendingtasksdetails> { ...@@ -242,24 +247,39 @@ class _PendingtasksdetailsState extends State<Pendingtasksdetails> {
), ),
Expanded( Expanded(
child: InkResponse( child: InkResponse(
onTap:belowHeads[i]=="Mobile Number"?(){ onTap:
HapticFeedback.selectionClick(); belowHeads[i] ==
launch( "Mobile Number"
'tel://${belowSubHeads[i]}', ? () {
); HapticFeedback.selectionClick();
launch(
}:null, 'tel://${belowSubHeads[i]}',
);
}
: null,
child: Padding( child: Padding(
padding: const EdgeInsets.all(4.0), padding: const EdgeInsets.all(
4.0,
),
child: Text( child: Text(
"${belowSubHeads[i]}", belowSubHeads[i],
style: TextStyle( style: TextStyle(
decoration:belowHeads[i]=="Mobile Number" decoration:
? TextDecoration.underline:TextDecoration.none, belowHeads[i] ==
"Mobile Number"
? TextDecoration
.underline
: TextDecoration
.none,
decorationStyle: TextDecorationStyle.dotted, decorationStyle:
decorationColor: Color(0xFF676767), TextDecorationStyle
color: AppColors.grey_semi, .dotted,
decorationColor: Color(
0xFF676767,
),
color:
AppColors.grey_semi,
fontSize: 14, fontSize: 14,
), ),
), ),
...@@ -289,10 +309,13 @@ class _PendingtasksdetailsState extends State<Pendingtasksdetails> { ...@@ -289,10 +309,13 @@ class _PendingtasksdetailsState extends State<Pendingtasksdetails> {
HapticFeedback.selectionClick(); HapticFeedback.selectionClick();
await Navigator.push( await Navigator.push(
context, context,
MaterialPageRoute(builder: (context) => Followupupdatescreen( MaterialPageRoute(
leadID: task.leadid, builder:
from:"Pending Tasks" (context) => Followupupdatescreen(
)), leadID: task.leadid,
from: "Pending Tasks",
),
),
); );
}, },
child: Container( child: Container(
......
...@@ -122,7 +122,7 @@ class _PendingTasksListState extends State<PendingTasksList> { ...@@ -122,7 +122,7 @@ class _PendingTasksListState extends State<PendingTasksList> {
physics: AlwaysScrollableScrollPhysics(), physics: AlwaysScrollableScrollPhysics(),
child: Column( child: Column(
children: [ children: [
Container( SizedBox(
width: double.infinity, width: double.infinity,
child: ListView.builder( child: ListView.builder(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
...@@ -149,7 +149,9 @@ class _PendingTasksListState extends State<PendingTasksList> { ...@@ -149,7 +149,9 @@ class _PendingTasksListState extends State<PendingTasksList> {
(context) => Pendingtasksdetails( (context) => Pendingtasksdetails(
detailIndex: index, detailIndex: index,
), ),
settings: RouteSettings(name: 'Pendingtasksdetails') settings: RouteSettings(
name: 'Pendingtasksdetails',
),
), ),
); );
}, },
...@@ -176,20 +178,29 @@ class _PendingTasksListState extends State<PendingTasksList> { ...@@ -176,20 +178,29 @@ class _PendingTasksListState extends State<PendingTasksList> {
children: [ children: [
Row( Row(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
"${provider.pendingTasksLists[index].aname}", "${provider.pendingTasksLists[index].aname}",
maxLines: 1, maxLines: 1,
overflow: TextOverflow.visible, overflow:
TextOverflow.visible,
style: TextStyle( style: TextStyle(
decoration: TextDecoration.underline, decoration:
TextDecoration
.underline,
height: 1, height: 1,
decorationStyle: TextDecorationStyle.dotted, decorationStyle:
decorationColor: Color(0xFF676767), TextDecorationStyle
color: AppColors.semi_black, .dotted,
fontFamily: "JakartaRegular", decorationColor: Color(
0xFF676767,
),
color:
AppColors.semi_black,
fontFamily:
"JakartaRegular",
fontSize: 14, fontSize: 14,
), ),
), ),
...@@ -200,36 +211,47 @@ class _PendingTasksListState extends State<PendingTasksList> { ...@@ -200,36 +211,47 @@ class _PendingTasksListState extends State<PendingTasksList> {
textAlign: TextAlign.right, textAlign: TextAlign.right,
maxLines: 1, maxLines: 1,
style: TextStyle( style: TextStyle(
color: AppColors.grey_semi, color:
fontFamily: "JakartaRegular", AppColors.grey_semi,
fontFamily:
"JakartaRegular",
fontSize: 14, fontSize: 14,
), ),
), ),
), ),
], ],
), ),
SizedBox(height: 10,), SizedBox(height: 10),
Container( Container(
padding: EdgeInsets.symmetric(vertical: 10,horizontal: 10), padding: EdgeInsets.symmetric(
vertical: 10,
horizontal: 10,
),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16), borderRadius:
gradient: LinearGradient(colors: [ BorderRadius.circular(16),
gradient: LinearGradient(
colors: [
Color(0xFFFFFFFF), Color(0xFFFFFFFF),
Color(0xFFE8F7FF) Color(0xFFE8F7FF),
]) ],
),
), ),
child: Row( child: Row(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
"Remarks", "Remarks",
maxLines: 1, maxLines: 1,
overflow: TextOverflow.ellipsis, overflow:
TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
color: AppColors.app_blue, color:
fontFamily: "JakartaRegular", AppColors.app_blue,
fontFamily:
"JakartaRegular",
fontSize: 14, fontSize: 14,
), ),
), ),
...@@ -237,12 +259,17 @@ class _PendingTasksListState extends State<PendingTasksList> { ...@@ -237,12 +259,17 @@ class _PendingTasksListState extends State<PendingTasksList> {
Expanded( Expanded(
child: Text( child: Text(
"${provider.pendingTasksLists[index].anote}", "${provider.pendingTasksLists[index].anote}",
textAlign: TextAlign.right, textAlign:
TextAlign.right,
maxLines: 2, maxLines: 2,
overflow: TextOverflow.ellipsis, overflow:
TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
color: AppColors.semi_black, color:
fontFamily: "JakartaRegular", AppColors
.semi_black,
fontFamily:
"JakartaRegular",
fontSize: 14, fontSize: 14,
), ),
), ),
......
...@@ -2,7 +2,6 @@ import 'dart:io'; ...@@ -2,7 +2,6 @@ import 'dart:io';
import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:generp/Utils/commonServices.dart'; import 'package:generp/Utils/commonServices.dart';
import 'package:generp/screens/crm/editProductsList.dart'; import 'package:generp/screens/crm/editProductsList.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
......
...@@ -52,15 +52,9 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> { ...@@ -52,15 +52,9 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> {
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),
padding: const EdgeInsets.fromLTRB( padding: const EdgeInsets.fromLTRB(10.0, 0.0, 10, 10),
10.0,
0.0,
10,
10,
),
height: 55, height: 55,
decoration: BoxDecoration( decoration: BoxDecoration(
color: AppColors.white, color: AppColors.white,
...@@ -79,8 +73,11 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> { ...@@ -79,8 +73,11 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> {
Navigator.pop(context, true); Navigator.pop(context, true);
}, },
child: Container( child: Container(
child: SvgPicture.asset(
child: SvgPicture.asset("assets/svg/appbar_back_button.svg", height: 25)), "assets/svg/appbar_back_button.svg",
height: 25,
),
),
), ),
), ),
Expanded( Expanded(
...@@ -128,22 +125,28 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> { ...@@ -128,22 +125,28 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> {
), ),
suffixIcon: Container( suffixIcon: Container(
padding: EdgeInsets.only(right: 10), padding: EdgeInsets.only(right: 10),
child:provider.searchController.text.isNotEmpty? child:
InkResponse( provider
onTap: () { .searchController
HapticFeedback.selectionClick(); .text
provider.searchController.clear(); .isNotEmpty
provider.crmUniversalSearchFunction( ? InkResponse(
context, onTap: () {
); HapticFeedback.selectionClick();
}, provider.searchController
child: SvgPicture.asset( .clear();
"assets/svg/crm/clear_search.svg", provider
), .crmUniversalSearchFunction(
): context,
SvgPicture.asset( );
"assets/svg/search_ic.svg", },
), child: SvgPicture.asset(
"assets/svg/crm/clear_search.svg",
),
)
: SvgPicture.asset(
"assets/svg/search_ic.svg",
),
), ),
counterText: "", counterText: "",
hintText: "Search By Name/Mobile", hintText: "Search By Name/Mobile",
...@@ -186,7 +189,7 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> { ...@@ -186,7 +189,7 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> {
), ),
), ),
], ],
if (provider.accountsList.length > 0) ...[ if (provider.accountsList.isNotEmpty) ...[
Align( Align(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
child: Padding( child: Padding(
...@@ -209,11 +212,13 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> { ...@@ -209,11 +212,13 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> {
), ),
itemCount: provider.accountsList.length, itemCount: provider.accountsList.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
String accname = provider.accountsList[index].aname ?? ""; String accname =
RegExp regex = provider.accountsList[index].aname ?? "";
RegExp(provider.searchController.text, caseSensitive: false); RegExp regex = RegExp(
Iterable<Match> matches = provider.searchController.text,
regex.allMatches(accname); caseSensitive: false,
);
Iterable<Match> matches = regex.allMatches(accname);
List<TextSpan> textSpans = []; List<TextSpan> textSpans = [];
int previousMatchEnd = 0; int previousMatchEnd = 0;
...@@ -224,7 +229,9 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> { ...@@ -224,7 +229,9 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> {
textSpans.add( textSpans.add(
TextSpan( TextSpan(
text: accname.substring( text: accname.substring(
previousMatchEnd, match.start), previousMatchEnd,
match.start,
),
style: TextStyle( style: TextStyle(
color: AppColors.semi_black, color: AppColors.semi_black,
fontSize: 12, fontSize: 12,
...@@ -237,8 +244,7 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> { ...@@ -237,8 +244,7 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> {
// Add the matching text with highlighting // Add the matching text with highlighting
textSpans.add( textSpans.add(
TextSpan( TextSpan(
text: accname.substring( text: accname.substring(match.start, match.end),
match.start, match.end),
style: TextStyle( style: TextStyle(
color: AppColors.app_blue, color: AppColors.app_blue,
fontSize: 12, // Highlight color fontSize: 12, // Highlight color
...@@ -304,14 +310,16 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> { ...@@ -304,14 +310,16 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> {
leading: SvgPicture.asset( leading: SvgPicture.asset(
"assets/svg/crm/crm_search_list_ic.svg", "assets/svg/crm/crm_search_list_ic.svg",
), ),
title:RichText(text: TextSpan( title: RichText(
children: textSpans, text: TextSpan(
style: TextStyle( children: textSpans,
color: AppColors.semi_black, style: TextStyle(
fontSize: 12, // Highlight color color: AppColors.semi_black,
fontFamily: "JakartaMedium", fontSize: 12, // Highlight color
fontFamily: "JakartaMedium",
),
), ),
)), ),
// trailing: SvgPicture.asset( // trailing: SvgPicture.asset(
// "assets/svg/arrow_right_new.svg", // "assets/svg/arrow_right_new.svg",
// ), // ),
...@@ -322,7 +330,7 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> { ...@@ -322,7 +330,7 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> {
), ),
], ],
if (provider.leadsList.length > 0) ...[ if (provider.leadsList.isNotEmpty) ...[
Align( Align(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
child: Padding( child: Padding(
...@@ -345,11 +353,13 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> { ...@@ -345,11 +353,13 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> {
), ),
itemCount: provider.leadsList.length, itemCount: provider.leadsList.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
String accname = provider.leadsList[index].aname ?? ""; String accname =
RegExp regex = provider.leadsList[index].aname ?? "";
RegExp(provider.searchController.text, caseSensitive: false); RegExp regex = RegExp(
Iterable<Match> matches = provider.searchController.text,
regex.allMatches(accname); caseSensitive: false,
);
Iterable<Match> matches = regex.allMatches(accname);
List<TextSpan> textSpans = []; List<TextSpan> textSpans = [];
int previousMatchEnd = 0; int previousMatchEnd = 0;
...@@ -360,7 +370,9 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> { ...@@ -360,7 +370,9 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> {
textSpans.add( textSpans.add(
TextSpan( TextSpan(
text: accname.substring( text: accname.substring(
previousMatchEnd, match.start), previousMatchEnd,
match.start,
),
style: TextStyle( style: TextStyle(
color: AppColors.semi_black, color: AppColors.semi_black,
fontSize: 12, fontSize: 12,
...@@ -373,8 +385,7 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> { ...@@ -373,8 +385,7 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> {
// Add the matching text with highlighting // Add the matching text with highlighting
textSpans.add( textSpans.add(
TextSpan( TextSpan(
text: accname.substring( text: accname.substring(match.start, match.end),
match.start, match.end),
style: TextStyle( style: TextStyle(
color: AppColors.app_blue, color: AppColors.app_blue,
fontSize: 12, // Highlight color fontSize: 12, // Highlight color
...@@ -439,14 +450,16 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> { ...@@ -439,14 +450,16 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> {
leading: SvgPicture.asset( leading: SvgPicture.asset(
"assets/svg/crm/crm_search_list_ic.svg", "assets/svg/crm/crm_search_list_ic.svg",
), ),
title: RichText(text: TextSpan( title: RichText(
children: textSpans, text: TextSpan(
style: TextStyle( children: textSpans,
color: AppColors.semi_black, style: TextStyle(
fontSize: 12, // Highlight color color: AppColors.semi_black,
fontFamily: "JakartaMedium", fontSize: 12, // Highlight color
fontFamily: "JakartaMedium",
),
), ),
)), ),
// trailing: SvgPicture.asset( // trailing: SvgPicture.asset(
// "assets/svg/arrow_right_new.svg", // "assets/svg/arrow_right_new.svg",
// ), // ),
...@@ -456,7 +469,7 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> { ...@@ -456,7 +469,7 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> {
}, },
), ),
], ],
if (provider.enquiresList.length > 0) ...[ if (provider.enquiresList.isNotEmpty) ...[
Align( Align(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
child: Padding( child: Padding(
...@@ -480,17 +493,21 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> { ...@@ -480,17 +493,21 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> {
itemCount: provider.enquiresList.length, itemCount: provider.enquiresList.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
String accname = ""; String accname = "";
if(provider.enquiresList[index].companyName!.isEmpty){ if (provider
.enquiresList[index]
.companyName!
.isEmpty) {
accname = provider.enquiresList[index].name ?? ""; accname = provider.enquiresList[index].name ?? "";
}else{ } else {
accname = provider.enquiresList[index].companyName ?? ""; accname =
provider.enquiresList[index].companyName ?? "";
} }
RegExp regex = RegExp(
RegExp regex = provider.searchController.text,
RegExp(provider.searchController.text, caseSensitive: false); caseSensitive: false,
Iterable<Match> matches = );
regex.allMatches(accname); Iterable<Match> matches = regex.allMatches(accname);
List<TextSpan> textSpans = []; List<TextSpan> textSpans = [];
int previousMatchEnd = 0; int previousMatchEnd = 0;
...@@ -501,7 +518,9 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> { ...@@ -501,7 +518,9 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> {
textSpans.add( textSpans.add(
TextSpan( TextSpan(
text: accname.substring( text: accname.substring(
previousMatchEnd, match.start), previousMatchEnd,
match.start,
),
style: TextStyle( style: TextStyle(
color: AppColors.semi_black, color: AppColors.semi_black,
fontSize: 12, fontSize: 12,
...@@ -514,8 +533,7 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> { ...@@ -514,8 +533,7 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> {
// Add the matching text with highlighting // Add the matching text with highlighting
textSpans.add( textSpans.add(
TextSpan( TextSpan(
text: accname.substring( text: accname.substring(match.start, match.end),
match.start, match.end),
style: TextStyle( style: TextStyle(
color: AppColors.app_blue, color: AppColors.app_blue,
fontSize: 12, // Highlight color fontSize: 12, // Highlight color
...@@ -557,7 +575,7 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> { ...@@ -557,7 +575,7 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> {
), ),
child: ListTile( child: ListTile(
leading: SvgPicture.asset( leading: SvgPicture.asset(
"assets/svg/crm/crm_search_list_ic.svg", "assets/svg/crm/crm_search_list_ic.svg",
), ),
// title: Text( // title: Text(
// provider.enquiresList[index].companyName == "" // provider.enquiresList[index].companyName == ""
...@@ -568,14 +586,16 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> { ...@@ -568,14 +586,16 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> {
// fontSize: 14, // fontSize: 14,
// ), // ),
// ), // ),
title:RichText(text: TextSpan( title: RichText(
children: textSpans, text: TextSpan(
style: TextStyle( children: textSpans,
color: AppColors.semi_black, style: TextStyle(
fontSize: 12, // Highlight color color: AppColors.semi_black,
fontFamily: "JakartaMedium", fontSize: 12, // Highlight color
fontFamily: "JakartaMedium",
),
), ),
)), ),
// trailing: SvgPicture.asset( // trailing: SvgPicture.asset(
// "assets/svg/arrow_right_new.svg", // "assets/svg/arrow_right_new.svg",
// ), // ),
......
...@@ -77,7 +77,7 @@ class _AllpaymentrequesitionlistsbymodesState ...@@ -77,7 +77,7 @@ class _AllpaymentrequesitionlistsbymodesState
_scrollController.addListener(() { _scrollController.addListener(() {
if (_scrollController.position.pixels >= if (_scrollController.position.pixels >=
_scrollController.position.maxScrollExtent - 200 && _scrollController.position.maxScrollExtent - 200 &&
!provider.isLoadingMore && !provider.isLoadingMore &&
provider.hasMoreData) { provider.hasMoreData) {
provider.paymentRequestionListsAPIFunction( provider.paymentRequestionListsAPIFunction(
...@@ -337,316 +337,317 @@ class _AllpaymentrequesitionlistsbymodesState ...@@ -337,316 +337,317 @@ class _AllpaymentrequesitionlistsbymodesState
0xFFFFFFFF, 0xFFFFFFFF,
), ),
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
body: provider.isLoading && requestLists.isEmpty body:
? Center( provider.isLoading && requestLists.isEmpty
child: CircularProgressIndicator.adaptive( ? Center(
valueColor: AlwaysStoppedAnimation<Color>(AppColors.app_blue), child: CircularProgressIndicator.adaptive(
), valueColor: AlwaysStoppedAnimation<Color>(
) AppColors.app_blue,
: requestLists.isNotEmpty
? RefreshIndicator(
onRefresh: () async {
provider.resetPagination();
await provider.paymentRequestionListsAPIFunction(
context,
widget.mode,
"",
"",
);
},
child: Scrollbar(
controller: _scrollController, // attach here
thumbVisibility: false,
child: ListView.builder(
controller: _scrollController,
physics: const AlwaysScrollableScrollPhysics(),
itemCount:
requestLists.length + (provider.hasMoreData ? 1 : 0),
itemBuilder: (context, index) {
// loader row for pagination
if (index == requestLists.length) {
return provider.isLoadingMore
? const Padding(
padding: EdgeInsets.all(16),
child: Center(
child: CircularProgressIndicator(),
), ),
) ),
: const SizedBox.shrink(); )
} : requestLists.isNotEmpty
? RefreshIndicator(
// Your swipe logic untouched onRefresh: () async {
final request = requestLists[index]; provider.resetPagination();
shouldShowSwipeButtons(request.status); await provider.paymentRequestionListsAPIFunction(
return InkResponse(
onTap: () async {
HapticFeedback.selectionClick();
var res = await Navigator.push(
context, context,
MaterialPageRoute( widget.mode,
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,
"",
"",
);
}
}, },
child: Container( child: Scrollbar(
margin: EdgeInsets.symmetric( controller: _scrollController, // attach here
horizontal: 10, thumbVisibility: false,
vertical: 5, child: ListView.builder(
), controller: _scrollController,
decoration: BoxDecoration( physics: const AlwaysScrollableScrollPhysics(),
color: Colors.white, itemCount:
borderRadius: BorderRadius.circular(16), requestLists.length +
), (provider.hasMoreData ? 1 : 0),
child: ClipRRect( itemBuilder: (context, index) {
borderRadius: BorderRadius.circular(20), // loader row for pagination
child: Slidable( if (index == requestLists.length) {
startActionPane: return provider.isLoadingMore
shouldShowButtons ? const Padding(
? ActionPane( padding: EdgeInsets.all(16),
motion: const ScrollMotion(), child: Center(
dragDismissible: false, child: CircularProgressIndicator(),
// dismissible: DismissiblePane(onDismissed: () {}),
children: [
if (shouldShowButtons &&
![
"admin",
"self",
].contains(widget.mode)) ...[
SlidableAction(
onPressed: (context) {
_showLevelRejectionSheet(
context,
requestLists[index].id,
);
},
backgroundColor: Color(
0xFFFFE5E5,
),
foregroundColor: Color(
0xFFEF3739,
), ),
icon: Icons.clear, )
label: 'Reject', : const SizedBox.shrink();
), }
],
if (widget.mode == "process") ...[ // Your swipe logic untouched
SlidableAction( final request = requestLists[index];
onPressed: (context) { shouldShowSwipeButtons(request.status);
detailsProvider
.approveRejectPaymentRequestAPIFunction(
context,
requestLists[index]
.id,
);
detailsProvider.preValues();
_showAddPaymentSheet(
context,
requestLists[index].id,
);
},
backgroundColor: Color(
0xFFFFF8E5,
),
foregroundColor: Color(
0xFFFFB600,
),
icon: Icons.add,
label: 'Add Payment',
),
],
],
)
: null,
endActionPane:
shouldShowButtons
? ActionPane(
motion: const ScrollMotion(),
key: ValueKey(
requestLists[index].id,
),
dragDismissible: false,
// dismissible: DismissiblePane( return InkResponse(
// onTap: () async {
// onDismissed: () {}, HapticFeedback.selectionClick();
// closeOnCancel: true, var res = await Navigator.push(
// resizeDuration: Duration(milliseconds: 300),), context,
children: [ MaterialPageRoute(
if ([ builder:
"apr_lvl1", (context) => Paymentrequestionlistdetails(
"apr_lvl2", pageName: widget.pageTitleName,
"self_apr_lvl2", mode: widget.mode,
].contains(widget.mode)) ...[ paymentRequestId:
SlidableAction( requestLists[index].id,
onPressed: (context) { ),
detailsProvider settings: RouteSettings(
.paymentRequesitionDetails( name: "Paymentrequestionlistdetails",
context,
requestLists[index]
.id,
);
detailsProvider.preValues();
detailsProvider
.approveRejectPaymentRequestAPIFunction(
context,
requestLists[index]
.id,
);
_showLevelApprovalSheet(
context,
requestLists[index].id,
);
},
backgroundColor: Color(
0xFFE9FFE8,
),
foregroundColor: Color(
0xFF4CB443,
), ),
icon: Icons.check,
label: 'Approve',
), ),
], );
], if (routeSettingName ==
) "Paymentrequestionlistdetails") {
: null, print("croos refresh");
provider.paymentRequestionListsAPIFunction(
context,
widget.mode,
"",
"",
);
}
},
child: Container(
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: ClipRRect(
borderRadius: BorderRadius.circular(20),
child: Slidable(
startActionPane:
shouldShowButtons
? ActionPane(
motion: const ScrollMotion(),
dragDismissible: false,
child: Container( // dismissible: DismissiblePane(onDismissed: () {}),
padding: EdgeInsets.symmetric( children: [
horizontal: 10, if (shouldShowButtons &&
vertical: 10, ![
), "admin",
child: Column( "self",
children: [ ].contains(widget.mode)) ...[
Row( SlidableAction(
children: [ onPressed: (context) {
Expanded( _showLevelRejectionSheet(
flex: 1, context,
child: Container( requestLists[index].id,
height: 50, );
width: 50, },
padding: EdgeInsets.all(8.0), backgroundColor: Color(
decoration: BoxDecoration( 0xFFFFE5E5,
color: getDecorationColor( ),
requestLists[index].status, foregroundColor: Color(
), 0xFFEF3739,
shape: BoxShape.circle, ),
), icon: Icons.clear,
child: Center( label: 'Reject',
child: Text( ),
getText( ],
requestLists[index]
.status, if (widget.mode == "process") ...[
), SlidableAction(
style: TextStyle( onPressed: (context) {
color: getTextColor( detailsProvider
requestLists[index] .approveRejectPaymentRequestAPIFunction(
.status, context,
), requestLists[index]
fontSize: getSize( .id,
requestLists[index] );
.status, detailsProvider.preValues();
), _showAddPaymentSheet(
fontFamily: "JakartaBold", context,
requestLists[index].id,
);
},
backgroundColor: Color(
0xFFFFF8E5,
),
foregroundColor: Color(
0xFFFFB600,
),
icon: Icons.add,
label: 'Add Payment',
),
],
],
)
: null,
endActionPane:
shouldShowButtons
? ActionPane(
motion: const ScrollMotion(),
key: ValueKey(
requestLists[index].id,
), ),
), dragDismissible: false,
),
), // dismissible: DismissiblePane(
//
// onDismissed: () {},
// closeOnCancel: true,
// resizeDuration: Duration(milliseconds: 300),),
children: [
if ([
"apr_lvl1",
"apr_lvl2",
"self_apr_lvl2",
].contains(widget.mode)) ...[
SlidableAction(
onPressed: (context) {
detailsProvider
.paymentRequesitionDetails(
context,
requestLists[index]
.id,
);
detailsProvider.preValues();
detailsProvider
.approveRejectPaymentRequestAPIFunction(
context,
requestLists[index]
.id,
);
_showLevelApprovalSheet(
context,
requestLists[index].id,
);
},
backgroundColor: Color(
0xFFE9FFE8,
),
foregroundColor: Color(
0xFF4CB443,
),
icon: Icons.check,
label: 'Approve',
),
],
],
)
: null,
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
), ),
SizedBox(width: 10), child: Column(
Expanded( children: [
flex: 4, Row(
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Text( Expanded(
requestLists[index] flex: 1,
.accountName!, child: Container(
maxLines: 1, height: 50,
overflow: width: 50,
TextOverflow.ellipsis, padding: EdgeInsets.all(8.0),
style: TextStyle( decoration: BoxDecoration(
fontFamily: color: getDecorationColor(
"JakartaRegular", requestLists[index].status,
fontSize: 14, ),
color: shape: BoxShape.circle,
AppColors ),
.semi_black, child: Center(
child: Text(
getText(
requestLists[index]
.status,
),
style: TextStyle(
color: getTextColor(
requestLists[index]
.status,
),
fontSize: getSize(
requestLists[index]
.status,
),
fontFamily: "JakartaBold",
),
),
),
),
),
SizedBox(width: 10),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
requestLists[index]
.accountName!,
maxLines: 1,
overflow:
TextOverflow.ellipsis,
style: TextStyle(
fontFamily:
"JakartaRegular",
fontSize: 14,
color:
AppColors
.semi_black,
),
),
Text(
"${requestLists[index].date}",
style: TextStyle(
fontFamily:
"JakartaRegular",
fontSize: 14,
color:
AppColors.app_blue,
),
),
],
),
), ),
), ),
Text( Expanded(
"${requestLists[index].date}", flex: 3,
style: TextStyle( child: Text(
fontFamily: maxLines: 1,
"JakartaRegular", "₹ ${requestLists[index].amount!}",
fontSize: 14, textAlign: TextAlign.right,
color: style: TextStyle(
AppColors.app_blue, fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
), ),
), ),
], ],
), ),
), ],
),
Expanded(
flex: 3,
child: Text(
maxLines: 1,
"₹ ${requestLists[index].amount!}",
textAlign: TextAlign.right,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
), ),
], ),
), ),
], ),
), ),
), );
), },
), ),
), ),
); )
}, : Emptywidget(context),
),
),
)
: Emptywidget(context),
); );
}, },
); );
} }
Future<void> _showLevelApprovalSheet(BuildContext context, paymentID) { Future<void> _showLevelApprovalSheet(BuildContext context, paymentID) {
return showModalBottomSheet( return showModalBottomSheet(
useSafeArea: true, useSafeArea: true,
...@@ -791,8 +792,7 @@ class _AllpaymentrequesitionlistsbymodesState ...@@ -791,8 +792,7 @@ class _AllpaymentrequesitionlistsbymodesState
provider.selectedID = value.id!; provider.selectedID = value.id!;
provider.selectedValue = value.name!; provider.selectedValue = value.name!;
print( print(
"hfjkshfg" + "hfjkshfg${provider.selectedID}",
provider.selectedID.toString(),
); );
} }
} }
...@@ -1079,10 +1079,6 @@ class _AllpaymentrequesitionlistsbymodesState ...@@ -1079,10 +1079,6 @@ class _AllpaymentrequesitionlistsbymodesState
child: Consumer<Requesitionlidtdetailsprovider>( child: Consumer<Requesitionlidtdetailsprovider>(
builder: (context, provider, child) { builder: (context, provider, child) {
// Fallback UI if provider data is not ready // Fallback UI if provider data is not ready
if (provider.paymentsAccounts == null) {
return Center(child: CircularProgressIndicator());
}
return Container( return Container(
// Constrain the height to avoid overflow // Constrain the height to avoid overflow
constraints: BoxConstraints( constraints: BoxConstraints(
...@@ -1623,7 +1619,7 @@ class _AllpaymentrequesitionlistsbymodesState ...@@ -1623,7 +1619,7 @@ class _AllpaymentrequesitionlistsbymodesState
Navigator.of(context).pop(false); Navigator.of(context).pop(false);
provider.imgFromGallery(context); provider.imgFromGallery(context);
}, },
child: Container( child: SizedBox(
height: 35, height: 35,
child: Text("Select photo from gallery"), child: Text("Select photo from gallery"),
), ),
...@@ -1635,7 +1631,7 @@ class _AllpaymentrequesitionlistsbymodesState ...@@ -1635,7 +1631,7 @@ class _AllpaymentrequesitionlistsbymodesState
Navigator.of(context).pop(false); Navigator.of(context).pop(false);
provider.imgFromCamera(context); provider.imgFromCamera(context);
}, },
child: Container( child: SizedBox(
height: 35, height: 35,
child: Text("Capture photo from camera"), child: Text("Capture photo from camera"),
), ),
......
...@@ -79,7 +79,7 @@ class _FileviewerState extends State<Fileviewer> { ...@@ -79,7 +79,7 @@ class _FileviewerState extends State<Fileviewer> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
appBar: appbarNew(context, "File Viewer",0xFFFFFFFF), appBar: appbarNew(context, "File Viewer", 0xFFFFFFFF),
body: SafeArea(child: Center(child: fileWidget(context))), body: SafeArea(child: Center(child: fileWidget(context))),
); );
} }
...@@ -172,7 +172,7 @@ class _FileviewerState extends State<Fileviewer> { ...@@ -172,7 +172,7 @@ class _FileviewerState extends State<Fileviewer> {
}, },
onConsoleMessage: (controller, consoleMessage) { onConsoleMessage: (controller, consoleMessage) {
if (kDebugMode) { if (kDebugMode) {
debugPrint("consoleMessage${consoleMessage}"); debugPrint("consoleMessage$consoleMessage");
} }
debugPrint("JavaScript console message: ${consoleMessage.message}"); debugPrint("JavaScript console message: ${consoleMessage.message}");
}, },
...@@ -185,11 +185,9 @@ class _FileviewerState extends State<Fileviewer> { ...@@ -185,11 +185,9 @@ class _FileviewerState extends State<Fileviewer> {
Future<Uint8List?> _loadPdf(String url) async { Future<Uint8List?> _loadPdf(String url) async {
try { try {
final response = await http.get(Uri.parse(url)); final response = await http.get(Uri.parse(url));
if (response != null) { if (response.statusCode == 200) {
if (response.statusCode == 200) { print(response.bodyBytes);
print(response.bodyBytes); return response.bodyBytes;
return response.bodyBytes;
}
} }
} catch (e) { } catch (e) {
print('Error loading PDF: $e'); print('Error loading PDF: $e');
......
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