Commit 7959ada6 authored by Sai Srinivas's avatar Sai Srinivas
Browse files

01-08-2025 By Sai Srinivas

Finance Module and CRM issues
parent 14d01f4d
class crmNewLeadsProspectsSubmitResponse {
String? error;
String? message;
String? leadId;
crmNewLeadsProspectsSubmitResponse({this.error, this.message, this.leadId});
crmNewLeadsProspectsSubmitResponse.fromJson(Map<String, dynamic> json) {
error = json['error'];
message = json['message'];
leadId = json['lead_id'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['error'] = this.error;
data['message'] = this.message;
data['lead_id'] = this.leadId;
return data;
}
}
......@@ -360,6 +360,141 @@ class Accountslistprovider extends ChangeNotifier {
}
}
bool validateStep1(){
accountError = null;
nameError = null;
mobileError = null;
contactPersonError = null;
bool isValid = true;
if (_selectedAccountType == null || _selectedAccountType!.isEmpty) {
accountError = "Please select an Account";
isValid = false;
}
if (nameController.text.trim().isEmpty) {
nameError = "Please Enter a Name";
isValid = false;
}
if(mobileController.text.trim().isNotEmpty&&mobileController.text.length<10){
mobileError = "Mobile Number should be 10 digits";
isValid = false;
}
if (mobileController.text.trim().isEmpty) {
mobileError = "Please Enter Mobile Number";
isValid = false;
}
if (contactPersonController.text.trim().isEmpty) {
contactPersonError = "Please Enter Contact Person Name";
isValid = false;
}
_submitClicked = false;
notifyListeners();
return isValid;
}
bool validateStep2(){
stateError = null;
districtError = null;
localityError = null;
addressError = null;
bool isValid = true;
// if (_selectedState == null || _selectedStateID!.isEmpty) {
// stateError = "Please select a State";
// isValid = false;
// }
// if (_selectedDistricts == null || _selectedDistrictID!.isEmpty) {
// districtError = "Please select a District";
// isValid = false;
// }
// if (_selectedSubLocations == null || _selectedSubLocID!.isEmpty) {
// localityError = "Please select a Locality";
// isValid = false;
// }
// if (addressController.text.trim().isEmpty) {
// addressError = "Please Enter an Address";
// isValid = false;
// }
_submitClicked = false;
notifyListeners();
return isValid;
}
bool validateStep3(){
banknameError = null;
bankBranchError = null;
bankIFSCError = null;
bankHolderNameError = null;
bankAcNumberError = null;
upiError = null;
bool isValid = true;
// if (bankNameController.text
// .trim()
// .isEmpty) {
// banknameError = "Please Enter a Bank Name";
// isValid = false;
// }
//
// if (branchNameController.text
// .trim()
// .isEmpty) {
// bankBranchError = "Please Enter Branch Name";
// isValid = false;
// }
// if (bankIfscCotroller.text
// .trim()
// .isEmpty) {
// bankIFSCError = "Please Enter Bank IFSC";
// isValid = false;
// }
// if (bankHolderNameController.text
// .trim()
// .isEmpty) {
// bankHolderNameError = "Please Enter Account Holder Name";
// isValid = false;
// }
// if (bankAcNumberController.text
// .trim()
// .isEmpty) {
// bankAcNumberError = "Please Enter Bank Account Number";
// isValid = false;
// }
// if (bankUpiController.text
// .trim()
// .isEmpty) {
// upiError = "Please Enter UPI ID";
// isValid = false;
// }
_submitClicked = false;
notifyListeners();
return isValid;
}
bool validateStep4(){
bool isValid = true;
// if (contectPersonDesignationController.text
// .trim()
// .isEmpty) {
// desigantionError = "Please Enter Designation";
// isValid = false;
// }
// if (contectPersonAltMobController.text
// .trim()
// .isEmpty) {
// altMobError = "Please Enter Mobile Number";
// isValid = false;
// }
//
// }
// if (contectPersonTeleController.text.trim().isEmpty) {
// teleError= "Please Enter Telephone"; isValid = false;
// }
// if (contectPersonMailController.text.trim().isEmpty) {
// teleError= "Please Enter"; isValid = false;
// }
_submitClicked = false;
notifyListeners();
return isValid;
}
bool validatereceiptForm(BuildContext context) {
accountError = null;
nameError = null;
......
......@@ -8,6 +8,7 @@ import 'package:flutter_download_manager/flutter_download_manager.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:generp/Models/crmModels/crmSelectedProductDetailsResponse.dart';
import 'package:generp/screens/LoginScreen.dart';
import 'package:generp/screens/crm/LeadDetailsByMode.dart';
import 'package:http/http.dart' as http;
import 'package:intl/intl.dart';
import 'package:path_provider/path_provider.dart';
......@@ -600,7 +601,18 @@ class Addnewleadsandprospectsprovider extends ChangeNotifier {
);
if (data != null) {
if (data.error == "0") {
Navigator.pop(context, true);
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(
builder: (context) => LeadDetailsByMode(mode: "executive", pageTitleName: "Lead Details", leadId: data.leadId??"-",),
settings: RouteSettings(
name: "LeadDetailsByMode"
)
),
(Route<dynamic> route) {
return route.settings.name == 'CrmdashboardScreen';
},
);
toast(context, data.message);
resetForm();
notifyListeners();
......
......@@ -535,7 +535,7 @@ class crmLeadDetailsProvider extends ChangeNotifier {
child: Column(
children: [
Expanded(
flex: 1,
flex: 2,
child: SizedBox(
height: 40,
child: Row(
......@@ -571,7 +571,7 @@ class crmLeadDetailsProvider extends ChangeNotifier {
),
),
Expanded(
flex: 3,
flex: 4,
child: CupertinoDatePicker(
dateOrder: DatePickerDateOrder.dmy,
initialDateTime: _date ?? DateTime.now(),
......
......@@ -415,7 +415,7 @@ class crmProspectDetailsProvider extends ChangeNotifier {
child: Column(
children: [
Expanded(
flex: 1,
flex: 2,
child: SizedBox(
height: 40,
child: Row(
......@@ -451,7 +451,7 @@ class crmProspectDetailsProvider extends ChangeNotifier {
),
),
Expanded(
flex: 3,
flex: 4,
child: CupertinoDatePicker(
dateOrder: DatePickerDateOrder.dmy,
initialDateTime: _date ?? DateTime.now(),
......
......@@ -8,6 +8,7 @@ import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:intl/intl.dart';
import 'package:provider/provider.dart';
import '../../screens/crm/LeadDetailsByMode.dart';
import '../../services/api_calling.dart';
import 'crmLeadDetailsProvider.dart';
......@@ -156,6 +157,7 @@ class followUpUpdateProvider extends ChangeNotifier {
Future<void> crmAddFollowUpAPIFunction(
BuildContext context,
fromScreen,
nextAppointmentStatus,
orderStatus,
leadID,
......@@ -196,7 +198,23 @@ class followUpUpdateProvider extends ChangeNotifier {
if (data != null && data.error == "0") {
_submitLoading = false;
resetForm();
if(fromScreen=="Pending Tasks"){
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(
builder: (context) => LeadDetailsByMode(mode: "executive", pageTitleName: "Lead Details", leadId: leadID??"-",),
settings: RouteSettings(
name: "LeadDetailsByMode"
)
),
(Route<dynamic> route) {
return route.settings.name == 'CrmdashboardScreen';
},
);
}else{
Navigator.pop(context);
}
if(mode.isNotEmpty){
prov2.crmLeadDetailsAPIFunction(context, leadID, mode);
}
......@@ -332,7 +350,7 @@ class followUpUpdateProvider extends ChangeNotifier {
child: Column(
children: [
Expanded(
flex: 1,
flex: 2,
child: SizedBox(
height: 40,
child: Row(
......@@ -369,7 +387,7 @@ class followUpUpdateProvider extends ChangeNotifier {
),
Expanded(
flex: 3,
flex: 4,
child: CupertinoDatePicker(
initialDateTime: _date ?? DateTime.now(),
minimumDate: DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day),
......
......@@ -13,6 +13,9 @@ import 'package:provider/provider.dart';
import 'approveRejectPaymentRequestResponse.dart';
class Requesitionlidtdetailsprovider extends ChangeNotifier {
bool _showMoreDetails = false;
TextEditingController requestedAmount = TextEditingController();
TextEditingController approvedAmountReadonly = TextEditingController();
TextEditingController proposedPaymentAccount = TextEditingController();
......@@ -55,6 +58,8 @@ String? proposedAmountError;
get image_picked => _image_picked;
bool get showMoreDetails => _showMoreDetails;
int get imagePicked => _image_picked;
File? get imagePath => _imageName;
......@@ -76,6 +81,11 @@ String? proposedAmountError;
notifyListeners();
}
set showMoreDetails(bool value){
_showMoreDetails = value;
notifyListeners();
}
PaymentDetails get paymentsDetails => _paymentDetails;
RequestDetails get requestsDetails => _requestDetails;
......
......@@ -676,7 +676,7 @@ class Requestionlistprovider extends ChangeNotifier {
child: Column(
children: [
Expanded(
flex: 1,
flex: 2,
child: SizedBox(
height: 40,
child: Row(
......@@ -712,7 +712,7 @@ class Requestionlistprovider extends ChangeNotifier {
),
),
Expanded(
flex: 3,
flex: 4,
child: CupertinoDatePicker(
dateOrder: DatePickerDateOrder.dmy,
initialDateTime: _date ?? DateTime.now(),
......
......@@ -29,6 +29,8 @@ import 'package:share_plus/share_plus.dart';
import 'package:printing/printing.dart';
class Paymentreceiptsprovider extends ChangeNotifier {
bool _showMoreDetails = false;
List<ReceiptsList> _receiptsList = [];
ReceiptDetails _receiptDetails = ReceiptDetails();
List<String> _headings = [];
......@@ -83,6 +85,7 @@ class Paymentreceiptsprovider extends ChangeNotifier {
String _receiptPaymentModesID = "";
String _receiptPaymentModesValues = "";
bool get showMoreDetails => _showMoreDetails;
List<Accounts> get receiptAccounts => _receiptAccounts;
List<ReceiptAccounts> get receiptPaymentAccounts => _receiptPaymentAccounts;
......@@ -110,6 +113,10 @@ class Paymentreceiptsprovider extends ChangeNotifier {
// Date picker methods
set showMoreDetails(bool value){
_showMoreDetails = value;
notifyListeners();
}
set selectreceiptAccounts(Accounts? value) {
_selectedreceiptAccounts = value;
_receiptAccountID = value!.id!;
......@@ -945,7 +952,7 @@ class Paymentreceiptsprovider extends ChangeNotifier {
child: Column(
children: [
Expanded(
flex: 1,
flex: 2,
child: SizedBox(
height: 40,
child: Row(
......@@ -982,7 +989,7 @@ class Paymentreceiptsprovider extends ChangeNotifier {
),
),
Expanded(
flex: 3,
flex: 4,
child: CupertinoDatePicker(
dateOrder: DatePickerDateOrder.dmy,
initialDateTime: _date ?? DateTime.now(),
......
......@@ -19,6 +19,8 @@ import 'package:provider/provider.dart';
import '../../Utils/commonServices.dart';
class Paymentrequisitionpaymentslistprovider extends ChangeNotifier{
bool _showMoreDetails = false;
List<PaymentsList> _paymentsList = [];
PaymentDetails _paymentDetails = PaymentDetails();
List<String> _headings = [];
......@@ -29,6 +31,12 @@ class Paymentrequisitionpaymentslistprovider extends ChangeNotifier{
List<String> get Headings => _headings;
List<String> get subHeadings => _subHeadings;
bool get isLoading => _isLoading;
bool get showMoreDetails => _showMoreDetails;
set showMoreDetails(bool value){
_showMoreDetails = value;
notifyListeners();
}
Future<void> paymentsListAPI(context,from,to) async {
try{
......
......@@ -150,7 +150,7 @@ set isLoading(bool value){
if (password.isEmpty) {
_passwordError = "Please enter your password";
}
_isLoading = false;
notifyListeners();
return _emailError.isEmpty && _passwordError.isEmpty;
}
......@@ -199,15 +199,23 @@ set isLoading(bool value){
);
notifyListeners();
} else if (data.error == 1) {
_isLoading = false;
notifyListeners();
toast(context,
"You are not authorized to login in this device !");
} else if (data.error == 2) {
_isLoading = false;
notifyListeners();
toast(context, "Invalid login credentials !");
} else {
_isLoading = false;
notifyListeners();
toast(context, "Invalid login credentials !");
}
} else {}
} else {
_isLoading = false;
notifyListeners();
}
} on Exception catch (e) {
debugPrint("$e");
}
......
......@@ -1565,7 +1565,7 @@ class Addorderprovider extends ChangeNotifier {
child: Column(
children: [
Expanded(
flex: 1,
flex: 2,
child: SizedBox(
height: 40,
child: Row(
......@@ -1595,7 +1595,7 @@ class Addorderprovider extends ChangeNotifier {
),
),
Expanded(
flex: 3,
flex: 4,
child: CupertinoDatePicker(
dateOrder: DatePickerDateOrder.dmy,
initialDateTime: _date ?? DateTime.now(),
......
......@@ -603,7 +603,7 @@ class Addpaymentprovider extends ChangeNotifier{
child: Column(
children: [
Expanded(
flex: 1,
flex: 2,
child: SizedBox(
height: 40,
child: Row(
......@@ -633,7 +633,7 @@ class Addpaymentprovider extends ChangeNotifier{
),
),
Expanded(
flex: 3,
flex: 4,
child: CupertinoDatePicker(
dateOrder: DatePickerDateOrder.dmy,
initialDateTime: _date ?? DateTime.now(),
......
......@@ -5,6 +5,7 @@ import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:generp/Utils/commonWidgets.dart';
import '../Utils/commonServices.dart';
......@@ -209,11 +210,22 @@ class _MyHomePageState extends State<MyHomePage> {
toolbarHeight: 0,
backgroundColor: Colors.white,
),
body: SizedBox(
body: Container(
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
AppColors.scaffold_bg_color,
AppColors.scaffold_bg_color,
Color(0xFFCEEDFF),
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
),
child: Column(
children: [
Expanded(
flex: 3,
flex: 4,
child: InkResponse(
onTap: () {
_showProfileBottomSheet(
......@@ -394,20 +406,8 @@ class _MyHomePageState extends State<MyHomePage> {
),
),
Expanded(
flex: 12,
child: Container(
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
AppColors.scaffold_bg_color,
AppColors.scaffold_bg_color,
Color(0xFFCEEDFF),
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
),
flex: 13,
child: SizedBox(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
......@@ -1400,10 +1400,24 @@ class _MyHomePageState extends State<MyHomePage> {
),
),
],
],
),
),
),
Align(
alignment: Alignment.bottomCenter,
child: Container(
height: 40,
alignment: Alignment.bottomCenter,
margin: EdgeInsets.only(bottom: 20),
child: Image.asset(
fit: BoxFit.scaleDown,
"assets/images/horizontal_logo.png",
),
),
),
// Expanded(
// flex: 10,
// child: Container(
......@@ -1623,16 +1637,8 @@ class _MyHomePageState extends State<MyHomePage> {
],
),
),
floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
floatingActionButton: Container(
height: 40,
alignment: Alignment.bottomCenter,
margin: EdgeInsets.only(bottom: 20),
child: Image.asset(
fit: BoxFit.scaleDown,
"assets/images/horizontal_logo.png",
),
),
// floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
// floatingActionButton:
),
),
),
......
......@@ -323,20 +323,31 @@ class _LoginScreenState extends State<LoginScreen>
15,
0,
),
child: TextField(
child: TextFormField(
controller: email,
keyboardType:
TextInputType.emailAddress,
minLines: 1,
autofocus: true,
focusNode: _emailFocusNode,
style: TextStyle(fontSize: 14),
onChanged: (value) {
loginProv.updateEmail(email.text);
},
textInputAction: TextInputAction.next,
onTapOutside: (event) {
// Handle onTapOutside
FocusScope.of(context).unfocus();
},
onEditingComplete: () {
if (_emailFocusNode.hasFocus) {
setState(() {
_emailFocusNode.unfocus();
_passwordFocusNode
.requestFocus();
});
}
},
decoration: InputDecoration(
isDense: true,
hintStyle: TextStyle(
......@@ -358,12 +369,12 @@ class _LoginScreenState extends State<LoginScreen>
margin: EdgeInsets.only(
top: 2.5,
bottom: 2.5,
left: 25,
left: 10,
),
child: Text(
loginProv.emailError,
textAlign: TextAlign.start,
style: TextStyle(color: Colors.red),
style: TextStyle(color: Colors.red,fontSize: 10,),
),
),
] else ...[
......@@ -410,12 +421,13 @@ class _LoginScreenState extends State<LoginScreen>
0,
0,
),
child: TextField(
child: TextFormField(
controller: password,
focusNode: _passwordFocusNode,
obscureText: !loginProv.pwdVisible,
keyboardType:
TextInputType.visiblePassword,
textInputAction: TextInputAction.done,
style: TextStyle(fontSize: 14),
onChanged: (value) {
loginProv.updatePassword(
......@@ -423,6 +435,19 @@ class _LoginScreenState extends State<LoginScreen>
);
},
onEditingComplete: () {},
onFieldSubmitted: (value) {
loginProv.isLoading = true;
loginProv.LoginApiFunction(
context,
email.text,
password.text,
);
var f = FocusScope.of(context);
if (!f.hasPrimaryFocus) {
f.unfocus();
}
},
decoration: InputDecoration(
contentPadding: EdgeInsets.fromLTRB(
0,
......@@ -467,19 +492,22 @@ class _LoginScreenState extends State<LoginScreen>
margin: EdgeInsets.only(
top: 2.5,
bottom: 2.5,
left: 25,
left: 10,
),
child: Text(
loginProv.passwordError,
textAlign: TextAlign.start,
style: TextStyle(color: Colors.red),
style: TextStyle(
color: Colors.red,
fontSize: 10,
),
),
),
] else ...[
SizedBox(height: 25.0),
SizedBox(height: 15.0),
],
Container(
child: InkWell(
SizedBox(height: 10,),
InkWell(
onTap:
loginProv.isLoading
? null
......@@ -543,7 +571,6 @@ class _LoginScreenState extends State<LoginScreen>
),
),
),
),
],
),
),
......@@ -763,9 +790,15 @@ class LogoWidget extends StatelessWidget {
return Container(
width: MediaQuery.of(context).size.width / 4.5,
height: MediaQuery.of(context).size.width / 4.5,
padding: imagePath == "assets/images/logo_7.png"?EdgeInsets.symmetric(horizontal: 5):null,
padding:
imagePath == "assets/images/logo_7.png"
? EdgeInsets.symmetric(horizontal: 5)
: null,
decoration: BoxDecoration(
color: imagePath == "assets/images/logo_7.png"?Colors.white:Colors.transparent,
color:
imagePath == "assets/images/logo_7.png"
? Colors.white
: Colors.transparent,
borderRadius: BorderRadius.circular(25),
image: DecorationImage(
image: AssetImage(imagePath),
......
......@@ -143,7 +143,7 @@ class _AccountledgerState extends State<Accountledger> {
}
return Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar2(
appBar: appbar2New(
context,
"Account Ledger List",
provider.resetAll,
......@@ -184,6 +184,7 @@ class _AccountledgerState extends State<Accountledger> {
),
],
),
0xFFFFFFFF
),
backgroundColor: AppColors.scaffold_bg_color,
body:
......
......@@ -27,7 +27,8 @@ class Addcommonpayment extends StatefulWidget {
class _AddcommonpaymentState extends State<Addcommonpayment> {
Dropdowntheme ddtheme = Dropdowntheme();
int _currentStep = 0;
final _formKey = GlobalKey<FormState>();
List<FocusNode> focusNodes = List.generate(20, (index) => FocusNode());
Map _source = {ConnectivityResult.mobile: true};
final MyConnectivity _connectivity = MyConnectivity.instance;
......@@ -46,13 +47,49 @@ class _AddcommonpaymentState extends State<Addcommonpayment> {
});
}
void _nextStep() {
if (_formKey.currentState!.validate()) {
if (_currentStep < 3) {
setState(() {
_currentStep += 1;
});
} else {
// Submit form data
_submitForm();
}
}
}
void _previousStep() {
if (_currentStep > 0) {
setState(() {
_currentStep -= 1;
});
}
}
void _submitForm() {
print('Form Submitted:');
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('Form submitted successfully!')),
);
}
@override
void dispose() {
focusNodes.map((e) => e.dispose());
super.dispose();
_connectivity.disposeStream();
}
Future<bool> onBackPressed(BuildContext context) async {
if (_currentStep > 0) {
_previousStep();
return false;
} else {
return true;
}
}
@override
Widget build(BuildContext context) {
switch (_source.keys.toList()[0]) {
......@@ -81,6 +118,1076 @@ class _AddcommonpaymentState extends State<Addcommonpayment> {
}
Widget _scaffold(BuildContext context) {
return Consumer<Accountslistprovider>(
builder: (context, provider, child) {
return Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar2New(
context,
"Add Account",
provider.resetValues,
SizedBox.shrink(),
0xFFFFFFFF
),
backgroundColor: AppColors.scaffold_bg_color,
body: Form(
canPop: _currentStep == 0,
key: _formKey,
child: Stepper(
margin: EdgeInsets.symmetric(horizontal: 0, vertical: 0),
type: StepperType.horizontal,
currentStep: _currentStep,
onStepContinue: _nextStep,
onStepCancel: _previousStep,
onStepTapped: (value) {
print(value);
// setState(() {
//
// if(value==0){
// _currentStep = value;
// }
// if(_currentStep==1 && value==0){
// _currentStep = value;
// }
// if(_currentStep==2 && value == 1){
// _currentStep = value;
// }
// if (value == 1) {
// if(provider.validateStep1()){
// _currentStep = value;
// }
//
// } else if (value == 2) {
// if(provider.validateStep2()){
// _currentStep = value;
// }
//
// }
// else {
// _currentStep = value;
// }
// });
setState(() {
if (value == 1 && !provider.validateStep1()) {
return;
}
if (value == 2 && !provider.validateStep2()) {
return;
}
if (value < _currentStep) {
_currentStep = value;
} else if (value > _currentStep) {
_currentStep = value;
}
});
},
connectorColor: WidgetStatePropertyAll(AppColors.app_blue),
stepIconBuilder: (stepIndex, stepState) {
return CircleAvatar(
radius: 12,
backgroundColor:
stepIndex <= _currentStep
? AppColors.app_blue
: Colors.grey[300],
);
},
steps: [
Step(
label: Text("Step 1", style: TextStyle(fontSize: 12)),
title: const Text(''),
isActive: _currentStep >= 0,
content: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin:EdgeInsets.only(bottom: 5),
child: Text(
"Account Details",
style: TextStyle(
color: AppColors.app_blue,
fontSize: 16,
fontFamily: "JakartaMedium",
),
),
),
Container(
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 10),
Text("Account"),
DropdownButtonHideUnderline(
child: Row(
children: [
Expanded(
child: DropdownButton2<String>(
isExpanded: true,
hint: const Row(
children: [
Expanded(
child: Text(
'Select Account',
style: TextStyle(fontSize: 14),
overflow: TextOverflow.ellipsis,
),
),
],
),
items:
provider.accountTypes
.map(
(act) => DropdownMenuItem<String>(
value: act,
child: Text(
act,
style: const TextStyle(
fontSize: 14,
),
overflow: TextOverflow.ellipsis,
),
),
)
.toList(),
// value: provider.selectedAccountType,
value:
provider.accountTypes.contains(
provider.selectedAccountType,
)
? provider.selectedAccountType
: null,
onChanged: (value) {
if (value != null) {
provider.selectedAccountType = value;
print(
"statusId:${provider.selectedAccountType}",
);
}
},
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
),
),
],
),
),
errorWidget(context, provider.accountError),
textControllerWidget(
context,
provider.nameController,
"Company Name",
"Enter Company Name",
(p0) {
provider.updateName(p0);
provider.checkInputsAPI(
context,
"name",
provider.nameController.text,
);
},
TextInputType.text,
false,
null,
focusNodes[0],
focusNodes[1],
TextInputAction.next,
),
errorWidget(context, provider.nameError),
textControllerWidget(
context,
provider.mobileController,
"Mobile Number",
"Enter Mobile",
(p0) {
provider.updateMobile(p0);
provider.checkInputsAPI(
context,
"mob1",
provider.mobileController.text,
);
},
TextInputType.phone,
false,
FilteringTextInputFormatter.digitsOnly,
focusNodes[1],
focusNodes[2],
TextInputAction.next,
10,
),
errorWidget(context, provider.mobileError),
textControllerWidget(
context,
provider.contactPersonController,
"Contact Person Name",
"Enter Contact Person Name",
provider.updateContactPerson,
TextInputType.text,
false,
null,
focusNodes[12],
focusNodes[13],
TextInputAction.next,
),
errorWidget(context, provider.contactPersonError),
],
),
),
],
),
),
Step(
label: Text("Step 2", style: TextStyle(fontSize: 12)),
title: const Text(''),
isActive: _currentStep >= 1,
content:Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin:EdgeInsets.only(bottom: 10),
child: Text(
"Address Details",
style: TextStyle(
color: AppColors.app_blue,
fontSize: 16,
fontFamily: "JakartaMedium",
),
),
),
Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("State"),
DropdownButtonHideUnderline(
child: Row(
children: [
Expanded(
child: DropdownButton2<States>(
focusNode: focusNodes[2],
autofocus:
focusNodes[2].hasFocus
? true
: false,
isExpanded: true,
hint: Text(
'Select State',
style: TextStyle(fontSize: 14),
overflow: TextOverflow.ellipsis,
),
items:
provider.states
.map(
(
states,
) => DropdownMenuItem<
States
>(
value: states,
child: Text(
states.name ?? '',
style:
const TextStyle(
fontSize: 14,
),
overflow:
TextOverflow
.ellipsis,
),
),
)
.toList(),
value:
provider.states.contains(
provider.selectedState,
)
? provider.selectedState
: null,
// value: provider.selectedState,
onChanged: (States? value) {
if (value != null) {
if (provider
.states
.isNotEmpty) {
provider.selectedState =
value;
print(
"Selected Complaint Type: ${value.name}, ID: ${value.id}",
);
provider.selectedStateID =
value.id!;
print(
"hfjkshfg" +
provider.selectedStateID
.toString(),
);
if (provider
.selectedDistricts !=
null) {
provider.states.clear();
// provider.selectedDistricts = null;
provider.selectedDistrictId =
null;
provider.selectedDistrictValue =
null;
}
provider.getDistrictAPI(
context,
provider.selectedStateID,
);
}
}
},
dropdownSearchData: DropdownSearchData(
searchInnerWidgetHeight: 50,
searchController:
provider
.stateSearchController,
searchInnerWidget: Padding(
padding: const EdgeInsets.all(
8,
),
child: TextFormField(
controller:
provider
.stateSearchController,
decoration: InputDecoration(
isDense: true,
contentPadding:
const EdgeInsets.symmetric(
horizontal: 10,
vertical: 8,
),
hintText:
'Search States...',
border: OutlineInputBorder(
borderRadius:
BorderRadius.circular(
8,
),
),
),
),
),
searchMatchFn: (
item,
searchValue,
) {
return item.value?.name
?.toLowerCase()
.contains(
searchValue
.toLowerCase(),
) ??
false;
},
),
onMenuStateChange: (isOpen) {
if (!isOpen) {
provider.stateSearchController
.clear();
}
},
buttonStyleData:
ddtheme.buttonStyleData,
iconStyleData:
ddtheme.iconStyleData,
menuItemStyleData:
ddtheme.menuItemStyleData,
dropdownStyleData:
ddtheme.dropdownStyleData,
),
),
],
),
),
errorWidget(context, provider.stateError),
Text("District"),
DropdownButtonHideUnderline(
child: Row(
children: [
Expanded(
child: DropdownButton2<Districts>(
focusNode: focusNodes[3],
isExpanded: true,
hint: Text(
'Select District',
style: TextStyle(fontSize: 14),
overflow: TextOverflow.ellipsis,
),
items:
provider.districts
.map(
(
dist,
) => DropdownMenuItem<
Districts
>(
value: dist,
child: Text(
dist.district ?? '',
style:
const TextStyle(
fontSize: 14,
),
overflow:
TextOverflow
.ellipsis,
),
),
)
.toList(),
value:
provider.districts.contains(
provider
.selectedDistricts,
)
? provider.selectedDistricts
: null,
// value: provider.selectedDistricts,
onChanged: (Districts? value) {
if (value != null) {
if (provider
.districts
.isNotEmpty) {
provider.selectedDistricts =
value;
print(
"Selected ID: ${value.id}",
);
provider.selectedDistrictId =
value.id!;
provider.selectedDistrictValue =
value.district!;
print(
"hfjkshfg" +
provider
.selectedDistrictId
.toString(),
);
if (provider
.selectedSubLocations !=
null) {
// provider.selectedSubLocations =
// null;
provider.selectedSubLocID =
null;
provider.selectedSubLocValue =
null;
}
provider.getSubLocationAPI(
context,
provider.selectedDistrictId,
);
}
}
},
dropdownSearchData: DropdownSearchData(
searchInnerWidgetHeight: 50,
searchController:
provider
.districtSearchController,
searchInnerWidget: Padding(
padding: const EdgeInsets.all(
8,
),
child: TextFormField(
controller:
provider
.districtSearchController,
decoration: InputDecoration(
isDense: true,
contentPadding:
const EdgeInsets.symmetric(
horizontal: 10,
vertical: 8,
),
hintText:
'Search Districts...',
border: OutlineInputBorder(
borderRadius:
BorderRadius.circular(
8,
),
),
),
),
),
searchMatchFn: (
item,
searchValue,
) {
return item.value?.district
?.toLowerCase()
.contains(
searchValue
.toLowerCase(),
) ??
false;
},
),
onMenuStateChange: (isOpen) {
if (!isOpen) {
provider
.districtSearchController
.clear();
}
},
buttonStyleData:
ddtheme.buttonStyleData,
iconStyleData:
ddtheme.iconStyleData,
menuItemStyleData:
ddtheme.menuItemStyleData,
dropdownStyleData:
ddtheme.dropdownStyleData,
),
),
],
),
),
errorWidget(context, provider.districtError),
Text("Sub Locality"),
DropdownButtonHideUnderline(
child: Row(
children: [
Expanded(
child: DropdownButton2<SubLocations>(
focusNode: focusNodes[4],
isExpanded: true,
hint: Text(
'Select Sub Locality',
style: TextStyle(fontSize: 14),
overflow: TextOverflow.ellipsis,
),
items:
provider.subLocations
.map(
(
subloc,
) => DropdownMenuItem<
SubLocations
>(
value: subloc,
child: Text(
subloc.subLocality ??
'',
style:
const TextStyle(
fontSize: 14,
),
overflow:
TextOverflow
.ellipsis,
),
),
)
.toList(),
// value: provider.selectedSubLocations,
value:
provider.subLocations.contains(
provider
.selectedSubLocations,
)
? provider
.selectedSubLocations
: null,
onChanged: (SubLocations? value) {
if (value != null) {
if (provider
.subLocations
.isNotEmpty) {
provider.selectedSubLocations =
value;
print(
"Selected ID: ${value.id}",
);
provider.selectedSubLocID =
value.id!;
provider.selectedSubLocValue =
value.subLocality!;
print(
"hfjkshfg" +
provider
.selectedSubLocID
.toString(),
);
}
}
},
dropdownSearchData: DropdownSearchData(
searchInnerWidgetHeight: 50,
searchController:
provider
.subLocSearchController,
searchInnerWidget: Padding(
padding: const EdgeInsets.all(
8,
),
child: TextFormField(
controller:
provider
.subLocSearchController,
decoration: InputDecoration(
isDense: true,
contentPadding:
const EdgeInsets.symmetric(
horizontal: 10,
vertical: 8,
),
hintText:
'Search Sub Locality...',
border: OutlineInputBorder(
borderRadius:
BorderRadius.circular(
8,
),
),
),
),
),
searchMatchFn: (
item,
searchValue,
) {
return item.value?.subLocality
?.toLowerCase()
.contains(
searchValue
.toLowerCase(),
) ??
false;
},
),
onMenuStateChange: (isOpen) {
if (!isOpen) {
provider.subLocSearchController
.clear();
}
},
buttonStyleData:
ddtheme.buttonStyleData,
iconStyleData:
ddtheme.iconStyleData,
menuItemStyleData:
ddtheme.menuItemStyleData,
dropdownStyleData:
ddtheme.dropdownStyleData,
),
),
],
),
),
errorWidget(context, provider.localityError),
textControllerWidget(
context,
provider.addressController,
"Address",
"Enter Address",
provider.updateAddress,
TextInputType.text,
false,
null,
focusNodes[5],
null,
TextInputAction.done,
),
errorWidget(context, provider.addressError),
],
),
),
],
),
),
Step(
label: Text("Step 3", style: TextStyle(fontSize: 12)),
title: const Text(''),
isActive: _currentStep >= 1,
content:Column( crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin:EdgeInsets.only(bottom: 10),
child: Text(
"Bank Details",
style: TextStyle(
color: AppColors.app_blue,
fontSize: 16,
fontFamily: "JakartaMedium",
),
),
),
Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
textControllerWidget(
context,
provider.bankNameController,
"Bank Name",
"Enter Bank Name",
provider.updateBankName,
TextInputType.text,
false,
null,
focusNodes[6],
focusNodes[7],
TextInputAction.next,
),
errorWidget(context, provider.banknameError),
textControllerWidget(
context,
provider.branchNameController,
"Bank Branch",
"Enter Bank Branch",
provider.updateBankBranch,
TextInputType.text,
false,
null,
focusNodes[7],
focusNodes[8],
TextInputAction.next,
),
errorWidget(
context,
provider.bankBranchError,
),
textControllerWidget(
context,
provider.bankIfscCotroller,
"Bank IFSC",
"Enter Bank IFSC",
provider.updateIFSC,
TextInputType.text,
false,
null,
focusNodes[8],
focusNodes[9],
TextInputAction.next,
),
errorWidget(context, provider.bankIFSCError),
textControllerWidget(
context,
provider.bankHolderNameController,
"Bank Holder Name",
"Enter Bank Holder Name",
provider.updateHolder,
TextInputType.text,
false,
null,
focusNodes[9],
focusNodes[10],
TextInputAction.next,
),
errorWidget(
context,
provider.bankHolderNameError,
),
textControllerWidget(
context,
provider.bankAcNumberController,
"Bank Account Number",
"Enter Bank Account Number",
provider.updateNumber,
TextInputType.number,
false,
FilteringTextInputFormatter.digitsOnly,
focusNodes[10],
focusNodes[11],
TextInputAction.next,
),
errorWidget(
context,
provider.bankAcNumberError,
),
textControllerWidget(
context,
provider.bankUpiController,
"Bank UPI ID",
"Enter Bank UPI ID",
provider.updateUPI,
TextInputType.text,
false,
null,
focusNodes[11],
focusNodes[12],
TextInputAction.next,
),
errorWidget(context, provider.upiError),
],
),
),
],
),
),
Step(
label: Text("Step 4", style: TextStyle(fontSize: 12)),
title: const Text(''),
isActive: _currentStep >= 2,
content: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin:EdgeInsets.only(bottom: 10),
child: Text(
"Contact Details",
style: TextStyle(
color: AppColors.app_blue,
fontSize: 16,
fontFamily: "JakartaMedium",
),
),
),
Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
textControllerWidget(
context,
provider.contectPersonDesignationController,
"Contact Person Designation",
"Enter Contact Person Designation",
provider.updateDesignation,
TextInputType.text,
false,
null,
focusNodes[13],
focusNodes[14],
TextInputAction.next,
),
errorWidget(
context,
provider.desigantionError,
),
textControllerWidget(
context,
provider.contectPersonAltMobController,
"Alternative Mobile Number",
"Enter Alternative Mobile Number",
(p0) {
provider.updateAltMobile(p0);
provider.checkInputsAPI(
context,
"mob2",
provider
.contectPersonAltMobController
.text,
);
},
TextInputType.number,
false,
FilteringTextInputFormatter.digitsOnly,
focusNodes[14],
focusNodes[15],
TextInputAction.next,
10,
),
errorWidget(context, provider.altMobError),
textControllerWidget(
context,
provider.contectPersonTeleController,
"Telephone Number",
"Enter Telephone Number",
provider.updateTeleMobile,
TextInputType.number,
false,
FilteringTextInputFormatter.digitsOnly,
focusNodes[15],
focusNodes[16],
TextInputAction.next,
),
errorWidget(context, provider.teleError),
textControllerWidget(
context,
provider.contectPersonMailController,
"Customer Mail ID",
"Enter Customer Mail ID",
provider.updateMail,
TextInputType.text,
false,
null,
focusNodes[16],
focusNodes[17],
TextInputAction.next,
),
errorWidget(context, provider.mailError),
],
),
),
],
),
),
],
controlsBuilder: (context, details) {
return Column(
children: [
if (_currentStep == 3) ...[
InkResponse(
onTap: provider.submitClickced
? null: () {
if (provider.validateStep4()) {
provider.submitClickced = true;
provider.submitCommonAccountsAPI(context, widget.from);
}
details.onStepContinue;
},
child: Container(
height: 45,
alignment: Alignment.center,
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
decoration: BoxDecoration(
color: AppColors.app_blue,
borderRadius: BorderRadius.circular(15),
),
child: Text(
"Submit",
style: TextStyle(
fontSize: 15,
fontFamily: "JakartaMedium",
color: Colors.white,
),
),
),
),
] else ...[
InkResponse(
onTap: () {
setState(() {
if (_currentStep == 0) {
if (provider.validateStep1()) {
_currentStep = 1;
}
} else if (_currentStep == 1) {
if (provider.validateStep2()) {
_currentStep = 2;
}
}else if (_currentStep == 2) {
if (provider.validateStep3()) {
_currentStep = 3;
}
}
else {
_currentStep = 0;
}
});
details.onStepContinue;
},
child: Container(
height: 45,
alignment: Alignment.center,
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
decoration: BoxDecoration(
color: AppColors.app_blue,
borderRadius: BorderRadius.circular(15),
),
child: Text(
"Proceed to Next Step",
textAlign: TextAlign.start,
style: TextStyle(
fontSize: 15,
fontFamily: "JakartaMedium",
color: Colors.white,
),
),
),
),
],
if (_currentStep > 0) ...[
TextButton(
onPressed: () {
setState(() {
if (_currentStep == 3) {
_currentStep = 2;
}
if (_currentStep == 2) {
_currentStep = 1;
} else if (_currentStep == 1) {
_currentStep = 0;
} else {
_currentStep = 3;
}
});
details.onStepCancel;
},
child: Text(
'Back',
style: TextStyle(
color: AppColors.app_blue,
fontSize: 14,
),
),
),
],
],
);
},
),
),
);
},
);
}
Widget _scaffold1(BuildContext context) {
return Consumer<Accountslistprovider>(
builder: (context, provider, child) {
return Scaffold(
......
......@@ -61,6 +61,7 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> {
context,
listen: false,
);
provider.showMoreDetails = false;
provider.crmLeadDetailsAPIFunction(context, widget.leadId, widget.mode);
});
}
......@@ -1566,7 +1567,7 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> {
CrossAxisAlignment.start,
children: [
Expanded(
flex:3,
flex: 3,
child: Text(
textAlign: TextAlign.left,
"Feedback",
......@@ -1580,7 +1581,7 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> {
),
),
Expanded(
flex:7,
flex: 7,
child: Text(
textAlign: TextAlign.right,
provider
......@@ -1799,33 +1800,45 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> {
),
),
),
if(provider
if (provider
.appointmentDetails[lp]
.astatus=="No")...[
.astatus ==
"No") ...[
Expanded(
flex: 2,
child: Container(
height: 45,
padding: EdgeInsets.symmetric(horizontal: 5),
padding:
EdgeInsets.symmetric(
horizontal: 5,
),
decoration: BoxDecoration(
color: AppColors.processed_bg_color,
borderRadius: BorderRadius.circular(8)
color:
AppColors
.processed_bg_color,
borderRadius:
BorderRadius.circular(
8,
),
),
child: Center(
child: Text(
"Pending",
textAlign: TextAlign.right,
textAlign:
TextAlign.right,
style: TextStyle(
fontFamily: "JakartaMedium",
fontFamily:
"JakartaMedium",
fontSize: 14,
color: AppColors.processed_text_color,
color:
AppColors
.processed_text_color,
),
),
),
),
),
]
],
],
),
Container(
......@@ -3297,13 +3310,15 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> {
),
],
),
// Text(
// "Note: Submit Quantity as Zero (0) to delete Product",
// style: TextStyle(
// color: AppColors.app_blue,
// fontSize: 12,
// ),
// ),
if (type != "add") ...[
Text(
"Note: Submit Quantity as Zero (0) to delete Product",
style: TextStyle(
color: AppColors.app_blue,
fontSize: 12,
),
),
],
if (editProvider.qtyError != null) ...[
errorWidget(context, editProvider.qtyError),
],
......
......@@ -74,6 +74,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
context,
widget.leadId,
);
provider.showMoreDetails = false;
provider.crmProspectDetailsAPIFunction(context, widget.leadId);
});
}
......
import 'dart:io';
import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:dotted_line/dotted_line.dart';
import 'package:dropdown_button2/dropdown_button2.dart';
import 'package:flutter/material.dart';
......@@ -31,7 +32,8 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
Dropdowntheme ddtheme = Dropdowntheme();
int _currentStep = 0;
final _formKey = GlobalKey<FormState>();
Map _source = {ConnectivityResult.mobile: true};
final MyConnectivity _connectivity = MyConnectivity.instance;
// Controllers to store form data
final _nameController = TextEditingController();
final _emailController = TextEditingController();
......@@ -76,10 +78,21 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
const SnackBar(content: Text('Form submitted successfully!')),
);
}
Future<bool> onBackPressed(BuildContext context) async {
if (_currentStep > 0) {
_previousStep();
return false;
} else {
return true;
}
}
@override
void initState() {
super.initState();
_connectivity.initialise();
_connectivity.myStream.listen((source) {
setState(() => _source = source);
});
WidgetsBinding.instance.addPostFrameCallback((_) async {
final provider = Provider.of<Addnewleadsandprospectsprovider>(
context,
......@@ -92,14 +105,35 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
@override
Widget build(BuildContext context) {
switch (_source.keys.toList()[0]) {
case ConnectivityResult.mobile:
connection = 'Online';
break;
case ConnectivityResult.wifi:
connection = 'Online';
break;
case ConnectivityResult.none:
default:
connection = 'Offline';
}
return (connection == "Online")
? Platform.isAndroid
? WillPopScope(
onWillPop: () => onBackPressed(context),
child: SafeArea(
top: false,
bottom: true,
child: _scaffold(context),
),
)
: _scaffold(context)
: NoNetwork(context);
}
Widget _scaffold(BuildContext context) {
return Consumer<Addnewleadsandprospectsprovider>(
builder: (context, provider, child) {
return WillPopScope(
onWillPop: () async {
provider.resetForm();
return true;
},
child: SafeArea(
return SafeArea(
top: false,
bottom: Platform.isIOS ? false : true,
child: Scaffold(
......@@ -384,7 +418,11 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
),
)
.toList(),
value: provider.selectedSources,
// value: provider.selectedSources,
value: provider.sourcesList.isNotEmpty?provider.selectedSources!=null?
provider.sourcesList.firstWhere((element) => element.id==provider.selectedSourcesId,
orElse: () => provider.sourcesList[0],
):null:null,
onChanged: (Sources? value) {
if (value != null) {
if (provider.sourcesList.isNotEmpty) {
......@@ -393,6 +431,13 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
value!.id!;
provider.selectedSourcesValue =
value!.name!;
if(provider.referencesList.isNotEmpty){
provider.referencesList.clear();
provider.selectedReferenceId = null;
provider.selectedReferenceValue = null;
}
provider
.crmLeadListSourceOnReferenceAPIFunction(
context,
......@@ -441,7 +486,11 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
),
)
.toList(),
value: provider.selectedReference,
// value: provider.selectedReference,
value: provider.referencesList.isNotEmpty?provider.selectedReference!=null?
provider.referencesList.firstWhere((element) => element.id==provider.selectedReferenceId,
orElse: () => provider.referencesList[0],
):null:null,
onChanged: (References? value) {
if (value != null) {
if (provider
......@@ -493,7 +542,11 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
),
)
.toList(),
value: provider.selectedTeams,
// value: provider.selectedTeams,
value: provider.teamsList.isNotEmpty?provider.selectedTeams!=null?
provider.teamsList.firstWhere((element) => element.id==provider.selectedTeamsId,
orElse: () => provider.teamsList[0],
):null:null,
onChanged: (Teams? value) {
if (value != null) {
if (provider.teamsList.isNotEmpty) {
......@@ -502,6 +555,12 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
value!.id!;
provider.selectedTeamsValue =
value!.name!;
if(provider.segmentsList.isNotEmpty){
provider.segmentsList.clear();
provider.selectedSegmentId = null;
provider.selectedSegmentValue = null;
}
provider
.crmLeadListSegmentOnTeamAPIFunction(
context,
......@@ -549,7 +608,11 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
),
)
.toList(),
value: provider.selectedSegment,
// value: provider.selectedSegment,
value: provider.segmentsList.isNotEmpty?provider.selectedSegment!=null?
provider.segmentsList.firstWhere((element) => element.id==provider.selectedSegmentId,
orElse: () => provider.segmentsList[0],
):null:null,
onChanged: (Segments? value) {
if (value != null) {
if (provider
......@@ -1362,7 +1425,6 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
),
),
),
),
);
},
);
......
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