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

23-06-2025 By Sai Srinivas

CRM Module - lead list, lead details, generate quotations, add and edit, Nearby Leads.
parent b9d7c024
...@@ -123,6 +123,9 @@ Dropdowntheme ddtheme = Dropdowntheme(); ...@@ -123,6 +123,9 @@ Dropdowntheme ddtheme = Dropdowntheme();
floatingActionButton: Align( floatingActionButton: Align(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
child: InkWell( child: InkWell(
onTap: () {
_showAddAppointmentSheet(context);
},
child: Container( child: Container(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
height: 45, height: 45,
......
...@@ -5,6 +5,7 @@ import 'package:generp/screens/crm/AppointmentDetails.dart'; ...@@ -5,6 +5,7 @@ import 'package:generp/screens/crm/AppointmentDetails.dart';
import 'package:generp/screens/crm/FollowUpDetails.dart'; import 'package:generp/screens/crm/FollowUpDetails.dart';
import 'package:generp/screens/crm/QuotationDetails.dart'; import 'package:generp/screens/crm/QuotationDetails.dart';
import 'package:generp/screens/crm/contactDetails.dart'; import 'package:generp/screens/crm/contactDetails.dart';
import 'package:generp/screens/crm/editAccountDetails.dart';
import 'package:generp/screens/crm/productDetails.dart'; import 'package:generp/screens/crm/productDetails.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
...@@ -19,9 +20,9 @@ class LeadDetailsByMode extends StatefulWidget { ...@@ -19,9 +20,9 @@ class LeadDetailsByMode extends StatefulWidget {
const LeadDetailsByMode({ const LeadDetailsByMode({
super.key, super.key,
this.mode, required this.mode,
this.pageTitleName, required this.pageTitleName,
this.leadId, required this.leadId,
}); });
@override @override
...@@ -57,9 +58,7 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> { ...@@ -57,9 +58,7 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> {
provider.resetAll, provider.resetAll,
InkResponse( InkResponse(
onTap: () { onTap: () {
_showOptionsSheet( _showOptionsSheet(context);
context
);
}, },
child: SvgPicture.asset("assets/svg/ic_more.svg", height: 30), child: SvgPicture.asset("assets/svg/ic_more.svg", height: 30),
), ),
...@@ -112,7 +111,37 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> { ...@@ -112,7 +111,37 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> {
), ),
), ),
), ),
SizedBox(width: 10),
Expanded(
flex: 1,
child: InkResponse(
onTap: () async {
var res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => EditAccountDetails(
leadID: leadDetails.id,
mode: widget.mode,
accountID: leadDetails.accId,
companyName:leadDetails.name,
),
),
);
if(res==true){
provider.crmLeadDetailsAPIFunction(context, widget.leadId, widget.mode);
}
},
child: Container(
height: 32,
width: 30,
padding: EdgeInsets.all(8.0),
child: SvgPicture.asset(
"assets/svg/crm_contact_edit.svg",
),
),
),
),
], ],
), ),
Divider(thickness: 0.5, color: Color(0xFFD7D7D7)), Divider(thickness: 0.5, color: Color(0xFFD7D7D7)),
...@@ -134,30 +163,36 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> { ...@@ -134,30 +163,36 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> {
), ),
Expanded( Expanded(
child: InkResponse( child: InkResponse(
child:provider.Headings[j]=="Lead Age"? Tooltip( child:
triggerMode: TooltipTriggerMode.tap, provider.Headings[j] == "Lead Age"
? Tooltip(
triggerMode: TooltipTriggerMode.tap,
message: "${provider.leadDetails.createdDatetime}", message:
child:Text( "${provider.leadDetails.createdDatetime}",
provider.subHeadings[j] == "" child: Text(
? "-" provider.subHeadings[j] == ""
: provider.subHeadings[j], ? "-"
style: TextStyle( : provider.subHeadings[j],
fontSize: 14, style: TextStyle(
color: Color(0xFF818181), fontSize: 14,
decorationColor: AppColors.grey_semi, color: Color(0xFF818181),
decoration: TextDecoration.underline decorationColor:
), AppColors.grey_semi,
), decoration:
):Text( TextDecoration.underline,
provider.subHeadings[j] == "" ),
? "-" ),
: provider.subHeadings[j], )
style: TextStyle( : Text(
fontSize: 14, provider.subHeadings[j] == ""
color: Color(0xFF818181), ? "-"
), : provider.subHeadings[j],
), style: TextStyle(
fontSize: 14,
color: Color(0xFF818181),
),
),
), ),
), ),
], ],
...@@ -225,23 +260,58 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> { ...@@ -225,23 +260,58 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> {
]; ];
return ListTile( return ListTile(
onTap: () { onTap: () {
switch(index){ switch (index) {
case 0: case 0:
Navigator.push(context, MaterialPageRoute(builder: (context) => Productdetails(),)); Navigator.push(
context,
MaterialPageRoute(
builder: (context) => Productdetails(
leadID: provider.leadDetails.id,
mode: widget.mode,
),
),
);
break; break;
case 1: case 1:
Navigator.push(context, MaterialPageRoute(builder: (context) => Contactdetails( Navigator.push(
accID:provider.leadDetails.accId context,
),)); MaterialPageRoute(
builder:
(context) => Contactdetails(
accID: provider.leadDetails.accId,
),
),
);
break; break;
case 2: case 2:
Navigator.push(context, MaterialPageRoute(builder: (context) => FollowUpDetails(),)); Navigator.push(
context,
MaterialPageRoute(
builder: (context) => FollowUpDetails(),
),
);
break; break;
case 3: case 3:
Navigator.push(context, MaterialPageRoute(builder: (context) => AppointmentDetails(leadID:provider.leadDetails.id ,),)); Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => AppointmentDetails(
leadID: provider.leadDetails.id,
),
),
);
break; break;
case 4: case 4:
Navigator.push(context, MaterialPageRoute(builder: (context) => QuotationDetails(),)); Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => QuotationDetails(
leadID: provider.leadDetails.id,
),
),
);
default: default:
print("object"); print("object");
} }
......
...@@ -228,7 +228,7 @@ class _LeadlistbymodeState extends State<Leadlistbymode> { ...@@ -228,7 +228,7 @@ class _LeadlistbymodeState extends State<Leadlistbymode> {
), ),
Expanded( Expanded(
child: Text( child: Text(
subHeadings[j]!, subHeadings[j]??"-",
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
color: Color(0xFF818181), color: Color(0xFF818181),
...@@ -374,7 +374,11 @@ class _LeadlistbymodeState extends State<Leadlistbymode> { ...@@ -374,7 +374,11 @@ class _LeadlistbymodeState extends State<Leadlistbymode> {
), ),
) )
.toList(), .toList(),
value: provider.selectedEmployees, value:provider.employeesList.contains(provider.selectedEmployees)
? provider.selectedEmployees
: null,
// value: provider.selectedEmployees,
onChanged: (Employees? value) { onChanged: (Employees? value) {
if (value != null) { if (value != null) {
if(provider.employeesList.isNotEmpty){ if(provider.employeesList.isNotEmpty){
......
import 'package:dropdown_button2/dropdown_button2.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:generp/Notifiers/NearByGeneratorsProvider.dart';
import 'package:generp/Utils/app_colors.dart';
import 'package:generp/Utils/commonWidgets.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:interactive_slider/interactive_slider.dart';
import 'package:provider/provider.dart';
import '../../Notifiers/crmProvider/crmNearbyOpenLeadsProvider.dart';
import '../../Utils/dropdownTheme.dart';
class NearbyOpenLeads extends StatefulWidget {
const NearbyOpenLeads({super.key});
@override
State<NearbyOpenLeads> createState() => _NearbyOpenLeadsState();
}
class _NearbyOpenLeadsState extends State<NearbyOpenLeads> {
Dropdowntheme ddtheme = Dropdowntheme();
@override
void initState() {
// TODO: implement initState
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {
final provider = Provider.of<crmNearbyOpenLeadsProvider>(context,listen: false);
provider.getLocationPermission(context);
},);
}
@override
Widget build(BuildContext context) {
debugPrint("Nearbygenerators widget rebuilt");
return Consumer<crmNearbyOpenLeadsProvider>(builder: (context, provider, child) {
var sendWidget = GestureDetector(
onTap: () {
_showFilterBottomSheet(context);
},
child: SvgPicture.asset("assets/svg/filter_ic.svg",height: 25,));
return WillPopScope(
onWillPop: () => onBackPressed(context),
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar2(context, "Nearby Leads (Open)",provider.resetAll,SizedBox(width: 0,)),
backgroundColor: AppColors.scaffold_bg_color,
body: SafeArea(
child: Container(
child: SingleChildScrollView(
child:Column(
children: [
ClipRRect(
// Apply border radius using ClipRRect
borderRadius: BorderRadius.only(
topLeft: Radius.circular(30.0),
topRight: Radius.circular(30.0),
),
// padding: EdgeInsets.fromLTRB(10, 20, 10, 20),
child: Container(
height: MediaQuery.of(context).size.height,
child: Stack(children: [
GoogleMap(
myLocationEnabled: true,
zoomGesturesEnabled: true,
zoomControlsEnabled: true,
gestureRecognizers: {
Factory<OneSequenceGestureRecognizer>(() => EagerGestureRecognizer()),
Factory<PanGestureRecognizer>(() => PanGestureRecognizer()),
Factory<ScaleGestureRecognizer>(() => ScaleGestureRecognizer()), // Prioritize pinch-to-zoom
},
initialCameraPosition: CameraPosition(
target: provider.startLocation,
zoom:14.0
),
markers:provider.markers.toSet(),
mapType: MapType.normal,
onMapCreated: (controller) {
setState(() {
provider.mapController = controller;
});
},
onCameraMove: (position) {
provider.onCameraMove(context,position);
},
),
]),
),
),
],
),
),
),
),
),
);
},);
}
Future<void> _showFilterBottomSheet(BuildContext context) {
return showModalBottomSheet(
useSafeArea: true,
isDismissible: true,
isScrollControlled: true,
showDragHandle: true,
enableDrag: true,
context: context,
builder: (context) {
return StatefulBuilder(
builder: (context, setState) {
return SafeArea(
child: Consumer<Nearbygeneratorsprovider>(
builder: (context,provider,child) {
return Container(
margin: EdgeInsets.only(
bottom: 15,
left: 15,
right: 15,
top: 15,
),
child: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Filter",
style: TextStyle(
color: AppColors.app_blue,
fontFamily: "JakartaSemiBold",
fontSize: 16,
),
),
SizedBox(height: 15),
Align(
alignment: Alignment.centerLeft,
child: Text(
'Status',
style: TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.w500,
),
),
),
DropdownButtonHideUnderline(
child: Row(
children: [
Expanded(
child: DropdownButton2<String>(
isExpanded: true,
hint: const Row(
children: [
Expanded(
child: Text(
'Select Complaint Status',
style: TextStyle(
fontSize: 14,
),
overflow: TextOverflow.ellipsis,
),
),
],
),
items: <String>[
'Active',
'Inactive',
'Suspense',
].map(
(value) =>
DropdownMenuItem<String>(
value: value,
child: Text(
value ?? '',
style: const TextStyle(
fontSize: 14,
),
overflow: TextOverflow.ellipsis,
),
)).toList(),
value: provider.selectedItem,
onChanged: (String? newValue) {
setState(() {
provider.selectedItem = newValue!;
});
},
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
),
),
],
),
),
Row(
children: [
Text(
"Radius",
style: TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.w500,
),
),
Spacer(),
Text(
'${provider.currentValue.toStringAsFixed(2)} KM',
style: TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.w500,
),
),
],
),
InteractiveSlider(
min: 1.0,
max: 100.0,
enabled: true,
// backgroundColor: AppColors.app_blue,
foregroundColor: AppColors.app_blue,
segmentDividerColor:Color(0xFFF6F6F8),
onChanged: (value) {
provider.currentValue = value;
provider.debounce(() {
provider.LoadNearbyGeneratorsAPI(context);
}, Duration(milliseconds: 200));
},
),
// Slider(
// value: provider.currentValue,
// max: 100,
// divisions: 100,
//
// label: provider.currentValue.toStringAsFixed(2),
// inactiveColor: Color(0xFFD7D7D7),
// activeColor: AppColors.cyan_blue,
// onChanged: (value) {
// provider.currentValue = value;
// provider.debounce(() {
// provider.LoadNearbyGeneratorsAPI(context);
// }, Duration(milliseconds: 200));
// },
// ),
SizedBox(height: 30.0),
Container(
child: InkWell(
onTap: () {
provider.debounce(() {
provider.LoadNearbyGeneratorsAPI(context);
Navigator.pop(context);
}, Duration(milliseconds: 500));
},
child: Container(
alignment: Alignment.center,
height: 45,
margin: EdgeInsets.only(
left: 15.0,
right: 15.0,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(14.0),
color: AppColors.app_blue
),
child: Text(
"Search",
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: 'JakartaMedium',
color: Colors.white
),
),
),
),
),
],
),
],
),
),
);
}
),
);
},
);
},
);
}
}
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:generp/screens/crm/generateQuotationScreen.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../Notifiers/crmProvider/crmLeadDetailsProvider.dart'; import '../../Notifiers/crmProvider/crmLeadDetailsProvider.dart';
import '../../Utils/app_colors.dart'; import '../../Utils/app_colors.dart';
import '../../Utils/commonWidgets.dart'; import '../../Utils/commonWidgets.dart';
class QuotationDetails extends StatefulWidget { class QuotationDetails extends StatefulWidget {
const QuotationDetails({super.key}); final leadID;
const QuotationDetails({super.key,required this.leadID});
@override @override
State<QuotationDetails> createState() => _QuotationDetailsState(); State<QuotationDetails> createState() => _QuotationDetailsState();
...@@ -51,14 +52,13 @@ class _QuotationDetailsState extends State<QuotationDetails> { ...@@ -51,14 +52,13 @@ class _QuotationDetailsState extends State<QuotationDetails> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
...List.generate(5, (j) { ...List.generate(5, (j) {
final textheads = [ final textheads = [
"Id", "Id",
"Employee Name", "Employee Name",
"Quotation", "Quotation",
"Info", "Info",
"Date" "Date",
]; ];
final textSubheads = [ final textSubheads = [
quotationDetails[index].id ?? "-", quotationDetails[index].id ?? "-",
...@@ -75,7 +75,7 @@ class _QuotationDetailsState extends State<QuotationDetails> { ...@@ -75,7 +75,7 @@ class _QuotationDetailsState extends State<QuotationDetails> {
), ),
child: Row( child: Row(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
...@@ -90,10 +90,16 @@ class _QuotationDetailsState extends State<QuotationDetails> { ...@@ -90,10 +90,16 @@ class _QuotationDetailsState extends State<QuotationDetails> {
maxLines: 2, maxLines: 2,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
color: textSubheads[j]=="View File"?AppColors.app_blue: color:
Color(0xFF818181), textSubheads[j] == "View File"
decoration:textSubheads[j]=="View File"? TextDecoration.underline:TextDecoration.none, ? AppColors.app_blue
decorationColor: AppColors.app_blue : Color(0xFF818181),
decoration:
textSubheads[j] == "View File"
? TextDecoration.underline
: TextDecoration.none,
decorationColor:
AppColors.app_blue,
), ),
), ),
), ),
...@@ -116,13 +122,20 @@ class _QuotationDetailsState extends State<QuotationDetails> { ...@@ -116,13 +122,20 @@ class _QuotationDetailsState extends State<QuotationDetails> {
floatingActionButton: Align( floatingActionButton: Align(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
child: InkWell( child: InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
Generatequotationscreen(leadId: widget.leadID),
),
);
},
child: Container( child: Container(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
height: 45, height: 45,
width: MediaQuery width: MediaQuery.of(context).size.width,
.of(context)
.size
.width,
margin: EdgeInsets.symmetric(horizontal: 10), margin: EdgeInsets.symmetric(horizontal: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
color: AppColors.app_blue, color: AppColors.app_blue,
...@@ -130,7 +143,7 @@ class _QuotationDetailsState extends State<QuotationDetails> { ...@@ -130,7 +143,7 @@ class _QuotationDetailsState extends State<QuotationDetails> {
), ),
child: Center( child: Center(
child: Text( child: Text(
"Followup Details", "Generate Quotation",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
...@@ -142,7 +155,7 @@ class _QuotationDetailsState extends State<QuotationDetails> { ...@@ -142,7 +155,7 @@ class _QuotationDetailsState extends State<QuotationDetails> {
), ),
), ),
floatingActionButtonLocation: floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat, FloatingActionButtonLocation.centerFloat,
), ),
); );
}, },
......
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:generp/screens/crm/NearbyOpenLeads.dart';
import 'package:generp/screens/crm/ProspectListByMode.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../Notifiers/crmProvider/crmDashboardProvider.dart'; import '../../Notifiers/crmProvider/crmDashboardProvider.dart';
...@@ -47,9 +49,16 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -47,9 +49,16 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
// final icons = ["comm_ic_1", "comm_ic_2"]; // final icons = ["comm_ic_1", "comm_ic_2"];
Widget? SvgIcon; Widget? SvgIcon;
if (gridPages[index].pageName!.contains("Lead List")) { if (gridPages[index].pageName!.contains("Lead List"))
{
SvgIcon = SvgPicture.asset("assets/svg/fin_lv1.svg"); SvgIcon = SvgPicture.asset("assets/svg/fin_lv1.svg");
} else { }
else if (gridPages[index].pageName=="Nearby Leads")
{
SvgIcon = SvgPicture.asset("assets/svg/home_icons_5.svg",height: 18,width: 18,);
}
else
{
SvgIcon = SvgPicture.asset("assets/svg/fin_ic.svg"); SvgIcon = SvgPicture.asset("assets/svg/fin_ic.svg");
} }
return InkResponse( return InkResponse(
...@@ -66,7 +75,20 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -66,7 +75,20 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
), ),
), ),
); );
} else {} } else if (gridPages[index].pageName!.contains("Prospect List")) {
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => ProspectListByMode(
mode: gridPages[index].mode,
pageTitleName: gridPages[index].pageName,
),
),
);
}else if(gridPages[index].pageName=="Nearby Leads"){
Navigator.push(context, MaterialPageRoute(builder: (context) => NearbyOpenLeads(),));
}
// switch (gridPages[index].pageName!) { // switch (gridPages[index].pageName!) {
// case "Lead List": // case "Lead List":
// Navigator.push( // Navigator.push(
......
import 'package:dropdown_button2/dropdown_button2.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../Models/crmModels/GetSegmentOnTeamResponse.dart';
import '../../Models/crmModels/crmLeadDetailsEditAccountViewResponse.dart';
import '../../Notifiers/crmProvider/editCrmAccountDetailsProvider.dart';
import '../../Utils/app_colors.dart';
import '../../Utils/commonWidgets.dart';
import '../../Utils/dropdownTheme.dart';
class EditAccountDetails extends StatefulWidget {
final leadID;
final mode;
final accountID;
final companyName;
const EditAccountDetails({super.key,required this.leadID,required this.mode,required this.accountID,required this.companyName});
@override
State<EditAccountDetails> createState() => _EditAccountDetailsState();
}
class _EditAccountDetailsState extends State<EditAccountDetails> {
Dropdowntheme ddtheme = Dropdowntheme();
@override
void initState() {
// TODO: implement initState
super.initState();
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
final provider = Provider.of<Editcrmaccountdetailsprovider>(
context,
listen: false,
);
provider.editCompanyNameController.text = widget.companyName!;
provider.crmLeadDetailsEditAccountAPIFunction(context, widget.leadID, widget.mode);
});
}
@override
Widget build(BuildContext context) {
return Consumer<Editcrmaccountdetailsprovider>(
builder: (context, provider, child) {
return WillPopScope(
onWillPop: () => onBackPressed(context),
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar(context, "Edit Account"),
backgroundColor: AppColors.scaffold_bg_color,
body: SafeArea(
child: Container(
padding: EdgeInsets.symmetric(horizontal: 10,vertical: 10),
margin: EdgeInsets.symmetric(horizontal: 10,vertical: 5),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12.0),
),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
textControllerWidget(
context,
provider.editCompanyNameController,
"Enter Name",
provider.onChangedCompanyName,
TextInputType.text,
false,
null,
),
errorWidget(context, provider.companyNameError),
TextWidget(context, "Team"),
DropdownButtonHideUnderline(
child: Row(
children: [
Expanded(
child: DropdownButton2<Teams>(
hint: Text(
"Select Team",
style: TextStyle(fontSize: 14),
),
items:
provider.teamsList
.map(
(slist) =>
DropdownMenuItem<Teams>(
value: slist,
child: Text(
slist.name!,
style: TextStyle(
fontSize: 14,
),
),
),
)
.toList(),
value: provider.selectedTeams,
onChanged: (Teams? value) {
if (value != null) {
if(provider.teamsList.isNotEmpty){
provider.selectedTeams = value;
provider.selectedTeamId = value!.id!;
provider.selectedTeamValue = value!.name!;
provider.crmLeadListSegmentOnTeamAPIFunction(context, widget.mode, provider.selectedTeamId);
}
}
},
isExpanded: true,
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
),
),
],
),
),
TextWidget(context, "Segment"),
DropdownButtonHideUnderline(
child: Row(
children: [
Expanded(
child: DropdownButton2<Segments>(
hint: Text(
"Select Segment",
style: TextStyle(fontSize: 14),
),
items:
provider.segmentsList
.map(
(slist) =>
DropdownMenuItem<Segments>(
value: slist,
child: Text(
slist.name!,
style: TextStyle(
fontSize: 14,
),
),
),
)
.toList(),
value: provider.selectedSegments,
onChanged: (Segments? value) {
if (value != null) {
if(provider.segmentsList.isNotEmpty){
provider.selectedSegments = value;
provider.selectedSegmentId = value!.id!;
provider.selectedSegmentValue = value!.name!;
}
}
},
isExpanded: true,
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
),
),
],
),
),
SizedBox(height: 25,),
InkWell(
onTap: provider.isLoading?null:(){
provider.isLoading = true;
provider.crmLeadDetailsEditAccountSubmitAPIFunction(context, widget.accountID, provider.selectedSegmentId, provider.selectedTeamId);
},
child: Container(
alignment: Alignment.center,
height: 45,
margin: EdgeInsets.only(
left: 5.0,
right: 5.0,
top: 5.0,
bottom: 5.0,
),
decoration: BoxDecoration(
color: AppColors.app_blue, //1487C9
borderRadius: BorderRadius.circular(14.0),
),
child: Center(
child: provider.isLoading?CircularProgressIndicator.adaptive(valueColor: AlwaysStoppedAnimation(AppColors.white),):Text(
"Submit",
textAlign: TextAlign.center,
style: TextStyle(color: Colors.white),
),
),
),
),
],
),
),
),
),
),
);
},
);
}
}
// import 'package:dropdown_button2/dropdown_button2.dart';
// import 'package:flutter/material.dart';
// import 'package:flutter/services.dart';
// import 'package:generp/Models/crmModels/crmLeadDetailsEditProductsViewResponse.dart';
// import 'package:generp/Utils/dropdownTheme.dart';
// import 'package:provider/provider.dart';
//
// import '../../Notifiers/crmProvider/editProductListProvider.dart';
// import '../../Utils/app_colors.dart';
// import '../../Utils/commonWidgets.dart';
//
// class EditProductsList extends StatefulWidget {
// final leadID;
//
// const EditProductsList({super.key, required this.leadID});
//
// @override
// State<EditProductsList> createState() => _EditProductsListState();
// }
//
// class _EditProductsListState extends State<EditProductsList> {
// Dropdowntheme ddtheme = Dropdowntheme();
// double totalAmount = 0;
// @override
// void initState() {
// // TODO: implement initState
// super.initState();
// WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
// final provider = Provider.of<Editproductlistprovider>(
// context,
// listen: false,
// );
// provider.crmLeadDetailsEditProductsViewAPIFunction(
// context,
// widget.leadID,
// );
//
// for (int i = 0; i < provider.leadProductsList.length; i++) {
// final widgetProductPrice = provider.leadProductsList[i].price!;
// final widgetQty = provider.leadProductsList[i].qty!;
//
// // totalAmount +=double.parse(provider.leadProductsList[i].price!.toString());
// totalAmount = double.parse(widgetProductPrice.toString())*int.parse(widgetQty.toString());
// print("totalAmount: $totalAmount");
// final matchedOrder = provider.productsList.firstWhere(
// (order) => order.id == provider.leadProductsList[i].id,
// orElse: () {
// return provider.productsList[0];
// },
// );
//
// provider.editAddNewRow(); // Adds controller + dropdown slot
// provider.editProductPriceControllers[i].text = widgetProductPrice;
// provider.editQuantityControllers[i].text = widgetQty;
// provider.editTotalAmountControllers[i].text = totalAmount.toString();
//
// provider.updateSelectedProductIds(i, matchedOrder);
// }
// });
// }
//
// @override
// Widget build(BuildContext context) {
// return Consumer<Editproductlistprovider>(
// builder: (context, editProvider, child) {
// return WillPopScope(
// child: Scaffold(
// resizeToAvoidBottomInset: true,
// backgroundColor: AppColors.scaffold_bg_color,
// appBar: appbar2(
// context,
// "Edit Products",
// editProvider.resetForm,
// SizedBox(width: 0),
// ),
// body: Container(
// padding: EdgeInsets.symmetric(horizontal: 10),
// // decoration: BoxDecoration(
// // color: Colors.white,
// // borderRadius: BorderRadius.circular(20),
// // ),
// child: SingleChildScrollView(
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// if (editProvider.leadProductsList!.isNotEmpty) ...[
// InkResponse(
// onTap: () {
// // if (provider.selectedOrderIds.length < provider.orderList.length) {
// editProvider.editAddNewRow();
// print("clcicekd");
// // } else {
// // ScaffoldMessenger.of(context).showSnackBar(
// // SnackBar(
// // content: Text('No more unique order IDs or statuses available'),
// // ),
// // );
// // }
// },
// child: Container(
// margin: EdgeInsets.symmetric(vertical: 10),
// height: 45,
// width: MediaQuery.of(context).size.width,
// decoration: BoxDecoration(
// color: Color(0xFFE6F6FF),
// borderRadius: BorderRadius.circular(12),
// border: Border.all(
// color: AppColors.app_blue,
// width: 0.5,
// ),
// ),
// child: Center(
// child: Text(
// "+ Add Product",
// style: TextStyle(
// fontFamily: "JakartaMedium",
// color: AppColors.app_blue,
// ),
// ),
// ),
// ),
// ),
//
// if (editProvider.leadProductsList.length > 0) ...[
// if (editProvider.editProductPriceControllers.length > 0)
// Row(
// children: [
// Expanded(
// child: ListView.builder(
// itemCount:
// editProvider.leadProductsList.length,
// physics: NeverScrollableScrollPhysics(),
// shrinkWrap: true,
// itemBuilder: (context, j) {
// return Container(
// padding: EdgeInsets.symmetric(
// horizontal: 10,
// ),
// margin: EdgeInsets.symmetric(
// vertical: 10,
// ),
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.circular(20),
// ),
// child: Column(
// children: [
// Row(
// children: [
// Expanded(
// flex: 3,
// child: SizedBox(
// child: Column(
// crossAxisAlignment:
// CrossAxisAlignment
// .start,
// children: [
// TextWidget(
// context,
// "Order",
// ),
// Row(
// children: [
// Expanded(
// child: DropdownButtonHideUnderline(
// child: DropdownButton2<
// Products
// >(
// isExpanded:
// true,
// hint: Text(
// 'Select Account Type',
// style:
// TextStyle(
// fontSize:
// 14,
// ),
// overflow:
// TextOverflow
// .ellipsis,
// ),
// items:
// editProvider
// .productsList
// .map(
// (
// ord,
// ) => DropdownMenuItem<
// Products
// >(
// value:
// ord,
// child: Text(
// "(Product Name: ${ord.name})" ??
// '',
// style: const TextStyle(
// fontSize:
// 14,
// ),
// overflow:
// TextOverflow.ellipsis,
// ),
// ),
// )
// .toList(),
// value:
// editProvider.selectedProductIds[j] !=
// null &&
// editProvider.productsList.isNotEmpty
// ? editProvider.productsList.firstWhere(
// (
// ord,
// ) =>
// ord.id ==
// editProvider.selectedProductIds[j],
// orElse:
// () =>
// editProvider.productsList[0],
// )
// : null,
// onChanged: (
// Products?
// value,
// ) {
// if (value !=
// null) {
// if (editProvider
// .productsList
// .isNotEmpty) {
// editProvider
// .selectedProducts =
// value;
//
// editProvider.updateSelectedProductIds(
// j,
// editProvider
// .selectedProducts,
// );
// // provider.selectedOrderIds = value!.orderId!;
// // provider.selectedOrderNumbers = value!.orderNumber!;
// // print(
// // "hfjkshfg" +
// // provider.selectedOrderIds.toString(),
// }
// }
// },
// buttonStyleData:
// ddtheme
// .buttonStyleData,
// iconStyleData:
// ddtheme
// .iconStyleData,
// menuItemStyleData:
// ddtheme
// .menuItemStyleData,
// dropdownStyleData:
// ddtheme
// .dropdownStyleData,
// ),
// ),
// ),
// ],
// ),
// ],
// ),
// ),
// ),
// ],
// ),
//
// SizedBox(width: 10),
// Row(
// children: [
// Expanded(
// flex: 2,
// child: textControllerWidget(
// context,
// editProvider
// .editProductPriceControllers[j],
// "Enter Product Price",
// (p0) {},
// TextInputType.number,
// false,
// FilteringTextInputFormatter
// .digitsOnly,
// ),
// ),
// ],
// ),
// SizedBox(height: 10),
// Row(
// children: [
// Expanded(
// flex: 2,
// child: textControllerWidget(
// context,
// editProvider
// .editQuantityControllers[j],
// "Enter Quantity",
// (p0) {},
// TextInputType.number,
// false,
// FilteringTextInputFormatter
// .digitsOnly,
// ),
// ),
// ],
// ),
// SizedBox(height: 10),
// Row(
// children: [
// Expanded(
// flex: 2,
// child: textControllerWidget(
// context,
// editProvider
// .editQuantityControllers[j],
// "Enter Total Amount",
// (p0) {},
// TextInputType.number,
// true,
// FilteringTextInputFormatter
// .digitsOnly,
// ),
// ),
// ],
// ),
// SizedBox(height: 10),
// // SizedBox(width: 10),
// //
// // IconButton(
// // icon: Icon(Icons.delete),
// // onPressed: provider.orderAmountControllers.length > 1
// // ? () => provider.removeRow(index)
// // : null, // Prevent removing the last row
// // ),
// ],
// ),
// );
// },
// ),
// ),
// ],
// ),
// ],
// ],
// ],
// ),
// ),
// ),
// floatingActionButtonLocation:
// FloatingActionButtonLocation.centerFloat,
// bottomNavigationBar: InkResponse(
// onTap:
// editProvider.submitLoading
// ? null
// : () {
// // editProvider.submitLoading = true;
// final insertedData = editProvider.getFormData();
// print(insertedData);
// },
// child: Container(
// height: 45,
// alignment: Alignment.center,
// margin: EdgeInsets.symmetric(horizontal: 10, vertical: 15),
// padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
// decoration: BoxDecoration(
// color: AppColors.app_blue,
// borderRadius: BorderRadius.circular(15),
// ),
// child:
// editProvider.submitLoading
// ? CircularProgressIndicator.adaptive(
// valueColor: AlwaysStoppedAnimation(
// AppColors.app_blue,
// ),
// )
// : Text(
// "Submit",
// style: TextStyle(
// fontSize: 15,
// fontFamily: "JakartaMedium",
// color: Colors.white,
// ),
// ),
// ),
// ),
// ),
// onWillPop: () async {
// editProvider.resetForm();
// return onBackPressed(context);
// },
// );
// },
// );
// }
// }
import 'package:dropdown_button2/dropdown_button2.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:generp/Models/crmModels/crmLeadDetailsEditProductsViewResponse.dart';
import 'package:generp/Utils/dropdownTheme.dart';
import 'package:provider/provider.dart';
import '../../Notifiers/crmProvider/editProductListProvider.dart';
import '../../Utils/app_colors.dart';
import '../../Utils/commonWidgets.dart';
class EditProductsList extends StatefulWidget {
final String leadID;
const EditProductsList({super.key, required this.leadID});
@override
State<EditProductsList> createState() => _EditProductsListState();
}
class _EditProductsListState extends State<EditProductsList> {
Dropdowntheme ddtheme = Dropdowntheme();
@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) async {
final provider = Provider.of<Editproductlistprovider>(context, listen: false);
await provider.crmLeadDetailsEditProductsViewAPIFunction(context, widget.leadID);
// Initialize controllers and dropdowns after API call
provider.initializeForm(context);
});
}
@override
Widget build(BuildContext context) {
return Consumer<Editproductlistprovider>(
builder: (context, editProvider, child) {
return WillPopScope(
onWillPop: () async {
editProvider.resetForm();
return true;
},
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar2(
context,
"Edit Products",
editProvider.resetForm,
const SizedBox(width: 0),
),
body: Container(
padding: const EdgeInsets.symmetric(horizontal: 10),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
InkResponse(
onTap: () {
editProvider.editAddNewRow();
},
child: Container(
margin: const EdgeInsets.symmetric(vertical: 10),
height: 45,
width: MediaQuery.of(context).size.width,
decoration: BoxDecoration(
color: const Color(0xFFE6F6FF),
borderRadius: BorderRadius.circular(12),
border: Border.all(
color: AppColors.app_blue,
width: 0.5,
),
),
child: Center(
child: Text(
"+ Add Product",
style: TextStyle(
fontFamily: "JakartaMedium",
color: AppColors.app_blue,
),
),
),
),
),
if (editProvider.leadProductsList.isNotEmpty ||
editProvider.editProductPriceControllers.isNotEmpty)
ListView.builder(
itemCount: editProvider.editProductPriceControllers.length,
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, j) {
return Container(
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 10),
margin: const EdgeInsets.symmetric(vertical: 10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
TextWidget(context, "Product"),
DropdownButtonHideUnderline(
child: Row(
children: [
Expanded(
child: DropdownButton2<Products>(
isExpanded: true,
hint: const Text(
'Select Product',
style: TextStyle(fontSize: 14),
overflow: TextOverflow.ellipsis,
),
items: editProvider.productsList
.map((ord) => DropdownMenuItem<Products>(
value: ord,
child: Text(
"(Product Name: ${ord.name})",
style: const TextStyle(fontSize: 14),
overflow: TextOverflow.ellipsis,
),
))
.toList(),
value: editProvider.selectedProductIds[j] != null
? editProvider.productsList.firstWhere(
(ord) => ord.id == editProvider.selectedProductIds[j],
orElse: () => editProvider.productsList[0],
)
: null,
onChanged: (Products? value) {
if (value != null) {
editProvider.updateSelectedProductIds(j, value);
editProvider.selectedProductIds[j] =
value.id?.toString() ?? '';
editProvider.updateTotalAmount(j);
}
},
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
),
),
],
),
),
const SizedBox(height: 10),
Row(
children: [
Expanded(
flex: 2,
child: textControllerWidget(
context,
editProvider.editProductPriceControllers[j],
"Enter Product Price",
(value) => editProvider.updateTotalAmount(j),
TextInputType.number,
false,
FilteringTextInputFormatter.digitsOnly,
),
),
],
),
const SizedBox(height: 10),
Row(
children: [
Expanded(
flex: 2,
child: textControllerWidget(
context,
editProvider.editQuantityControllers[j],
"Enter Quantity",
(value) => editProvider.updateTotalAmount(j),
TextInputType.number,
false,
FilteringTextInputFormatter.digitsOnly,
),
),
],
),
const SizedBox(height: 10),
Row(
children: [
Expanded(
flex: 2,
child: textControllerWidget(
context,
editProvider.editTotalAmountControllers[j],
"Total Amount",
(_) {},
TextInputType.number,
true,
FilteringTextInputFormatter.digitsOnly,
),
),
],
),
// IconButton(
// icon: const Icon(Icons.delete),
// onPressed: editProvider.editProductPriceControllers.length > 1
// ? () => editProvider.editRemoveRow(j)
// : null,
// ),
],
),
);
},
),
],
),
),
),
floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
bottomNavigationBar: InkResponse(
onTap: editProvider.submitLoading
? null
: () {
editProvider.submitForm(context,widget.leadID);
},
child: Container(
height: 45,
alignment: Alignment.center,
margin: const EdgeInsets.symmetric(horizontal: 10, vertical: 15),
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 5),
decoration: BoxDecoration(
color: AppColors.app_blue,
borderRadius: BorderRadius.circular(15),
),
child: editProvider.submitLoading
? CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(AppColors.app_blue),
)
: const Text(
"Submit",
style: TextStyle(
fontSize: 15,
fontFamily: "JakartaMedium",
color: Colors.white,
),
),
),
),
),
);
},
);
}
}
\ No newline at end of file
import 'package:dropdown_button2/dropdown_button2.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:generp/Utils/dropdownTheme.dart';
import 'package:provider/provider.dart';
import '../../Models/crmModels/crmLeadDetailsGenerateQuotationViewResponse.dart';
import '../../Notifiers/crmProvider/crmGenerateQuotationProvider.dart';
import '../../Utils/app_colors.dart';
import '../../Utils/commonWidgets.dart';
class Generatequotationscreen extends StatefulWidget {
final leadId;
const Generatequotationscreen({super.key, required this.leadId});
@override
State<Generatequotationscreen> createState() =>
_GeneratequotationscreenState();
}
class _GeneratequotationscreenState extends State<Generatequotationscreen> {
Dropdowntheme ddtheme = Dropdowntheme();
@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) async {
final provider = Provider.of<Crmgeneratequotationprovider>(
context,
listen: false,
);
await provider.crmLeadDetailsGenerateQuoteViewAPIFunction(
context,
widget.leadId,
);
// Initialize controllers and dropdowns after API call
provider.initializeForm(context);
});
}
@override
Widget build(BuildContext context) {
return Consumer<Crmgeneratequotationprovider>(
builder: (context, provider, child) {
return WillPopScope(
onWillPop: () async {
// provider.resetForm();
return true;
},
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar2(
context,
"Generate Quotation",
provider.resetForm,
const SizedBox(width: 0),
),
body: Container(
decoration: BoxDecoration(color: AppColors.white),
padding: const EdgeInsets.symmetric(horizontal: 10),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
textControllerWidget(
context,
provider.mailIdController,
"Enter Email Id",
provider.onChangemailId,
TextInputType.emailAddress,
false,
null,
),
errorWidget(context, provider.mailIdError),
textControllerWidget(
context,
provider.mobileController,
"Enter Mobile Number",
provider.onChangemobile,
TextInputType.phone,
false,
FilteringTextInputFormatter.digitsOnly,
),
errorWidget(context, provider.mobileError),
textControllerWidget(
context,
provider.subjectsController,
"Enter Subject",
provider.onChangesubjects,
TextInputType.text,
false,
null,
),
errorWidget(context, provider.subjectsError),
InkResponse(
onTap: () {
provider.editAddNewRow();
},
child: Container(
margin: const EdgeInsets.symmetric(vertical: 10),
height: 45,
width: MediaQuery.of(context).size.width,
decoration: BoxDecoration(
color: const Color(0xFFE6F6FF),
borderRadius: BorderRadius.circular(12),
border: Border.all(
color: AppColors.app_blue,
width: 0.5,
),
),
child: Center(
child: Text(
"+ Add Product",
style: TextStyle(
fontFamily: "JakartaMedium",
color: AppColors.app_blue,
),
),
),
),
),
if (provider.leadProductsList.isNotEmpty ||
provider.editProductPriceControllers.isNotEmpty) ...[
ListView.builder(
itemCount: provider.editProductPriceControllers.length,
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, j) {
return Container(
padding: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
margin: const EdgeInsets.symmetric(vertical: 10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
TextWidget(context, "Product"),
DropdownButtonHideUnderline(
child: Row(
children: [
Expanded(
child: DropdownButton2<LeadProducts>(
isExpanded: true,
hint: const Text(
'Select Product',
style: TextStyle(fontSize: 14),
overflow: TextOverflow.ellipsis,
),
items:
provider.leadProductsList
.map(
(ord) => DropdownMenuItem<
LeadProducts
>(
value: ord,
child: Text(
"(Product Name: ${ord.productName})",
style: const TextStyle(
fontSize: 14,
),
overflow:
TextOverflow
.ellipsis,
),
),
)
.toList(),
value:
provider.selectedProductIds[j] !=
null
? provider.leadProductsList
.firstWhere(
(ord) =>
ord.id ==
provider
.selectedProductIds[j],
orElse:
() =>
provider
.leadProductsList[0],
)
: null,
onChanged: (LeadProducts? value) {
if (value != null) {
provider.updateSelectedProductIds(
j,
value,
);
provider.selectedProductIds[j] =
value.id?.toString() ?? '';
provider.updateTotalAmount(j);
}
},
buttonStyleData:
ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData:
ddtheme.menuItemStyleData,
dropdownStyleData:
ddtheme.dropdownStyleData,
),
),
],
),
),
const SizedBox(height: 10),
Row(
children: [
Expanded(
flex: 2,
child: textControllerWidget(
context,
provider.editProductPriceControllers[j],
"Enter Product Price",
(value) =>
provider.updateTotalAmount(j),
TextInputType.number,
false,
FilteringTextInputFormatter.digitsOnly,
),
),
],
),
const SizedBox(height: 10),
Row(
children: [
Expanded(
flex: 2,
child: textControllerWidget(
context,
provider.editQuantityControllers[j],
"Enter Quantity",
(value) =>
provider.updateTotalAmount(j),
TextInputType.number,
false,
FilteringTextInputFormatter.digitsOnly,
),
),
],
),
const SizedBox(height: 10),
Row(
children: [
Expanded(
flex: 2,
child: textControllerWidget(
context,
provider.editTotalAmountControllers[j],
"Total Amount",
(_) {},
TextInputType.number,
true,
FilteringTextInputFormatter.digitsOnly,
),
),
],
),
// IconButton(
// icon: const Icon(Icons.delete),
// onPressed: provider.editProductPriceControllers.length > 1
// ? () => provider.editRemoveRow(j)
// : null,
// ),
],
),
);
},
),
],
textControllerWidget(
context,
provider.taxesController,
"Taxes",
provider.onChangetaxes,
TextInputType.text,
false,
null,
),
errorWidget(context, provider.taxesError),
textControllerWidget(
context,
provider.SpecialNoteController,
"Special Note",
provider.onChangeSpecialNote,
TextInputType.text,
false,
null,
),
errorWidget(context, provider.SpecialNoteError),
textControllerWidget(
context,
provider.forController,
"FOR",
provider.onChangefor,
TextInputType.text,
false,
null,
),
errorWidget(context, provider.forError),
textControllerWidget(
context,
provider.paymentTermsController,
"Payment Terms",
provider.onChangepaymentTerms,
TextInputType.text,
false,
null,
),
errorWidget(context, provider.paymentTermsError),
],
),
),
),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
bottomNavigationBar: SizedBox(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
child: InkResponse(
onTap:
provider.submitLoading
? null
: () {
//genquotedown
final insertedData = provider.getFormData();
provider
.crmLeadDetailsGenerateQuoteSubmitAPIFunction(
context,
widget.leadId,
insertedData,
"genquotedown",
);
},
child: Container(
height: 45,
alignment: Alignment.center,
margin: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 15,
),
padding: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
decoration: BoxDecoration(
color: AppColors.app_blue,
borderRadius: BorderRadius.circular(15),
),
child:
provider.submitLoading
? CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue,
),
)
: const Text(
"Download Quotation",
style: TextStyle(
fontSize: 15,
fontFamily: "JakartaMedium",
color: Colors.white,
),
),
),
),
),
SizedBox(width: 10),
Expanded(
child: InkResponse(
onTap:
provider.submitLoading
? null
: () {
//genquotemail,
final insertedData = provider.getFormData();
provider
.crmLeadDetailsGenerateQuoteSubmitAPIFunction(
context,
widget.leadId,
insertedData,
"genquotemail",
);
},
child: Container(
height: 45,
alignment: Alignment.center,
margin: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 15,
),
padding: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
decoration: BoxDecoration(
color: AppColors.app_blue,
borderRadius: BorderRadius.circular(15),
),
child:
provider.submitLoading
? CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue,
),
)
: const Text(
"Mail Quotation",
style: TextStyle(
fontSize: 15,
fontFamily: "JakartaMedium",
color: Colors.white,
),
),
),
),
),
SizedBox(width: 10),
Expanded(
child: InkResponse(
onTap:
provider.submitLoading
? null
: () {
//genquotewhatsapp,
final insertedData = provider.getFormData();
provider
.crmLeadDetailsGenerateQuoteSubmitAPIFunction(
context,
widget.leadId,
insertedData,
"genquotewhatsapp",
);
},
child: Container(
height: 45,
alignment: Alignment.center,
margin: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 15,
),
padding: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
decoration: BoxDecoration(
color: AppColors.app_blue,
borderRadius: BorderRadius.circular(15),
),
child:
provider.submitLoading
? CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue,
),
)
: const Text(
"Whatsapp Quotation",
style: TextStyle(
fontSize: 15,
fontFamily: "JakartaMedium",
color: Colors.white,
),
),
),
),
),
SizedBox(width: 10),
Expanded(
child: InkResponse(
onTap:
provider.submitLoading
? null
: () {
//genquotewhatsappbymynum,
final insertedData = provider.getFormData();
provider
.crmLeadDetailsGenerateQuoteSubmitAPIFunction(
context,
widget.leadId,
insertedData,
"genquotewhatsappbymynum",
);
},
child: Container(
height: 45,
alignment: Alignment.center,
margin: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 15,
),
padding: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
decoration: BoxDecoration(
color: AppColors.app_blue,
borderRadius: BorderRadius.circular(15),
),
child:
provider.submitLoading
? CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue,
),
)
: const Text(
"Whatsapp Quotation By My Number",
style: TextStyle(
fontSize: 15,
fontFamily: "JakartaMedium",
color: Colors.white,
),
),
),
),
),
],
),
),
),
);
},
);
}
}
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:generp/screens/crm/editProductsList.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../Notifiers/crmProvider/crmLeadDetailsProvider.dart'; import '../../Notifiers/crmProvider/crmLeadDetailsProvider.dart';
...@@ -7,13 +8,26 @@ import '../../Utils/app_colors.dart'; ...@@ -7,13 +8,26 @@ import '../../Utils/app_colors.dart';
import '../../Utils/commonWidgets.dart'; import '../../Utils/commonWidgets.dart';
class Productdetails extends StatefulWidget { class Productdetails extends StatefulWidget {
const Productdetails({super.key}); final leadID;
final mode;
const Productdetails({super.key,required this.leadID,required this.mode});
@override @override
State<Productdetails> createState() => _ProductdetailsState(); State<Productdetails> createState() => _ProductdetailsState();
} }
class _ProductdetailsState extends State<Productdetails> { class _ProductdetailsState extends State<Productdetails> {
@override
void initState() {
// TODO: implement initState
super.initState();
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
final provider = Provider.of<crmLeadDetailsProvider>(context,listen: false);
provider.crmLeadDetailsAPIFunction(context, widget.leadID, widget.mode);
},);
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Consumer<crmLeadDetailsProvider>( return Consumer<crmLeadDetailsProvider>(
...@@ -104,7 +118,14 @@ class _ProductdetailsState extends State<Productdetails> { ...@@ -104,7 +118,14 @@ class _ProductdetailsState extends State<Productdetails> {
floatingActionButton: Align( floatingActionButton: Align(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
child: InkWell( child: InkWell(
onTap: () async {
var res = await Navigator.push(context, MaterialPageRoute(builder: (context) => EditProductsList(
leadID: widget.leadID,
),));
if(res==true){
provider.crmLeadDetailsAPIFunction(context, widget.leadID, widget.mode);
}
},
child: Container( child: Container(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
height: 45, height: 45,
...@@ -116,7 +137,7 @@ class _ProductdetailsState extends State<Productdetails> { ...@@ -116,7 +137,7 @@ class _ProductdetailsState extends State<Productdetails> {
), ),
child: Center( child: Center(
child: Text( child: Text(
"Followup Details", "Edit Products",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle(color: Colors.white, style: TextStyle(color: Colors.white,
fontFamily: "JakartaMedium"), fontFamily: "JakartaMedium"),
......
...@@ -1006,6 +1006,49 @@ class _PaymentrequestionlistdetailsState ...@@ -1006,6 +1006,49 @@ class _PaymentrequestionlistdetailsState
} }
} }
}, },
dropdownSearchData: DropdownSearchData(
searchInnerWidgetHeight: 50,
searchController:
provider
.paymentAccountSearchController,
searchInnerWidget: Padding(
padding: const EdgeInsets.all(8),
child: TextFormField(
controller:
provider
.paymentAccountSearchController,
decoration: InputDecoration(
isDense: true,
contentPadding:
const EdgeInsets.symmetric(
horizontal: 10,
vertical: 8,
),
hintText: 'Search account...',
border: OutlineInputBorder(
borderRadius:
BorderRadius.circular(8),
),
),
),
),
searchMatchFn: (item, searchValue) {
return item.value?.name
?.toLowerCase()
.contains(
searchValue.toLowerCase(),
) ??
false;
},
// Optional: clear search text when dropdown closes
),
onMenuStateChange: (isOpen) {
if (!isOpen) {
provider.paymentAccountSearchController
.clear();
}
},
buttonStyleData: ddtheme.buttonStyleData, buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData, iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: menuItemStyleData:
...@@ -1181,8 +1224,9 @@ class _PaymentrequestionlistdetailsState ...@@ -1181,8 +1224,9 @@ class _PaymentrequestionlistdetailsState
.paymentrequisitionProcessSubmitAPIFunction( .paymentrequisitionProcessSubmitAPIFunction(
context, context,
widget.mode, widget.mode,
paymentID,
paymentReferenceNumber.text, paymentReferenceNumber.text,
paymentID,
provider.selectedID,
remarks.text, remarks.text,
provider.imagePath, provider.imagePath,
); );
......
...@@ -43,4 +43,10 @@ export 'package:generp/Notifiers/ordersProvider/editPaymentProvider.dart'; ...@@ -43,4 +43,10 @@ export 'package:generp/Notifiers/ordersProvider/editPaymentProvider.dart';
export 'package:generp/Notifiers/crmProvider/crmDashboardProvider.dart'; export 'package:generp/Notifiers/crmProvider/crmDashboardProvider.dart';
export 'package:generp/Notifiers/crmProvider/LeadListProvider.dart'; export 'package:generp/Notifiers/crmProvider/LeadListProvider.dart';
export 'package:generp/Notifiers/crmProvider/crmLeadDetailsProvider.dart'; export 'package:generp/Notifiers/crmProvider/crmLeadDetailsProvider.dart';
export 'package:generp/Notifiers/crmProvider/editCrmAccountDetailsProvider.dart';
export 'package:generp/Notifiers/crmProvider/editProductListProvider.dart';
export 'package:generp/Notifiers/crmProvider/ProspectListProvider.dart';
export 'package:generp/Notifiers/crmProvider/crmProspectDetailsProvider.dart';
export 'package:generp/Notifiers/crmProvider/crmNearbyOpenLeadsProvider.dart';
export 'package:generp/Notifiers/crmProvider/crmGenerateQuotationProvider.dart';
...@@ -13,7 +13,12 @@ import 'package:generp/Models/crmModels/GetSourceOnReferenceResponse.dart'; ...@@ -13,7 +13,12 @@ import 'package:generp/Models/crmModels/GetSourceOnReferenceResponse.dart';
import 'package:generp/Models/crmModels/GetSubLocOnDistrictResponse.dart'; import 'package:generp/Models/crmModels/GetSubLocOnDistrictResponse.dart';
import 'package:generp/Models/crmModels/LeadListContactPopUpResponse.dart'; import 'package:generp/Models/crmModels/LeadListContactPopUpResponse.dart';
import 'package:generp/Models/crmModels/LeadListViewResponse.dart'; import 'package:generp/Models/crmModels/LeadListViewResponse.dart';
import 'package:generp/Models/crmModels/ProspectListViewResponse.dart';
import 'package:generp/Models/crmModels/SubmitLeadListFilterResponse.dart'; import 'package:generp/Models/crmModels/SubmitLeadListFilterResponse.dart';
import 'package:generp/Models/crmModels/crmLeadDetailsGenerateQuotationSubmitResponse.dart';
import 'package:generp/Models/crmModels/crmProspectDetailsAddFollowUpAppointmentResponse.dart';
import 'package:generp/Models/crmModels/crmProspectDetailsAddLeadsResponse.dart';
import 'package:generp/Models/crmModels/crmProspectDetailsResponse.dart';
import 'package:generp/Models/financeModels/addDirectPaymentResponse.dart'; import 'package:generp/Models/financeModels/addDirectPaymentResponse.dart';
import 'package:generp/Models/financeModels/paymentRequisitionPaymentsListResponse.dart'; import 'package:generp/Models/financeModels/paymentRequisitionPaymentsListResponse.dart';
import 'package:generp/Models/ordersModels/PendingTPCAgentListResponse.dart'; import 'package:generp/Models/ordersModels/PendingTPCAgentListResponse.dart';
...@@ -59,6 +64,12 @@ import '../Models/commonModels/commonAccountLedgerResponse.dart'; ...@@ -59,6 +64,12 @@ import '../Models/commonModels/commonAccountLedgerResponse.dart';
import '../Models/commonModels/commonAccountdetailsResponse.dart'; import '../Models/commonModels/commonAccountdetailsResponse.dart';
import '../Models/commonModels/commonAccountlistResponse.dart'; import '../Models/commonModels/commonAccountlistResponse.dart';
import '../Models/crmModels/LeadDetailsResponse.dart'; import '../Models/crmModels/LeadDetailsResponse.dart';
import '../Models/crmModels/NearbyOpenLeadsResponse.dart';
import '../Models/crmModels/SubmitProspectListFilterResponse.dart';
import '../Models/crmModels/crmLeadDetailsEditAccountViewResponse.dart';
import '../Models/crmModels/crmLeadDetailsEditProductsViewResponse.dart';
import '../Models/crmModels/crmLeadDetailsGenerateQuotationViewResponse.dart';
import '../Models/crmModels/crmProspectDetailsEditAccountViewResponse.dart';
import '../Models/financeModels/addPaymentRequestionResponse.dart'; import '../Models/financeModels/addPaymentRequestionResponse.dart';
import '../Models/financeModels/addReceiptPaymentResponse.dart'; import '../Models/financeModels/addReceiptPaymentResponse.dart';
import '../Models/financeModels/paymentRequesitionListsResponse.dart'; import '../Models/financeModels/paymentRequesitionListsResponse.dart';
...@@ -1344,6 +1355,7 @@ class ApiCalling { ...@@ -1344,6 +1355,7 @@ class ApiCalling {
}; };
var res; var res;
print(data);
if (attachment != null) { if (attachment != null) {
res = await postImageNew( res = await postImageNew(
data, data,
...@@ -1359,12 +1371,6 @@ class ApiCalling { ...@@ -1359,12 +1371,6 @@ class ApiCalling {
res = jsonDecode(res.body); res = jsonDecode(res.body);
return CommonResponse.fromJson(res); return CommonResponse.fromJson(res);
} }
if (res != null) {
return res;
} else {
debugPrint("Null Response");
return null;
}
} catch (e) { } catch (e) {
debugPrint('hello bev=bug $e '); debugPrint('hello bev=bug $e ');
return null; return null;
...@@ -1563,7 +1569,7 @@ class ApiCalling { ...@@ -1563,7 +1569,7 @@ class ApiCalling {
}; };
final res = await post(data, approveRejectPaymentRequestUrl, {}); final res = await post(data, approveRejectPaymentRequestUrl, {});
if (res != null) { if (res != null) {
print(data); print("add payment:${data}");
debugPrint(res.body); debugPrint(res.body);
return approveRejectPaymentRequestResponse.fromJson( return approveRejectPaymentRequestResponse.fromJson(
jsonDecode(res.body), jsonDecode(res.body),
...@@ -1650,11 +1656,11 @@ class ApiCalling { ...@@ -1650,11 +1656,11 @@ class ApiCalling {
} }
} }
static Future<approveRejectPaymentRequestResponse?> static Future<CommonResponse?> processApproveRejectPaymentRequestSubmitAPI(
processApproveRejectPaymentRequestSubmitAPI(
empId, empId,
session, session,
mode, mode,
payment_reference_number,
payment_request_id, payment_request_id,
payment_account_id, payment_account_id,
processing_remarks, processing_remarks,
...@@ -1664,13 +1670,15 @@ class ApiCalling { ...@@ -1664,13 +1670,15 @@ class ApiCalling {
Map<String, String> data = { Map<String, String> data = {
'emp_id': (empId).toString(), 'emp_id': (empId).toString(),
'session_id': (session).toString(), 'session_id': (session).toString(),
'type': 'approve', 'type': 'approve'.toString(),
'mode': mode.toString(), 'mode': mode.toString(),
'payment_reference_number': payment_reference_number.toString(),
'payment_request_id': (payment_request_id).toString(), 'payment_request_id': (payment_request_id).toString(),
'payment_account_id': payment_account_id, 'payment_account_id': payment_account_id.toString(),
'processing_remarks': processing_remarks, 'processing_remarks': processing_remarks.toString(),
}; };
var res; var res;
print("Process:${data}");
if (attachment != null) { if (attachment != null) {
res = await postImageNew( res = await postImageNew(
data, data,
...@@ -1679,13 +1687,14 @@ class ApiCalling { ...@@ -1679,13 +1687,14 @@ class ApiCalling {
attachment, attachment,
"attachment", "attachment",
); );
print("Process:${data}");
res = jsonDecode(res); res = jsonDecode(res);
print(data); print(data);
return approveRejectPaymentRequestResponse.fromJson(res); return CommonResponse.fromJson(res);
} else { } else {
res = await post(data, approveRejectPaymentRequestSubmitUrl, {}); res = await post(data, approveRejectPaymentRequestSubmitUrl, {});
res = jsonDecode(res.body); res = jsonDecode(res.body);
return approveRejectPaymentRequestResponse.fromJson(res); return CommonResponse.fromJson(res);
} }
} catch (e) { } catch (e) {
debugPrint('hello bev=bug $e '); debugPrint('hello bev=bug $e ');
...@@ -1970,6 +1979,7 @@ class ApiCalling { ...@@ -1970,6 +1979,7 @@ class ApiCalling {
}; };
final res = await post(data, commonAddAccountSubmit, {}); final res = await post(data, commonAddAccountSubmit, {});
if (res != null) { if (res != null) {
print(data);
debugPrint(res.body); debugPrint(res.body);
return commonAddAccountsViewResponse.fromJson(jsonDecode(res.body)); return commonAddAccountsViewResponse.fromJson(jsonDecode(res.body));
} else { } else {
...@@ -3250,6 +3260,118 @@ class ApiCalling { ...@@ -3250,6 +3260,118 @@ class ApiCalling {
} }
} }
static Future<crmLeadDetailsEditAccountViewResponse?>
crmLeadDetailsEditAccountViewAPI(empId, session, lead_id, mode) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'lead_id': (lead_id).toString(),
'mode': (mode).toString(),
};
final res = await post(data, crmLeadDetailsEditAccountViewUrl, {});
if (res != null) {
print(data);
debugPrint(res.body);
return crmLeadDetailsEditAccountViewResponse.fromJson(
jsonDecode(res.body),
);
} else {
debugPrint("Null Response");
return null;
}
} catch (e) {
debugPrint('hello bev=bug $e ');
return null;
}
}
static Future<CommonResponse?> crmLeadDetailsEditAccountSubmitAPI(
empId,
session,
account_id,
segment_id,
team_id,
account_name,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'account_id': (account_id).toString(),
'segment_id': (segment_id).toString(),
'team_id': (team_id).toString(),
'account_name': (account_name).toString(),
};
final res = await post(data, crmLeadDetailsEditAccountUrl, {});
if (res != null) {
print(data);
debugPrint(res.body);
return CommonResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
return null;
}
} catch (e) {
debugPrint('hello bev=bug $e ');
return null;
}
}
static Future<crmLeadDetailsEditProductsViewResponse?>
crmLeadDetailsEditProductsViewAPI(empId, session, lead_id) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'lead_id': (lead_id).toString(),
};
final res = await post(data, crmLeadDetailsEditProductsViewUrl, {});
if (res != null) {
print(data);
print(jsonDecode(res.body)['lead_products']);
debugPrint(res.body);
return crmLeadDetailsEditProductsViewResponse.fromJson(
jsonDecode(res.body),
);
} else {
debugPrint("Null Response");
return null;
}
} catch (e) {
debugPrint('hello bev=bug $e ');
return null;
}
}
static Future<CommonResponse?> crmLeadDetailsEditProductsSubmitAPI(
empId,
session,
products,
lead_id,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'products': jsonEncode(products).toString(),
'lead_id': (lead_id).toString(),
};
final res = await post(data, crmLeadDetailsEditProductsUrl, {});
if (res != null) {
print(data);
debugPrint(jsonDecode(res.body));
return CommonResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
return null;
}
} catch (e) {
debugPrint('hello bev=bug $e ');
return null;
}
}
static Future<CommonResponse?> crmLeadDetailsAddContactAPI( static Future<CommonResponse?> crmLeadDetailsAddContactAPI(
empId, empId,
session, session,
...@@ -3358,6 +3480,513 @@ class ApiCalling { ...@@ -3358,6 +3480,513 @@ class ApiCalling {
} }
} }
static Future<crmLeadDetailsGenerateQuotationViewResponse?>
crmLeadDetailsGenerateQuotationViewAPI(empId, session, lead_id) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'lead_id': (lead_id).toString(),
};
final res = await post(data, crmLeadDetailsGenerateQuotationViewUrl, {});
if (res != null) {
print(data);
debugPrint("ListView: ${res.body}");
return crmLeadDetailsGenerateQuotationViewResponse.fromJson(
jsonDecode(res.body),
);
} else {
debugPrint("Null Response");
return null;
}
} catch (e) {
debugPrint('hello bev=bug $e ');
return null;
}
}
static Future<crmLeadDetailsGenerateQuotationSubmitResponse?>
crmLeadDetailsGenerateQuotationSubmitAPI(
emp_id,
session_id,
lead_id,
quotemno,
quotesubject,
taxes,
quotenote,
quotefor,
quotep_terms,
quotemail,
quote_products,
quotation_type,
) async {
try {
Map<String, String> data = {
'emp_id': emp_id.toString(),
'session_id': session_id.toString(),
'lead_id': lead_id.toString(),
'quotemno': quotemno.toString(),
'quotesubject': quotesubject.toString(),
'taxes': taxes.toString(),
'quotenote': quotenote.toString(),
'quotefor': quotefor.toString(),
'quotep_terms': quotep_terms.toString(),
'quotemail': quotemail.toString(),
'quote_products': jsonEncode(quote_products).toString(),
'quotation_type': quotation_type.toString(),
};
final res = await post(
data,
crmLeadDetailsGenerateQuotationSubmitUrl,
{},
);
if (res != null) {
print("Filter:${data}");
debugPrint(res.body);
return crmLeadDetailsGenerateQuotationSubmitResponse.fromJson(
jsonDecode(res.body),
);
} else {
debugPrint("Null Response");
return null;
}
} catch (e) {
debugPrint('hello bev=bug $e ');
return null;
}
}
static Future<ProspectListViewResponse?> crmProspectListViewAPI(
empId,
session,
mode,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'mode': (mode).toString(),
};
final res = await post(data, crmProspectListViewUrl, {});
if (res != null) {
print(data);
debugPrint("ListView: ${res.body}");
return ProspectListViewResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
return null;
}
} catch (e) {
debugPrint('hello bev=bug $e ');
return null;
}
}
static Future<SubmitProspectListFilterResponse?>
crmProspectListFilterSubmitAPI(
empId,
session,
mode,
teamemployee,
mob,
company_name,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'mode': (mode).toString(),
'teamemployee': teamemployee.toString(),
'mob': mob.toString(),
'company_name': company_name.toString(),
};
final res = await post(data, crmProspectListFilterSubmitUrl, {});
if (res != null) {
print("Filter:${data}");
debugPrint(res.body);
return SubmitProspectListFilterResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
return null;
}
} catch (e) {
debugPrint('hello bev=bug $e ');
return null;
}
}
static Future<crmProspectDetailsResponse?> crmProspectDetailsAPI(
empId,
session,
account_id,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'account_id': (account_id).toString(),
};
final res = await post(data, crmProspectDetailsUrl, {});
if (res != null) {
print("Filter:${data}");
debugPrint(res.body);
return crmProspectDetailsResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
return null;
}
} catch (e) {
debugPrint('hello bev=bug $e ');
return null;
}
}
static Future<CommonResponse?> crmProspectDetailsTransferAccountAPI(
empId,
session,
account_id,
tranemp_id,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'account_id': (account_id).toString(),
'tranemp_id': (tranemp_id).toString(),
};
final res = await post(data, crmProspectDetailsTransferAccountUrl, {});
if (res != null) {
print("Filter:${data}");
debugPrint(res.body);
return CommonResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
return null;
}
} catch (e) {
debugPrint('hello bev=bug $e ');
return null;
}
}
static Future<crmProspectDetailsEditAccountViewResponse?>
crmProspectDetailsEditAccountViewAPI(empId, session, account_id) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'account_id': (account_id).toString(),
};
final res = await post(data, crmProspectDetailsEditAccountViewUrl, {});
if (res != null) {
print("Filter:${data}");
debugPrint(res.body);
return crmProspectDetailsEditAccountViewResponse.fromJson(
jsonDecode(res.body),
);
} else {
debugPrint("Null Response");
return null;
}
} catch (e) {
debugPrint('hello bev=bug $e ');
return null;
}
}
static Future<CommonResponse?> crmProspectDetailsEditAccountSubmitAPI(
empId,
session,
account_id,
edit_company_name,
edit_salutation_name,
state_id,
district,
sub_locality,
pincode,
address,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'account_id': (account_id).toString(),
'edit_company_name': edit_company_name.toString(),
'edit_salutation_name': edit_salutation_name.toString(),
'state_id': state_id.toString(),
'district': district.toString(),
'sub_locality': sub_locality.toString(),
'pincode': pincode.toString(),
'address': address.toString(),
};
final res = await post(data, crmProspectDetailsEditAccountSubmitUrl, {});
if (res != null) {
print("Filter:${data}");
debugPrint(res.body);
return CommonResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
return null;
}
} catch (e) {
debugPrint('hello bev=bug $e ');
return null;
}
}
static Future<crmProspectDetailsAddLeadsResponse?>
crmProspectDetailsAddLeadViewAPI(empId, session, mode) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'mode': (mode).toString(),
};
final res = await post(data, crmProspectDetailsAddLeadViewUrl, {});
if (res != null) {
print("Filter:${data}");
debugPrint(res.body);
return crmProspectDetailsAddLeadsResponse.fromJson(
jsonDecode(res.body),
);
} else {
debugPrint("Null Response");
return null;
}
} catch (e) {
debugPrint('hello bev=bug $e ');
return null;
}
}
static Future<CommonResponse?> crmProspectDetailsAddLeadSubmitAPI(
empId,
session,
mode,
account_id,
acc_manager_id,
products,
lead_status,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'mode': (mode).toString(),
'account_id': account_id.toString(),
'acc_manager_id': acc_manager_id.toString(),
'products': jsonEncode(products).toString(),
'lead_status': lead_status.toString(),
};
final res = await post(data, crmProspectDetailsAddLeadSubmitUrl, {});
if (res != null) {
print("Filter:${data}");
debugPrint(res.body);
return CommonResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
return null;
}
} catch (e) {
debugPrint('hello bev=bug $e ');
return null;
}
}
static Future<CommonResponse?> crmProspectDetailsAddAccountAPI(
empId,
session,
name,
acc_id,
mob1,
designation,
email,
tel,
mob2,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'name': name.toString(),
'acc_id': acc_id.toString(),
'mob1': mob1.toString(),
'designation': designation.toString(),
'email': email.toString(),
'tel': tel.toString(),
'mob2': mob2.toString(),
};
final res = await post(data, crmProspectDetailsAddAccountUrl, {});
if (res != null) {
print("Filter:${data}");
debugPrint(res.body);
return CommonResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
return null;
}
} catch (e) {
debugPrint('hello bev=bug $e ');
return null;
}
}
static Future<CommonResponse?> crmProspectDetailsEditContactAPI(
empId,
session,
contact_id,
name,
acc_id,
mob1,
mob2,
tel,
designation,
email,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'contact_id': (contact_id).toString(),
'name': name.toString(),
'acc_id': acc_id.toString(),
'mob1': mob1.toString(),
'mob2': mob2.toString(),
'tel': tel.toString(),
'designation': designation.toString(),
'email': email.toString(),
};
final res = await post(data, crmProspectDetailsEditContactUrl, {});
if (res != null) {
print("Filter:${data}");
debugPrint(res.body);
return CommonResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
return null;
}
} catch (e) {
debugPrint('hello bev=bug $e ');
return null;
}
}
static Future<crmProspectDetailsAddFollowUpAppointmentResponse?> crmProspectDetailsFollowupNextAppointmentAPI(
empId,
session,
nextapp,
orderstatus,
lead_id,
followup_feedback,
followup_type,
followupintime,
loc,
followup_status,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'nextapp':nextapp.toString(),
'orderstatus':orderstatus.toString(),
'lead_id':lead_id.toString(),
'followup_feedback':followup_feedback.toString(),
'followup_type':followup_type.toString(),
'followupintime':followupintime.toString(),
'loc':loc.toString(),
'followup_status':followup_status.toString(),
};
final res = await post(data, crmProspectDetailsFollowupNextAppointmentUrl, {});
if (res != null) {
print("Filter:${data}");
debugPrint(res.body);
return crmProspectDetailsAddFollowUpAppointmentResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
return null;
}
} catch (e) {
debugPrint('hello bev=bug $e ');
return null;
}
}
static Future<CommonResponse?> crmProspectDetailsFollowupNextAppointmentOtherCaseAPI(
empId,
session,
nextapp,
orderstatus,
lead_id,
followup_feedback,
followup_type,
followupintime,
loc,
followup_status,
appointmentset,
app_date,
sms,
app_note,
in_t,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'nextapp':nextapp.toString(),
'orderstatus':orderstatus.toString(),
'lead_id':lead_id.toString(),
'followup_feedback':followup_feedback.toString(),
'followup_type':followup_type.toString(),
'followupintime':followupintime.toString(),
'loc':loc.toString(),
'followup_status':followup_status.toString(),
'appointmentset':appointmentset.toString(),
'app_date':app_date.toString(),
'sms':sms.toString(),
'app_note':app_note.toString(),
'in_t':in_t.toString(),
};
final res = await post(data, crmProspectDetailsFollowupNextAppointmentUrl, {});
if (res != null) {
print("Filter:${data}");
debugPrint(res.body);
return CommonResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
return null;
}
} catch (e) {
debugPrint('hello bev=bug $e ');
return null;
}
}
static Future<NearbyOpenLeadsResponse?> loadNearbyOpenLeadsAPI(
empId,
session,
emp_loc,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'emp_loc': (emp_loc).toString(),
};
final res = await post(data, crmNearbyOpenLeadsUrl, {});
if (res != null) {
print(data);
debugPrint(res.body);
return NearbyOpenLeadsResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
return null;
}
} catch (e) {
debugPrint('hello bev=bug $e ');
return null;
}
}
// static Future<CommonResponse?> TpcIssueListApprovalAPI( // static Future<CommonResponse?> TpcIssueListApprovalAPI(
// empId, // empId,
// session, // session,
......
...@@ -124,21 +124,35 @@ const crmLeadListViewUrl = "${baseUrl_test}crm_lead_list_view"; ...@@ -124,21 +124,35 @@ const crmLeadListViewUrl = "${baseUrl_test}crm_lead_list_view";
const crmLeadListFilterSubmitUrl = "${baseUrl_test}submit_crm_lead_list_filter"; const crmLeadListFilterSubmitUrl = "${baseUrl_test}submit_crm_lead_list_filter";
const crmLeadListSourceOnReferenceUrl = "${baseUrl_test}get_source_on_reference"; const crmLeadListSourceOnReferenceUrl = "${baseUrl_test}get_source_on_reference";
const crmLeadListSegmentOnTeamUrl = "${baseUrl_test}get_segment_on_team"; const crmLeadListSegmentOnTeamUrl = "${baseUrl_test}get_segment_on_team";
const crmLeadListDistrictOnStateUrl = "${baseUrl_test}get_segment_on_team"; const crmLeadListDistrictOnStateUrl = "${baseUrl_test}get_district_on_state";
const crmLeadListSubLocOnDistrictUrl = "${baseUrl_test}get_sublocation_on_district"; const crmLeadListSubLocOnDistrictUrl = "${baseUrl_test}get_sublocation_on_district";
const crmLeadListContactPopUpUrl = "${baseUrl_test}crm_lead_list_contact_popup"; const crmLeadListContactPopUpUrl = "${baseUrl_test}crm_lead_list_contact_popup";
const crmLeadDetailsUrl = "${baseUrl_test}crm_lead_details"; const crmLeadDetailsUrl = "${baseUrl_test}crm_lead_details";
const crmLeadDetailsEditAccountViewUrl = "${baseUrl_test}crm_lead_details_edit_account_view";
const crmLeadDetailsEditProductsUrl = "${baseUrl_test}crm_lead_details_edit_products";
const crmLeadDetailsEditProductsViewUrl = "${baseUrl_test}crm_lead_details_edit_products_view";
const crmLeadDetailsEditAccountUrl = "${baseUrl_test}crm_lead_details_edit_account";
const crmLeadDetailsAddContactUrl = "${baseUrl_test}crm_lead_details_add_account"; const crmLeadDetailsAddContactUrl = "${baseUrl_test}crm_lead_details_add_account";
const crmLeadDetailsEditContactUrl = "${baseUrl_test}crm_lead_details_edit_contact"; const crmLeadDetailsEditContactUrl = "${baseUrl_test}crm_lead_details_edit_contact";
const crmLeadDetailsAddAppointmentUrl = "${baseUrl_test}crm_lead_details_add_appointment"; const crmLeadDetailsAddAppointmentUrl = "${baseUrl_test}crm_lead_details_add_appointment";
const crmLeadDetailsGenerateQuotationViewUrl = "${baseUrl_test}crm_lead_details_generate_quotation_view";
const crmLeadDetailsGenerateQuotationSubmitUrl = "${baseUrl_test}crm_lead_details_generate_quotation_submit";
const crmProspectListViewUrl = "${baseUrl_test}crm_prospect_list_view"; const crmProspectListViewUrl = "${baseUrl_test}crm_prospect_list_view";
const crmProspectListFilterSubmitUrl = "${baseUrl_test}crm_prospect_list_filter_submit"; const crmProspectListFilterSubmitUrl = "${baseUrl_test}crm_prospect_list_filter_submit";
const crmProspectDetailsUrl = "${baseUrl_test}crm_prospect_details";
const crmProspectDetailsTransferAccountUrl = "${baseUrl_test}crm_prospect_details_transfer_account_submit";
const crmProspectDetailsEditAccountViewUrl = "${baseUrl_test}crm_prospect_details_edit_account_view";
const crmProspectDetailsEditAccountSubmitUrl = "${baseUrl_test}crm_prospect_details_edit_account_submit";
const crmProspectDetailsAddLeadViewUrl = "${baseUrl_test}crm_prospect_details_add_lead_view";
const crmProspectDetailsAddLeadSubmitUrl = "${baseUrl_test}crm_prospect_details_add_lead_submit";
const crmProspectDetailsAddAccountUrl = "${baseUrl_test}crm_prospect_details_add_account";
const crmProspectDetailsEditContactUrl = "${baseUrl_test}crm_prospect_details_edit_contact";
const crmProspectDetailsFollowupNextAppointmentUrl = "${baseUrl_test}crm_lead_details_add_followup_next_appointment";
const crmCheckAccountFieldsUrl = "${baseUrl_test}check_crm_add_account_fields"; const crmCheckAccountFieldsUrl = "${baseUrl_test}check_crm_add_account_fields";
const crmNewProspectLeadSubmitUrl = "${baseUrl_test}crm_add_new_lead_prospect_submit"; const crmNewProspectLeadSubmitUrl = "${baseUrl_test}crm_add_new_lead_prospect_submit";
const crmNewProspectListEditGstUrl = "${baseUrl_test}crm_prospect_list_edit_gst"; const crmNewProspectListEditGstUrl = "${baseUrl_test}crm_prospect_list_edit_gst";
const crmNearbyOpenLeadsUrl = "${baseUrl_test}nearby_crm_open_leads";
......
...@@ -37,10 +37,10 @@ packages: ...@@ -37,10 +37,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: async name: async
sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.13.0" version: "2.12.0"
barcode: barcode:
dependency: transitive dependency: transitive
description: description:
...@@ -285,10 +285,10 @@ packages: ...@@ -285,10 +285,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: fake_async name: fake_async
sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.3.3" version: "1.3.2"
ffi: ffi:
dependency: transitive dependency: transitive
description: description:
...@@ -932,26 +932,26 @@ packages: ...@@ -932,26 +932,26 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: leak_tracker name: leak_tracker
sha256: "8dcda04c3fc16c14f48a7bb586d4be1f0d1572731b6d81d51772ef47c02081e0" sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "11.0.1" version: "10.0.8"
leak_tracker_flutter_testing: leak_tracker_flutter_testing:
dependency: transitive dependency: transitive
description: description:
name: leak_tracker_flutter_testing name: leak_tracker_flutter_testing
sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.0.10" version: "3.0.9"
leak_tracker_testing: leak_tracker_testing:
dependency: transitive dependency: transitive
description: description:
name: leak_tracker_testing name: leak_tracker_testing
sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.0.2" version: "3.0.1"
lints: lints:
dependency: transitive dependency: transitive
description: description:
...@@ -1657,10 +1657,10 @@ packages: ...@@ -1657,10 +1657,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: vm_service name: vm_service
sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02 sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "15.0.0" version: "14.3.1"
web: web:
dependency: transitive dependency: transitive
description: description:
......
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