Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sai Srinivas
GEN_ERP_2025
Commits
c92f4c79
Commit
c92f4c79
authored
Jul 10, 2025
by
Sai Srinivas
Browse files
ios changes in Navigation swipe gestures.
parent
ee178d55
Changes
35
Expand all
Show whitespace changes
Inline
Side-by-side
ios/Podfile.lock
View file @
c92f4c79
PODS:
- app_settings (5.1.1):
- Flutter
- camera_avfoundation (0.0.1):
- Flutter
- connectivity_plus (0.0.1):
...
...
@@ -167,6 +169,7 @@ PODS:
- FlutterMacOS
DEPENDENCIES:
- app_settings (from `.symlinks/plugins/app_settings/ios`)
- camera_avfoundation (from `.symlinks/plugins/camera_avfoundation/ios`)
- connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`)
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
...
...
@@ -219,6 +222,8 @@ SPEC REPOS:
- SDWebImageWebPCoder
EXTERNAL SOURCES:
app_settings:
:path: ".symlinks/plugins/app_settings/ios"
camera_avfoundation:
:path: ".symlinks/plugins/camera_avfoundation/ios"
connectivity_plus:
...
...
@@ -281,6 +286,7 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/webview_flutter_wkwebview/darwin"
SPEC CHECKSUMS:
app_settings: 58017cd26b604ae98c3e65acbdd8ba173703cc82
camera_avfoundation: adb0207d868b2d873e895371d88448399ab78d87
connectivity_plus: 2a701ffec2c0ae28a48cf7540e279787e77c447d
device_info_plus: bf2e3232933866d73fe290f2942f2156cdd10342
...
...
lib/Notifiers/commonProvider/accountsListProvider.dart
View file @
c92f4c79
...
...
@@ -610,6 +610,7 @@ class Accountslistprovider extends ChangeNotifier {
}
resetValues
()
{
print
(
"rv"
);
_selectedAccountType
=
null
;
_selectedState
=
null
;
_selectedDistricts
=
null
;
...
...
lib/Notifiers/financeProvider/RequestionListProvider.dart
View file @
c92f4c79
...
...
@@ -975,6 +975,7 @@ class Requestionlistprovider extends ChangeNotifier {
// }
void
resetForm
()
{
print
(
"ios calling"
);
_submitClicked
=
false
;
accountSearchController
.
clear
();
paymentAccountSearchController
.
clear
();
...
...
lib/Notifiers/financeProvider/paymentReceiptsProvider.dart
View file @
c92f4c79
...
...
@@ -448,10 +448,10 @@ class Paymentreceiptsprovider extends ChangeNotifier {
...
data
.
receiptAccounts
!,
];
_receiptPaymentModes
=
data
.
paymentModes
!;
_receiptPaymentModes
=
[
PaymentModes
(
name:
"Select"
,
id:
""
),...
data
.
paymentModes
!
];
_receiptPaymentModes
=
[
PaymentModes
(
name:
"Select"
,
id:
""
),
...
data
.
paymentModes
!,
];
_receiptAccounts
=
data
.
accounts
!;
_receiptAccounts
=
[
Accounts
(
name:
"Select"
,
id:
""
),
...
...
@@ -709,6 +709,7 @@ class Paymentreceiptsprovider extends ChangeNotifier {
}
void
resetForm
()
{
print
(
"rf"
);
_submitClicked
=
false
;
accountSearchController
.
clear
();
paymentAccountSearchController
.
clear
();
...
...
lib/Utils/GlobalConstants.dart
View file @
c92f4c79
String
didPushed
=
""
;
String
didPopped
=
""
;
String
routeSettingName
=
""
;
lib/Utils/commonWidgets.dart
View file @
c92f4c79
...
...
@@ -208,11 +208,10 @@ NoNetwork(context) {
// Image.asset('assets/images/no_wifi.png', width: 100, height: 100),
SizedBox
(
height:
10
),
Center
(
child:
Text
(
"You are Offline"
,
style:
TextStyle
(
fontSize:
16
,
color:
AppColors
.
semi_black
),),
child:
Text
(
"You are Offline"
,
style:
TextStyle
(
fontSize:
16
,
color:
AppColors
.
semi_black
),
),
),
SizedBox
(
height:
10
),
Text
(
...
...
@@ -306,16 +305,18 @@ class MyNavigatorObserver extends NavigatorObserver {
super
.
didPush
(
route
,
previousRoute
);
// Called when a route has been pushed onto the navigator.
didPushed
=
"true"
;
routeSettingName
=
route
.
settings
.
name
.
toString
();
print
(
'Route pushed:
${route.settings.name}
'
);
print
(
'didPushed
$didPushed
'
);
print
(
'didPushed
:
$didPushed
'
);
}
@override
void
didPop
(
Route
route
,
Route
?
previousRoute
)
{
super
.
didPop
(
route
,
previousRoute
);
didPopped
=
"true"
;
routeSettingName
=
route
.
settings
.
name
.
toString
();
// Called when a route has been popped off the navigator.
print
(
'Route popped:
${route.settings.name}
'
);
print
(
'didPopped
${didPopped}
'
);
print
(
'didPopped
:
${didPopped}
'
);
}
}
lib/screens/commom/accountLedger.dart
View file @
c92f4c79
This diff is collapsed.
Click to expand it.
lib/screens/commom/accountsList.dart
View file @
c92f4c79
import
'dart:io'
;
import
'package:connectivity_plus/connectivity_plus.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:generp/Notifiers/commonProvider/accountsListProvider.dart'
;
import
'package:generp/Utils/app_colors.dart'
;
import
'package:generp/Utils/commonServices.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:generp/screens/commom/accountsListDetails.dart'
;
import
'package:provider/provider.dart'
;
...
...
@@ -20,11 +22,17 @@ class _AccountslistState extends State<Accountslist> {
ScrollController
scrollController
=
ScrollController
();
FocusNode
focusNode1
=
FocusNode
();
FocusNode
focusNode2
=
FocusNode
();
Map
_source
=
{
ConnectivityResult
.
mobile
:
true
};
final
MyConnectivity
_connectivity
=
MyConnectivity
.
instance
;
@override
void
initState
()
{
// TODO: implement initState
super
.
initState
();
_connectivity
.
initialise
();
_connectivity
.
myStream
.
listen
((
source
)
{
setState
(()
=>
_source
=
source
);
});
WidgetsBinding
.
instance
.
addPostFrameCallback
((
timeStamp
)
{
var
provider
=
Provider
.
of
<
Accountslistprovider
>(
context
,
listen:
false
);
provider
.
commonAccountListAPIFunction
(
context
);
...
...
@@ -37,30 +45,54 @@ class _AccountslistState extends State<Accountslist> {
scrollController
.
position
.
maxScrollExtent
*
0.9
&&
!
provider
.
isLoading
&&
provider
.
hasMoreData
)
{
provider
.
commonAccountListAPIFunction
(
context
);
provider
.
commonAccountListAPIFunction
(
context
);
}
});
});
}
@override
@override
void
dispose
()
{
// TODO: implement dispose
super
.
dispose
();
scrollController
.
dispose
();
_connectivity
.
disposeStream
();
}
@override
Widget
build
(
BuildContext
context
)
{
switch
(
_source
.
keys
.
toList
()[
0
])
{
case
ConnectivityResult
.
mobile
:
connection
=
'Online'
;
break
;
case
ConnectivityResult
.
wifi
:
connection
=
'Online'
;
break
;
case
ConnectivityResult
.
none
:
default
:
connection
=
'Offline'
;
}
return
(
connection
==
"Online"
)
?
Platform
.
isAndroid
?
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
SafeArea
(
top:
false
,
bottom:
true
,
child:
_scaffold
(
context
),
),
)
:
_scaffold
(
context
)
:
NoNetwork
(
context
);
}
@override
Widget
_scaffold
(
BuildContext
context
)
{
return
Consumer
<
Accountslistprovider
>(
builder:
(
context
,
provider
,
child
)
{
var
accountList
=
provider
.
accountsList
;
print
(
accountList
.
length
);
return
WillPopScope
(
child:
SafeArea
(
top:
false
,
bottom:
Platform
.
isIOS
?
false
:
true
,
child:
Scaffold
(
return
Scaffold
(
resizeToAvoidBottomInset:
true
,
appBar:
appbar2
(
context
,
...
...
@@ -73,22 +105,19 @@ class _AccountslistState extends State<Accountslist> {
onTap:
()
{
_showFilterSheet
(
context
);
},
child:
SvgPicture
.
asset
(
"assets/svg/filter_ic.svg"
,
height:
18
,
),
child:
SvgPicture
.
asset
(
"assets/svg/filter_ic.svg"
,
height:
18
),
),
),
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
provider
.
isLoading
?
Center
(
body:
provider
.
isLoading
?
Center
(
child:
CircularProgressIndicator
(
valueColor:
AlwaysStoppedAnimation
(
AppColors
.
app_blue
),
),
)
:
accountList
.
isNotEmpty
:
accountList
.
isNotEmpty
?
SizedBox
(
child:
Scrollbar
(
child:
SingleChildScrollView
(
...
...
@@ -96,7 +125,11 @@ class _AccountslistState extends State<Accountslist> {
child:
Column
(
children:
[
ListView
.
builder
(
itemCount:
accountList
.
length
+
(
provider
.
hasMoreData
&&
provider
.
isLoading
?
1
:
0
),
itemCount:
accountList
.
length
+
(
provider
.
hasMoreData
&&
provider
.
isLoading
?
1
:
0
),
shrinkWrap:
true
,
physics:
NeverScrollableScrollPhysics
(),
itemBuilder:
(
context
,
index
)
{
...
...
@@ -112,8 +145,7 @@ class _AccountslistState extends State<Accountslist> {
return
Padding
(
padding:
EdgeInsets
.
all
(
8.0
),
child:
Center
(
child:
CircularProgressIndicator
.
adaptive
(
child:
CircularProgressIndicator
.
adaptive
(
valueColor:
AlwaysStoppedAnimation
<
Color
>(
AppColors
.
app_blue
,
...
...
@@ -171,8 +203,7 @@ class _AccountslistState extends State<Accountslist> {
"JakartaMedium"
,
fontSize:
14
,
color:
AppColors
.
semi_black
,
AppColors
.
semi_black
,
),
),
Text
(
...
...
@@ -183,8 +214,7 @@ class _AccountslistState extends State<Accountslist> {
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
color:
AppColors
.
app_blue
,
color:
AppColors
.
app_blue
,
),
),
],
...
...
@@ -223,11 +253,9 @@ class _AccountslistState extends State<Accountslist> {
child:
Text
(
headings
[
j
],
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
color:
AppColors
.
semi_black
,
color:
AppColors
.
semi_black
,
),
),
),
...
...
@@ -236,11 +264,9 @@ class _AccountslistState extends State<Accountslist> {
child:
Text
(
subHeadings
[
j
]
??
"-"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
color:
AppColors
.
grey_thick
,
color:
AppColors
.
grey_thick
,
),
),
),
...
...
@@ -303,12 +329,6 @@ class _AccountslistState extends State<Accountslist> {
),
)
:
Emptywidget
(
context
),
),
),
onWillPop:
()
{
provider
.
pageNum
=
1
;
return
_onBackPressed
(
context
);
},
);
},
);
...
...
@@ -367,7 +387,7 @@ class _AccountslistState extends State<Accountslist> {
null
,
focusNode1
,
focusNode2
,
TextInputAction
.
next
TextInputAction
.
next
,
),
textControllerWidget
(
context
,
...
...
@@ -381,7 +401,7 @@ class _AccountslistState extends State<Accountslist> {
focusNode2
,
null
,
TextInputAction
.
done
,
10
10
,
),
InkResponse
(
onTap:
()
{
...
...
lib/screens/commom/accountsListDetails.dart
View file @
c92f4c79
import
'dart:io'
;
import
'package:connectivity_plus/connectivity_plus.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:generp/Notifiers/commonProvider/accountDetailsProvider.dart'
;
import
'package:generp/Utils/app_colors.dart'
;
import
'package:generp/Utils/commonServices.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:generp/screens/commom/transactionDetails.dart'
;
import
'package:generp/screens/finance/submitPaymentRequestionListsByMode.dart'
;
...
...
@@ -21,18 +23,58 @@ class Accountslistdetails extends StatefulWidget {
}
class
_AccountslistdetailsState
extends
State
<
Accountslistdetails
>
{
Map
_source
=
{
ConnectivityResult
.
mobile
:
true
};
final
MyConnectivity
_connectivity
=
MyConnectivity
.
instance
;
@override
void
initState
()
{
// TODO: implement initState
super
.
initState
();
_connectivity
.
initialise
();
_connectivity
.
myStream
.
listen
((
source
)
{
setState
(()
=>
_source
=
source
);
});
WidgetsBinding
.
instance
.
addPostFrameCallback
((
timeStamp
)
{
var
prov
=
Provider
.
of
<
Accountdetailsprovider
>(
context
,
listen:
false
);
prov
.
accountdetailsAPIFunction
(
context
,
widget
.
accountID
);
});
}
@override
void
dispose
()
{
// TODO: implement dispose
super
.
dispose
();
_connectivity
.
disposeStream
();
}
@override
Widget
build
(
BuildContext
context
)
{
switch
(
_source
.
keys
.
toList
()[
0
])
{
case
ConnectivityResult
.
mobile
:
connection
=
'Online'
;
break
;
case
ConnectivityResult
.
wifi
:
connection
=
'Online'
;
break
;
case
ConnectivityResult
.
none
:
default
:
connection
=
'Offline'
;
}
return
(
connection
==
"Online"
)
?
Platform
.
isAndroid
?
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
SafeArea
(
top:
false
,
bottom:
true
,
child:
_scaffold
(
context
),
),
)
:
_scaffold
(
context
)
:
NoNetwork
(
context
);
}
Widget
_scaffold
(
BuildContext
context
)
{
return
Consumer
<
Accountdetailsprovider
>(
builder:
(
context
,
provider
,
child
)
{
final
groupedData
=
provider
.
groupByDate
(
provider
.
ledgerList
);
...
...
@@ -49,11 +91,7 @@ class _AccountslistdetailsState extends State<Accountslistdetails> {
}
overallBalance
=
totalDebit
-
totalCredit
;
return
WillPopScope
(
child:
SafeArea
(
top:
false
,
bottom:
Platform
.
isIOS
?
false
:
true
,
child:
Scaffold
(
return
Scaffold
(
appBar:
appbar2
(
context
,
"Account Details"
,
...
...
@@ -123,9 +161,7 @@ class _AccountslistdetailsState extends State<Accountslistdetails> {
),
Text
(
"credit"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
),
style:
TextStyle
(
color:
Color
(
0xFF818181
)),
),
],
),
...
...
@@ -164,9 +200,7 @@ class _AccountslistdetailsState extends State<Accountslistdetails> {
),
Text
(
"debit"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
),
style:
TextStyle
(
color:
Color
(
0xFF818181
)),
),
],
),
...
...
@@ -184,14 +218,8 @@ class _AccountslistdetailsState extends State<Accountslistdetails> {
// ),
// ),
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
...
...
@@ -223,8 +251,7 @@ class _AccountslistdetailsState extends State<Accountslistdetails> {
provider
.
accountDetails
.
bankIfscCode
??
"-"
,
provider
.
accountDetails
.
bankAccountHolderName
??
"-"
,
provider
.
accountDetails
.
bankAccountNumber
??
"-"
,
provider
.
accountDetails
.
bankAccountNumber
??
"-"
,
provider
.
accountDetails
.
bankUpiId
??
"-"
,
provider
.
accountDetails
.
state
??
"-"
,
provider
.
accountDetails
.
district
??
"-"
,
...
...
@@ -292,8 +319,9 @@ class _AccountslistdetailsState extends State<Accountslistdetails> {
),
...
items
.
map
((
item
)
{
double
running_balance
=
0
;
int
currentIndex
=
provider
.
ledgerList
.
indexOf
(
item
);
int
currentIndex
=
provider
.
ledgerList
.
indexOf
(
item
,
);
for
(
var
i
=
0
;
i
<=
currentIndex
;
i
++)
{
var
ledgerItem
=
provider
.
ledgerList
[
i
];
double
credit
=
...
...
@@ -358,8 +386,7 @@ class _AccountslistdetailsState extends State<Accountslistdetails> {
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontFamily:
"JakartaMedium"
,
fontSize:
12
,
),
),
...
...
@@ -374,20 +401,16 @@ class _AccountslistdetailsState extends State<Accountslistdetails> {
child:
RichText
(
maxLines:
1
,
textAlign:
TextAlign
.
right
,
overflow:
TextOverflow
.
ellipsis
,
overflow:
TextOverflow
.
ellipsis
,
text:
TextSpan
(
children:
[
TextSpan
(
text:
item
.
type
==
"Credit"
item
.
type
==
"Credit"
?
"-"
:
"+"
,
style:
TextStyle
(
color:
Color
(
0xFF2D2D2D
,
),
color:
Color
(
0xFF2D2D2D
),
fontSize:
13
,
fontFamily:
"JakartaRegular"
,
...
...
@@ -397,9 +420,7 @@ class _AccountslistdetailsState extends State<Accountslistdetails> {
text:
"₹
${item.type == "Credit" ? "${item.creditAmount}
"
:
"
${item.debitAmount}
"
}
",
style: TextStyle(
color: Color(
0xFF2D2D2D,
),
color: Color(0xFF2D2D2D),
fontSize: 13,
fontFamily:
"
JakartaMedium
",
...
...
@@ -446,8 +467,7 @@ class _AccountslistdetailsState extends State<Accountslistdetails> {
context,
MaterialPageRoute(
builder:
(context) =>
Transactiondetails(
(context) => Transactiondetails(
paymentID: item.refId,
type: item.type,
),
...
...
@@ -489,19 +509,20 @@ class _AccountslistdetailsState extends State<Accountslistdetails> {
);
},
),
if(["
Vendor
","
Customer
"].contains(provider.accountDetails.type))...[
if ([
"
Vendor
",
"
Customer
",
].contains(provider.accountDetails.type)) ...[
InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
Submitpaymentrequestionlistsbymode(
(context) => Submitpaymentrequestionlistsbymode(
mode: "
other
",
pageTitleName:
"
Add
Payment
Request
(
Other
)
",
accountId:provider.accountDetails.id!
pageTitleName: "
Add
Payment
Request
(
Other
)
",
accountId: provider.accountDetails.id!,
),
),
);
...
...
@@ -532,16 +553,11 @@ class _AccountslistdetailsState extends State<Accountslistdetails> {
),
),
),
]
]
,
],
),
),
),
),
),
onWillPop: () {
return _onBackPressed(context);
},
);
},
);
...
...
lib/screens/commom/addCommonPayment.dart
View file @
c92f4c79
This diff is collapsed.
Click to expand it.
lib/screens/crm/LeadDetailsByMode.dart
View file @
c92f4c79
import
'dart:io'
;
import
'package:connectivity_plus/connectivity_plus.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:generp/Notifiers/crmProvider/crmLeadDetailsProvider.dart'
;
import
'package:generp/Utils/commonServices.dart'
;
import
'package:generp/screens/crm/AppointmentDetails.dart'
;
import
'package:generp/screens/crm/FollowUpDetails.dart'
;
import
'package:generp/screens/crm/QuotationDetails.dart'
;
...
...
@@ -32,10 +34,17 @@ class LeadDetailsByMode extends StatefulWidget {
}
class
_LeadDetailsByModeState
extends
State
<
LeadDetailsByMode
>
{
Map
_source
=
{
ConnectivityResult
.
mobile
:
true
};
final
MyConnectivity
_connectivity
=
MyConnectivity
.
instance
;
@override
void
initState
()
{
// TODO: implement initState
super
.
initState
();
_connectivity
.
initialise
();
_connectivity
.
myStream
.
listen
((
source
)
{
setState
(()
=>
_source
=
source
);
});
WidgetsBinding
.
instance
.
addPostFrameCallback
((
timeStamp
)
{
final
provider
=
Provider
.
of
<
crmLeadDetailsProvider
>(
context
,
...
...
@@ -45,33 +54,60 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> {
});
}
@override
void
dispose
()
{
// TODO: implement dispose
super
.
dispose
();
_connectivity
.
disposeStream
();
}
@override
Widget
build
(
BuildContext
context
)
{
switch
(
_source
.
keys
.
toList
()[
0
])
{
case
ConnectivityResult
.
mobile
:
connection
=
'Online'
;
break
;
case
ConnectivityResult
.
wifi
:
connection
=
'Online'
;
break
;
case
ConnectivityResult
.
none
:
default
:
connection
=
'Offline'
;
}
return
(
connection
==
"Online"
)
?
Platform
.
isAndroid
?
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
SafeArea
(
top:
false
,
bottom:
true
,
child:
_scaffold
(
context
),
),
)
:
_scaffold
(
context
)
:
NoNetwork
(
context
);
}
Widget
_scaffold
(
BuildContext
context
)
{
return
Consumer
<
crmLeadDetailsProvider
>(
builder:
(
context
,
provider
,
child
)
{
var
leadDetails
=
provider
.
leadDetails
;
var
headings1
=
[
"Account Manager Name"
,
"Account Created By"
,
"Address"
,
"Lead Status"
,
"Last Followup Date"
"Last Followup Date"
,
];
var
subHeadings1
=
[
provider
.
accountDetails
!.
accManager
??
"-"
,
provider
.
accountDetails
!.
owner
??
"-"
,
provider
.
leadDetails
!.
address
??
"-"
,
provider
.
leadDetails
!.
status
??
"-"
,
provider
.
followupDetails
.
first
!.
fdate
??
"-"
,
provider
.
accountDetails
!.
accManager
??
"-"
,
provider
.
accountDetails
!.
owner
??
"-"
,
provider
.
leadDetails
!.
address
??
"-"
,
provider
.
leadDetails
!.
status
??
"-"
,
provider
.
followupDetails
.
first
!.
fdate
??
"-"
,
];
var
headings2
=
[
"State"
,
"District"
,
...
...
@@ -84,29 +120,25 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> {
];
var
subHeadings2
=
[
provider
.
accountDetails
!.
state
??
"-"
,
provider
.
accountDetails
!.
district
??
"-"
,
provider
.
accountDetails
!.
subLocality
??
"-"
,
provider
.
accountDetails
!.
source
??
"-"
,
provider
.
accountDetails
!.
reference
??
"-"
,
provider
.
accountDetails
!.
team
??
"-"
,
provider
.
accountDetails
!.
segment
??
"-"
,
"
${provider.leadDetails!.lage??"-"}
days"
,
provider
.
accountDetails
!.
state
??
"-"
,
provider
.
accountDetails
!.
district
??
"-"
,
provider
.
accountDetails
!.
subLocality
??
"-"
,
provider
.
accountDetails
!.
source
??
"-"
,
provider
.
accountDetails
!.
reference
??
"-"
,
provider
.
accountDetails
!.
team
??
"-"
,
provider
.
accountDetails
!.
segment
??
"-"
,
"
${provider.leadDetails!.lage
??
"-"}
days"
,
];
var
totalHeadings
=
[...
headings1
];
var
totalSubHeadings
=
[...
subHeadings1
];
if
(
provider
.
showMoreDetails
){
totalHeadings
=
[...
headings1
,...
headings2
];
totalSubHeadings
=
[...
subHeadings1
,...
subHeadings2
];
if
(
provider
.
showMoreDetails
)
{
totalHeadings
=
[...
headings1
,
...
headings2
];
totalSubHeadings
=
[...
subHeadings1
,
...
subHeadings2
];
}
return
WillPopScope
(
child:
SafeArea
(
top:
false
,
bottom:
Platform
.
isIOS
?
false
:
true
,
child:
Scaffold
(
return
Scaffold
(
resizeToAvoidBottomInset:
true
,
appBar:
appbar2
(
context
,
...
...
@@ -168,7 +200,7 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> {
),
),
SizedBox
(
width:
10
),
if
(
provider
.
showEditButton
==
"1"
)
if
(
provider
.
showEditButton
==
"1"
)
Expanded
(
flex:
1
,
child:
InkResponse
(
...
...
@@ -181,12 +213,16 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> {
leadID:
leadDetails
.
id
,
mode:
widget
.
mode
,
accountID:
leadDetails
.
accId
,
companyName:
leadDetails
.
name
,
companyName:
leadDetails
.
name
,
),
),
);
if
(
res
==
true
){
provider
.
crmLeadDetailsAPIFunction
(
context
,
widget
.
leadId
,
widget
.
mode
);
if
(
res
==
true
)
{
provider
.
crmLeadDetailsAPIFunction
(
context
,
widget
.
leadId
,
widget
.
mode
,
);
}
},
child:
Container
(
...
...
@@ -261,24 +297,21 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> {
provider
.
showMoreDetails
=
!
provider
.
showMoreDetails
;
},
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
5
,
),
padding:
EdgeInsets
.
symmetric
(
vertical:
5
),
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Text
(
provider
.
showMoreDetails
?
"- Show Less"
:
"+ More Details"
,
provider
.
showMoreDetails
?
"- Show Less"
:
"+ More Details"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
color:
AppColors
.
app_blue
,
),
),
],
),
),
...
...
@@ -288,12 +321,6 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> {
),
),
),
),
),
onWillPop:
()
{
return
onBackPressed
(
context
);
},
);
},
);
...
...
@@ -336,7 +363,10 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> {
left:
15
,
right:
15
,
top:
10
,
),
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,),
),
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,
),
child:
SingleChildScrollView
(
child:
Column
(
...
...
@@ -345,16 +375,16 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> {
SizedBox
(
height:
15
),
...
List
.
generate
(
assetnames
.
length
,
(
index
)
{
return
ListTile
(
onTap:
()
{
Navigator
.
pop
(
context
,
true
);
Navigator
.
pop
(
context
,
true
);
switch
(
index
)
{
case
0
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Productdetails
(
builder:
(
context
)
=>
Productdetails
(
leadID:
provider
.
leadDetails
.
id
,
mode:
widget
.
mode
,
),
...
...
@@ -418,8 +448,6 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> {
),
);
}),
],
),
),
...
...
lib/screens/crm/LeadListByMode.dart
View file @
c92f4c79
import
'dart:io'
;
import
'package:connectivity_plus/connectivity_plus.dart'
;
import
'package:dropdown_button2/dropdown_button2.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/services.dart'
;
...
...
@@ -10,6 +11,7 @@ import 'package:generp/Models/crmModels/GetSourceOnReferenceResponse.dart';
import
'package:generp/Models/crmModels/GetSubLocOnDistrictResponse.dart'
;
import
'package:generp/Models/crmModels/LeadListViewResponse.dart'
;
import
'package:generp/Notifiers/crmProvider/LeadListProvider.dart'
;
import
'package:generp/Utils/commonServices.dart'
;
import
'package:provider/provider.dart'
;
import
'package:generp/screens/screensExports.dart'
;
...
...
@@ -36,11 +38,17 @@ class Leadlistbymode extends StatefulWidget {
class
_LeadlistbymodeState
extends
State
<
Leadlistbymode
>
{
Dropdowntheme
ddtheme
=
Dropdowntheme
();
Map
_source
=
{
ConnectivityResult
.
mobile
:
true
};
final
MyConnectivity
_connectivity
=
MyConnectivity
.
instance
;
@override
void
initState
()
{
// TODO: implement initState
super
.
initState
();
_connectivity
.
initialise
();
_connectivity
.
myStream
.
listen
((
source
)
{
setState
(()
=>
_source
=
source
);
});
WidgetsBinding
.
instance
.
addPostFrameCallback
((
timeStamp
)
{
final
provider
=
Provider
.
of
<
Leadlistprovider
>(
context
,
listen:
false
);
provider
.
crmLeadListViewAPIFunction
(
context
,
widget
.
mode
);
...
...
@@ -78,19 +86,45 @@ class _LeadlistbymodeState extends State<Leadlistbymode> {
});
}
@override
void
dispose
()
{
// TODO: implement dispose
super
.
dispose
();
_connectivity
.
disposeStream
();
}
@override
Widget
build
(
BuildContext
context
)
{
switch
(
_source
.
keys
.
toList
()[
0
])
{
case
ConnectivityResult
.
mobile
:
connection
=
'Online'
;
break
;
case
ConnectivityResult
.
wifi
:
connection
=
'Online'
;
break
;
case
ConnectivityResult
.
none
:
default
:
connection
=
'Offline'
;
}
return
(
connection
==
"Online"
)
?
Platform
.
isAndroid
?
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
SafeArea
(
top:
false
,
bottom:
true
,
child:
_scaffold
(
context
),
),
)
:
_scaffold
(
context
)
:
NoNetwork
(
context
);
}
Widget
_scaffold
(
BuildContext
context
)
{
return
Consumer
<
Leadlistprovider
>(
builder:
(
context
,
provider
,
child
)
{
final
crmLists
=
provider
.
crmLeadList
;
return
WillPopScope
(
onWillPop:
()
{
return
onBackPressed
(
context
);
},
child:
SafeArea
(
top:
false
,
bottom:
Platform
.
isIOS
?
false
:
true
,
child:
Scaffold
(
return
Scaffold
(
resizeToAvoidBottomInset:
true
,
appBar:
appbar2
(
context
,
...
...
@@ -111,7 +145,8 @@ class _LeadlistbymodeState extends State<Leadlistbymode> {
),
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
provider
.
isLoading
body:
provider
.
isLoading
?
Center
(
child:
CircularProgressIndicator
.
adaptive
(
valueColor:
AlwaysStoppedAnimation
<
Color
>(
...
...
@@ -130,9 +165,7 @@ class _LeadlistbymodeState extends State<Leadlistbymode> {
itemBuilder:
(
context
,
index
)
{
if
(
crmLists
.
isEmpty
)
{
return
SizedBox
(
child:
Center
(
child:
Text
(
"No Data Available"
),
),
child:
Center
(
child:
Text
(
"No Data Available"
)),
);
}
return
Container
(
...
...
@@ -160,8 +193,9 @@ class _LeadlistbymodeState extends State<Leadlistbymode> {
padding:
EdgeInsets
.
all
(
8.0
),
decoration:
BoxDecoration
(
color:
Color
(
0xFFE6F6FF
),
borderRadius:
BorderRadius
.
circular
(
8
),
borderRadius:
BorderRadius
.
circular
(
8
,
),
),
child:
SvgPicture
.
asset
(
"assets/svg/se_block_head.svg"
,
...
...
@@ -196,8 +230,9 @@ class _LeadlistbymodeState extends State<Leadlistbymode> {
vertical:
10
,
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
8
),
borderRadius:
BorderRadius
.
circular
(
8
,
),
color:
Color
(
0xFFE3FFE0
),
),
child:
Center
(
...
...
@@ -234,9 +269,7 @@ class _LeadlistbymodeState extends State<Leadlistbymode> {
crmLists
[
index
].
openStatus
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
5
,
),
padding:
EdgeInsets
.
symmetric
(
vertical:
5
),
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
...
...
@@ -283,9 +316,7 @@ class _LeadlistbymodeState extends State<Leadlistbymode> {
);
},
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
5
,
),
padding:
EdgeInsets
.
symmetric
(
vertical:
5
),
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
...
...
@@ -316,8 +347,6 @@ class _LeadlistbymodeState extends State<Leadlistbymode> {
),
)
:
Emptywidget
(
context
),
),
),
);
},
);
...
...
lib/screens/crm/NearbyOpenLeads.dart
View file @
c92f4c79
import
'dart:io'
;
import
'package:connectivity_plus/connectivity_plus.dart'
;
import
'package:dropdown_button2/dropdown_button2.dart'
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/gestures.dart'
;
...
...
@@ -5,6 +8,7 @@ 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/commonServices.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:google_maps_flutter/google_maps_flutter.dart'
;
import
'package:interactive_slider/interactive_slider.dart'
;
...
...
@@ -21,37 +25,85 @@ class NearbyOpenLeads extends StatefulWidget {
}
class
_NearbyOpenLeadsState
extends
State
<
NearbyOpenLeads
>
{
Map
_source
=
{
ConnectivityResult
.
mobile
:
true
};
final
MyConnectivity
_connectivity
=
MyConnectivity
.
instance
;
Dropdowntheme
ddtheme
=
Dropdowntheme
();
@override
void
initState
()
{
// TODO: implement initState
super
.
initState
();
_connectivity
.
initialise
();
_connectivity
.
myStream
.
listen
((
source
)
{
setState
(()
=>
_source
=
source
);
});
WidgetsBinding
.
instance
.
addPostFrameCallback
((
_
)
{
final
provider
=
Provider
.
of
<
crmNearbyOpenLeadsProvider
>(
context
,
listen:
false
);
final
provider
=
Provider
.
of
<
crmNearbyOpenLeadsProvider
>(
context
,
listen:
false
,
);
provider
.
getLocationPermission
(
context
);
},);
});
}
@override
void
dispose
()
{
// TODO: implement dispose
super
.
dispose
();
_connectivity
.
disposeStream
();
}
@override
Widget
build
(
BuildContext
context
)
{
switch
(
_source
.
keys
.
toList
()[
0
])
{
case
ConnectivityResult
.
mobile
:
connection
=
'Online'
;
break
;
case
ConnectivityResult
.
wifi
:
connection
=
'Online'
;
break
;
case
ConnectivityResult
.
none
:
default
:
connection
=
'Offline'
;
}
return
(
connection
==
"Online"
)
?
Platform
.
isAndroid
?
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
SafeArea
(
top:
false
,
bottom:
true
,
child:
_scaffold
(
context
),
),
)
:
_scaffold
(
context
)
:
NoNetwork
(
context
);
}
Widget
_scaffold
(
BuildContext
context
)
{
debugPrint
(
"Nearbygenerators widget rebuilt"
);
return
Consumer
<
crmNearbyOpenLeadsProvider
>(
builder:
(
context
,
provider
,
child
)
{
return
Consumer
<
crmNearbyOpenLeadsProvider
>(
builder:
(
context
,
provider
,
child
)
{
var
sendWidget
=
GestureDetector
(
onTap:
()
{
_showFilterBottomSheet
(
context
);
},
child:
SvgPicture
.
asset
(
"assets/svg/filter_ic.svg"
,
height:
25
,));
child:
SvgPicture
.
asset
(
"assets/svg/filter_ic.svg"
,
height:
25
),
);
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
return
Scaffold
(
resizeToAvoidBottomInset:
true
,
appBar:
appbar2
(
context
,
"Nearby Leads (Open)"
,
provider
.
resetAll
,
sendWidget
),
appBar:
appbar2
(
context
,
"Nearby Leads (Open)"
,
provider
.
resetAll
,
sendWidget
,
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
SafeArea
(
child:
Container
(
child:
SingleChildScrollView
(
child:
Column
(
child:
Column
(
children:
[
ClipRRect
(
// Apply border radius using ClipRRect
...
...
@@ -62,21 +114,28 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> {
// padding: EdgeInsets.fromLTRB(10, 20, 10, 20),
child:
Container
(
height:
MediaQuery
.
of
(
context
).
size
.
height
,
child:
Stack
(
children:
[
child:
Stack
(
children:
[
GoogleMap
(
myLocationEnabled:
true
,
zoomGesturesEnabled:
true
,
zoomControlsEnabled:
true
,
gestureRecognizers:
{
Factory
<
OneSequenceGestureRecognizer
>(()
=>
EagerGestureRecognizer
()),
Factory
<
PanGestureRecognizer
>(()
=>
PanGestureRecognizer
()),
Factory
<
ScaleGestureRecognizer
>(()
=>
ScaleGestureRecognizer
()),
// Prioritize pinch-to-zoom
Factory
<
OneSequenceGestureRecognizer
>(
()
=>
EagerGestureRecognizer
(),
),
Factory
<
PanGestureRecognizer
>(
()
=>
PanGestureRecognizer
(),
),
Factory
<
ScaleGestureRecognizer
>(
()
=>
ScaleGestureRecognizer
(),
),
// Prioritize pinch-to-zoom
},
initialCameraPosition:
CameraPosition
(
target:
provider
.
startLocation
,
zoom:
14.0
zoom:
14.0
,
),
markers:
provider
.
markers
.
toSet
(),
markers:
provider
.
markers
.
toSet
(),
mapType:
MapType
.
normal
,
onMapCreated:
(
controller
)
{
setState
(()
{
...
...
@@ -84,10 +143,11 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> {
});
},
onCameraMove:
(
position
)
{
provider
.
onCameraMove
(
context
,
position
);
provider
.
onCameraMove
(
context
,
position
);
},
),
]),
],
),
),
),
],
...
...
@@ -95,12 +155,11 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> {
),
),
),
),
);
},);
},
);
}
Future
<
void
>
_showFilterBottomSheet
(
BuildContext
context
)
{
return
showModalBottomSheet
(
useSafeArea:
true
,
...
...
@@ -115,14 +174,17 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> {
builder:
(
context
,
setState
)
{
return
SafeArea
(
child:
Consumer
<
crmNearbyOpenLeadsProvider
>(
builder:
(
context
,
provider
,
child
)
{
builder:
(
context
,
provider
,
child
)
{
return
Container
(
margin:
EdgeInsets
.
only
(
bottom:
15
,
left:
15
,
right:
15
,
top:
15
,
),
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,),
),
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,
),
child:
SingleChildScrollView
(
child:
Column
(
...
...
@@ -163,15 +225,17 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> {
InteractiveSlider
(
min:
1.0
,
max:
50.0
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
0
,
vertical:
0
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
0
,
vertical:
0
,
),
iconSize:
0.0
,
enabled:
true
,
// backgroundColor: AppColors.app_blue,
foregroundColor:
AppColors
.
app_blue
,
segmentDividerColor:
Color
(
0xFFF6F6F8
),
segmentDividerColor:
Color
(
0xFFF6F6F8
),
onChanged:
(
value
)
{
provider
.
currentValue
=
value
;
// provider.debounce(() {
...
...
@@ -199,7 +263,10 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> {
child:
InkWell
(
onTap:
()
{
provider
.
debounce
(()
{
provider
.
LoadNearbyOpenLeadsAPI
(
context
,
provider
.
currentValue
);
provider
.
LoadNearbyOpenLeadsAPI
(
context
,
provider
.
currentValue
,
);
Navigator
.
pop
(
context
);
},
Duration
(
milliseconds:
500
));
},
...
...
@@ -212,14 +279,14 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> {
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
14.0
),
color:
AppColors
.
app_blue
color:
AppColors
.
app_blue
,
),
child:
Text
(
"Search"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontFamily:
'JakartaMedium'
,
color:
Colors
.
white
color:
Colors
.
white
,
),
),
),
...
...
@@ -231,7 +298,7 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> {
),
),
);
}
}
,
),
);
},
...
...
lib/screens/crm/ProspectDetailsByMode.dart
View file @
c92f4c79
import
'dart:io'
;
import
'package:connectivity_plus/connectivity_plus.dart'
;
import
'package:dropdown_button2/dropdown_button2.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:generp/Notifiers/crmProvider/crmEditProspectAccountProvider.dart'
;
import
'package:generp/Notifiers/crmProvider/crmLeadDetailsProvider.dart'
;
import
'package:generp/Utils/commonServices.dart'
;
import
'package:generp/Utils/dropdownTheme.dart'
;
import
'package:generp/screens/crm/prospectContactDetails.dart'
;
import
'package:generp/screens/crm/prospectLeadDetails.dart'
;
...
...
@@ -39,11 +41,17 @@ class ProspectDetailsByMode extends StatefulWidget {
class
ProspectDetailsByModeState
extends
State
<
ProspectDetailsByMode
>
{
Dropdowntheme
ddtheme
=
Dropdowntheme
();
Map
_source
=
{
ConnectivityResult
.
mobile
:
true
};
final
MyConnectivity
_connectivity
=
MyConnectivity
.
instance
;
@override
void
initState
()
{
// TODO: implement initState
super
.
initState
();
_connectivity
.
initialise
();
_connectivity
.
myStream
.
listen
((
source
)
{
setState
(()
=>
_source
=
source
);
});
WidgetsBinding
.
instance
.
addPostFrameCallback
((
timeStamp
)
{
final
provider
=
Provider
.
of
<
crmProspectDetailsProvider
>(
context
,
...
...
@@ -63,6 +71,13 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
});
}
@override
void
dispose
()
{
// TODO: implement dispose
super
.
dispose
();
_connectivity
.
disposeStream
();
}
void
prefill
()
async
{
final
editProvider
=
Provider
.
of
<
Crmeditprospectaccountprovider
>(
context
,
...
...
@@ -160,6 +175,32 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
@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
Consumer2
<
crmProspectDetailsProvider
,
Crmeditprospectaccountprovider
...
...
@@ -167,11 +208,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
builder:
(
context
,
provider
,
editProvider
,
child
)
{
var
leadDetails
=
provider
.
accountDetails
;
return
WillPopScope
(
child:
SafeArea
(
top:
false
,
bottom:
Platform
.
isIOS
?
false
:
true
,
child:
Scaffold
(
return
Scaffold
(
resizeToAvoidBottomInset:
true
,
appBar:
appbar2
(
context
,
...
...
@@ -233,7 +270,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
),
),
if
(
provider
.
showTransferAccount
==
"1"
)...[
if
(
provider
.
showTransferAccount
==
"1"
)
...[
SizedBox
(
width:
5
),
Expanded
(
flex:
1
,
...
...
@@ -339,12 +376,6 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
),
),
),
),
),
onWillPop:
()
{
return
onBackPressed
(
context
);
},
);
},
);
...
...
@@ -560,8 +591,11 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
return
StatefulBuilder
(
builder:
(
context
,
setState
)
{
return
SafeArea
(
child:
Consumer2
<
Crmeditprospectaccountprovider
,
crmProspectDetailsProvider
>(
builder:
(
context
,
provider
,
prosDetProvider
,
child
)
{
child:
Consumer2
<
Crmeditprospectaccountprovider
,
crmProspectDetailsProvider
>(
builder:
(
context
,
provider
,
prosDetProvider
,
child
)
{
return
Container
(
margin:
EdgeInsets
.
only
(
bottom:
15
,
...
...
@@ -777,7 +811,11 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
widget
.
mode
,
provider
.
selectedDistrictId
,
);
prosDetProvider
.
crmProspectDetailsAPIFunction
(
context
,
widget
.
leadId
);
prosDetProvider
.
crmProspectDetailsAPIFunction
(
context
,
widget
.
leadId
,
);
}
}
},
...
...
@@ -892,7 +930,6 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
provider
.
selectedSubLocationId
,
);
Navigator
.
pop
(
context
);
},
child:
Container
(
height:
45
,
...
...
lib/screens/crm/ProspectListByMode.dart
View file @
c92f4c79
import
'dart:io'
;
import
'package:connectivity_plus/connectivity_plus.dart'
;
import
'package:dropdown_button2/dropdown_button2.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:generp/Utils/commonServices.dart'
;
import
'package:generp/Utils/dropdownTheme.dart'
;
import
'package:provider/provider.dart'
;
...
...
@@ -23,37 +25,68 @@ class ProspectListByMode extends StatefulWidget {
}
class
_ProspectListByModeState
extends
State
<
ProspectListByMode
>
{
Dropdowntheme
ddtheme
=
Dropdowntheme
();
Map
_source
=
{
ConnectivityResult
.
mobile
:
true
};
final
MyConnectivity
_connectivity
=
MyConnectivity
.
instance
;
@override
void
initState
()
{
// TODO: implement initState
super
.
initState
();
_connectivity
.
initialise
();
_connectivity
.
myStream
.
listen
((
source
)
{
setState
(()
=>
_source
=
source
);
});
WidgetsBinding
.
instance
.
addPostFrameCallback
((
timeStamp
)
{
final
provider
=
Provider
.
of
<
ProspectListProvider
>(
context
,
listen:
false
);
provider
.
crmProspectListViewAPIFunction
(
context
,
widget
.
mode
);
provider
.
crmProspectListAPIFunction
(
final
provider
=
Provider
.
of
<
ProspectListProvider
>(
context
,
widget
.
mode
,
""
,
listen:
false
,
);
provider
.
crmProspectListViewAPIFunction
(
context
,
widget
.
mode
);
provider
.
crmProspectListAPIFunction
(
context
,
widget
.
mode
,
""
);
});
}
@override
void
dispose
()
{
// TODO: implement dispose
super
.
dispose
();
_connectivity
.
disposeStream
();
}
@override
Widget
build
(
BuildContext
context
)
{
switch
(
_source
.
keys
.
toList
()[
0
])
{
case
ConnectivityResult
.
mobile
:
connection
=
'Online'
;
break
;
case
ConnectivityResult
.
wifi
:
connection
=
'Online'
;
break
;
case
ConnectivityResult
.
none
:
default
:
connection
=
'Offline'
;
}
return
(
connection
==
"Online"
)
?
Platform
.
isAndroid
?
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
SafeArea
(
top:
false
,
bottom:
true
,
child:
_scaffold
(
context
),
),
)
:
_scaffold
(
context
)
:
NoNetwork
(
context
);
}
Widget
_scaffold
(
BuildContext
context
)
{
return
Consumer
<
ProspectListProvider
>(
builder:
(
context
,
provider
,
child
)
{
final
crmLists
=
provider
.
accountList
;
return
WillPopScope
(
onWillPop:
()
{
return
onBackPressed
(
context
);
},
child:
SafeArea
(
top:
false
,
bottom:
Platform
.
isIOS
?
false
:
true
,
child:
Scaffold
(
// ignore: deprecated_member_use
return
Scaffold
(
resizeToAvoidBottomInset:
true
,
appBar:
appbar2
(
context
,
...
...
@@ -74,7 +107,8 @@ class _ProspectListByModeState extends State<ProspectListByMode> {
),
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
provider
.
isLoading
body:
provider
.
isLoading
?
Center
(
child:
CircularProgressIndicator
.
adaptive
(
valueColor:
AlwaysStoppedAnimation
<
Color
>(
...
...
@@ -93,9 +127,7 @@ class _ProspectListByModeState extends State<ProspectListByMode> {
itemBuilder:
(
context
,
index
)
{
if
(
crmLists
.
isEmpty
)
{
return
SizedBox
(
child:
Center
(
child:
Text
(
"No Data Available"
),
),
child:
Center
(
child:
Text
(
"No Data Available"
)),
);
}
...
...
@@ -125,8 +157,9 @@ class _ProspectListByModeState extends State<ProspectListByMode> {
padding:
EdgeInsets
.
all
(
8.0
),
decoration:
BoxDecoration
(
color:
Color
(
0xFFE6F6FF
),
borderRadius:
BorderRadius
.
circular
(
8
),
borderRadius:
BorderRadius
.
circular
(
8
,
),
),
child:
SvgPicture
.
asset
(
"assets/svg/se_block_head.svg"
,
...
...
@@ -153,7 +186,6 @@ class _ProspectListByModeState extends State<ProspectListByMode> {
),
),
),
],
),
Divider
(
...
...
@@ -179,9 +211,7 @@ class _ProspectListByModeState extends State<ProspectListByMode> {
crmLists
[
index
].
gstNumber
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
5
,
),
padding:
EdgeInsets
.
symmetric
(
vertical:
5
),
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
...
...
@@ -215,21 +245,20 @@ class _ProspectListByModeState extends State<ProspectListByMode> {
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
ProspectDetailsByMode
(
(
context
)
=>
ProspectDetailsByMode
(
pageTitleName:
widget
.
pageTitleName
,
widget
.
pageTitleName
,
mode:
widget
.
mode
,
leadId:
provider
.
accountList
[
index
].
aid
,
leadId:
provider
.
accountList
[
index
]
.
aid
,
),
),
);
},
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
5
,
),
padding:
EdgeInsets
.
symmetric
(
vertical:
5
),
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
...
...
@@ -255,16 +284,11 @@ class _ProspectListByModeState extends State<ProspectListByMode> {
],
),
);
},
),
),
)
:
Emptywidget
(
context
)
),
),
:
Emptywidget
(
context
),
);
},
);
...
...
@@ -292,7 +316,9 @@ class _ProspectListByModeState extends State<ProspectListByMode> {
right:
15
,
top:
10
,
),
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,),
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,
),
child:
SingleChildScrollView
(
child:
Column
(
...
...
@@ -314,7 +340,7 @@ class _ProspectListByModeState extends State<ProspectListByMode> {
],
),
if
(
widget
.
mode
!=
"executive"
)...[
if
(
widget
.
mode
!=
"executive"
)
...[
TextWidget
(
context
,
"Employee"
),
DropdownButtonHideUnderline
(
child:
Row
(
...
...
@@ -340,31 +366,37 @@ class _ProspectListByModeState extends State<ProspectListByMode> {
),
)
.
toList
(),
value:
provider
.
employeesList
.
contains
(
provider
.
selectedEmployees
)
value:
provider
.
employeesList
.
contains
(
provider
.
selectedEmployees
,
)
?
provider
.
selectedEmployees
:
null
,
// value: provider.selectedEmployees,
onChanged:
(
Employees
?
value
)
{
if
(
value
!=
null
)
{
if
(
provider
.
employeesList
.
isNotEmpty
){
if
(
provider
.
employeesList
.
isNotEmpty
)
{
provider
.
selectedEmployees
=
value
;
provider
.
selectedEmployeeId
=
value
!.
id
!;
provider
.
selectedEmployeeValue
=
value
!.
name
!;
provider
.
selectedEmployeeId
=
value
!.
id
!;
provider
.
selectedEmployeeValue
=
value
!.
name
!;
}
}
},
isExpanded:
true
,
dropdownSearchData:
DropdownSearchData
(
searchInnerWidgetHeight:
50
,
searchController:
provider
.
searchController
,
searchController:
provider
.
searchController
,
searchInnerWidget:
Padding
(
padding:
const
EdgeInsets
.
all
(
8
),
child:
TextFormField
(
controller:
provider
.
searchController
,
provider
.
searchController
,
decoration:
InputDecoration
(
isDense:
true
,
contentPadding:
...
...
@@ -396,8 +428,10 @@ class _ProspectListByModeState extends State<ProspectListByMode> {
},
buttonStyleData:
ddtheme
.
buttonStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
),
),
],
...
...
@@ -426,17 +460,23 @@ class _ProspectListByModeState extends State<ProspectListByMode> {
null
,
),
InkResponse
(
onTap:
()
{
provider
.
crmProspectListAPIFunction
(
context
,
widget
.
mode
,
provider
.
selectedEmployeeId
);
provider
.
crmProspectListAPIFunction
(
context
,
widget
.
mode
,
provider
.
selectedEmployeeId
,
);
Navigator
.
pop
(
context
);
},
child:
Container
(
height:
45
,
alignment:
Alignment
.
center
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
,
),
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
borderRadius:
BorderRadius
.
circular
(
15
),
...
...
@@ -450,7 +490,7 @@ class _ProspectListByModeState extends State<ProspectListByMode> {
),
),
),
)
)
,
],
),
),
...
...
lib/screens/crm/addProspectLeads.dart
View file @
c92f4c79
This diff is collapsed.
Click to expand it.
lib/screens/crm/crmDashboard.dart
View file @
c92f4c79
...
...
@@ -39,12 +39,14 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
prov
.
crmPendingTasksAPIFunction
(
context
);
});
}
@override
@override
void
dispose
()
{
// TODO: implement dispose
super
.
dispose
();
_connectivity
.
disposeStream
();
}
@override
Widget
build
(
BuildContext
context
)
{
switch
(
_source
.
keys
.
toList
()[
0
])
{
...
...
@@ -517,7 +519,12 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
FloatingActionButtonLocation
.
centerFloat
,
floatingActionButton:
InkResponse
(
onTap:
()
{
if
(
provider
.
accessPages
.
where
((
page
)
=>
[
8
,
9
].
contains
(
page
.
id
))
.
toList
()
.
contains
([
8
,
9
]))
{
_showPaymentOptionsSheet
(
context
);
}
},
child:
Container
(
height:
45
,
...
...
lib/screens/crm/productDetails.dart
View file @
c92f4c79
import
'dart:io'
;
import
'package:connectivity_plus/connectivity_plus.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:generp/Utils/commonServices.dart'
;
import
'package:generp/screens/crm/editProductsList.dart'
;
import
'package:provider/provider.dart'
;
...
...
@@ -12,39 +14,78 @@ import '../../Utils/commonWidgets.dart';
class
Productdetails
extends
StatefulWidget
{
final
leadID
;
final
mode
;
const
Productdetails
({
super
.
key
,
required
this
.
leadID
,
required
this
.
mode
});
const
Productdetails
({
super
.
key
,
required
this
.
leadID
,
required
this
.
mode
});
@override
State
<
Productdetails
>
createState
()
=>
_ProductdetailsState
();
}
class
_ProductdetailsState
extends
State
<
Productdetails
>
{
Map
_source
=
{
ConnectivityResult
.
mobile
:
true
};
final
MyConnectivity
_connectivity
=
MyConnectivity
.
instance
;
@override
void
initState
()
{
// TODO: implement initState
super
.
initState
();
_connectivity
.
initialise
();
_connectivity
.
myStream
.
listen
((
source
)
{
setState
(()
=>
_source
=
source
);
});
WidgetsBinding
.
instance
.
addPostFrameCallback
((
timeStamp
)
{
final
provider
=
Provider
.
of
<
crmLeadDetailsProvider
>(
context
,
listen:
false
);
final
provider
=
Provider
.
of
<
crmLeadDetailsProvider
>(
context
,
listen:
false
,
);
provider
.
crmLeadDetailsAPIFunction
(
context
,
widget
.
leadID
,
widget
.
mode
);
},);
});
}
@override
void
dispose
()
{
// TODO: implement dispose
super
.
dispose
();
_connectivity
.
disposeStream
();
}
@override
Widget
build
(
BuildContext
context
)
{
return
Consumer
<
crmLeadDetailsProvider
>(
builder:
(
context
,
provider
,
child
)
{
var
customerDetails
=
provider
.
leadProducts
;
return
WillPopScope
(
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:
Platform
.
isIOS
?
false
:
true
,
child:
Scaffold
(
bottom:
true
,
child:
_scaffold
(
context
),
),
)
:
_scaffold
(
context
)
:
NoNetwork
(
context
);
}
Widget
_scaffold
(
BuildContext
context
)
{
return
Consumer
<
crmLeadDetailsProvider
>(
builder:
(
context
,
provider
,
child
)
{
var
customerDetails
=
provider
.
leadProducts
;
return
Scaffold
(
resizeToAvoidBottomInset:
true
,
appBar:
appbar
(
context
,
"Product Details"
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
SizedBox
(
body:
provider
.
leadProducts
.
isNotEmpty
?
SizedBox
(
child:
SingleChildScrollView
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
...
...
@@ -55,8 +96,14 @@ class _ProductdetailsState extends State<Productdetails> {
shrinkWrap:
true
,
itemBuilder:
(
context
,
index
)
{
return
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
15
,
vertical:
10
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
,
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
15
,
vertical:
10
,
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
...
...
@@ -68,16 +115,15 @@ class _ProductdetailsState extends State<Productdetails> {
"Product Name"
,
"Product Price"
,
"Quantity"
,
"Total Price"
"Total Price"
,
];
final
textSubheads
=
[
customerDetails
[
index
].
productName
??
"-"
,
customerDetails
[
index
].
price
??
"-"
,
customerDetails
[
index
].
qty
??
"-"
,
customerDetails
[
index
].
price
??
"-"
,
customerDetails
[
index
].
productName
??
"-"
,
customerDetails
[
index
].
price
??
"-"
,
customerDetails
[
index
].
qty
??
"-"
,
customerDetails
[
index
].
price
??
"-"
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
6
,
horizontal:
0
,
...
...
@@ -87,18 +133,19 @@ class _ProductdetailsState extends State<Productdetails> {
CrossAxisAlignment
.
start
,
children:
[
Expanded
(
flex:
2
,
child:
Text
(
textheads
[
j
].
toString
(),
flex:
2
,
child:
Text
(
textheads
[
j
].
toString
(),
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,),
overflow:
TextOverflow
.
ellipsis
,
),
),
Expanded
(
flex:
3
,
child:
Text
(
textSubheads
[
j
],
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
),
...
...
@@ -110,23 +157,32 @@ class _ProductdetailsState extends State<Productdetails> {
}),
),
);
}
},
),
SizedBox
(
height:
75
),
],
),
),
),
)
:
Emptywidget
(
context
),
floatingActionButton:
Align
(
alignment:
Alignment
.
bottomCenter
,
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
);
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
(
...
...
@@ -142,8 +198,10 @@ class _ProductdetailsState extends State<Productdetails> {
child:
Text
(
"Edit Products"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
Colors
.
white
,
fontFamily:
"JakartaMedium"
),
style:
TextStyle
(
color:
Colors
.
white
,
fontFamily:
"JakartaMedium"
,
),
),
),
),
...
...
@@ -151,8 +209,6 @@ class _ProductdetailsState extends State<Productdetails> {
),
floatingActionButtonLocation:
FloatingActionButtonLocation
.
centerFloat
,
),
),
);
},
);
...
...
lib/screens/crm/prospectContactDetails.dart
View file @
c92f4c79
import
'dart:io'
;
import
'package:connectivity_plus/connectivity_plus.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:generp/Notifiers/crmProvider/crmProspectDetailsProvider.dart'
;
import
'package:generp/Utils/commonServices.dart'
;
import
'package:provider/provider.dart'
;
import
'../../Utils/app_colors.dart'
;
...
...
@@ -11,24 +13,66 @@ import '../../Utils/commonWidgets.dart';
class
ProspectContactDetails
extends
StatefulWidget
{
final
accountId
;
const
ProspectContactDetails
({
super
.
key
,
required
this
.
accountId
});
const
ProspectContactDetails
({
super
.
key
,
required
this
.
accountId
});
@override
State
<
ProspectContactDetails
>
createState
()
=>
_ProspectContactDetailsState
();
}
class
_ProspectContactDetailsState
extends
State
<
ProspectContactDetails
>
{
Map
_source
=
{
ConnectivityResult
.
mobile
:
true
};
final
MyConnectivity
_connectivity
=
MyConnectivity
.
instance
;
@override
void
initState
()
{
// TODO: implement initState
super
.
initState
();
_connectivity
.
initialise
();
_connectivity
.
myStream
.
listen
((
source
)
{
setState
(()
=>
_source
=
source
);
});
WidgetsBinding
.
instance
.
addPostFrameCallback
((
timeStamp
)
{});
}
@override
void
dispose
()
{
// TODO: implement dispose
super
.
dispose
();
_connectivity
.
disposeStream
();
}
@override
Widget
build
(
BuildContext
context
)
{
return
Consumer
<
crmProspectDetailsProvider
>(
builder:
(
context
,
provider
,
child
)
{
var
customerDetails
=
provider
.
contactList
;
return
WillPopScope
(
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:
Platform
.
isIOS
?
false
:
true
,
child:
Scaffold
(
bottom:
true
,
child:
_scaffold
(
context
),
),
)
:
_scaffold
(
context
)
:
NoNetwork
(
context
);
}
Widget
_scaffold
(
BuildContext
context
)
{
return
Consumer
<
crmProspectDetailsProvider
>(
builder:
(
context
,
provider
,
child
)
{
var
customerDetails
=
provider
.
contactList
;
return
Scaffold
(
resizeToAvoidBottomInset:
true
,
appBar:
appbar
(
context
,
"Contact Details"
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
...
...
@@ -37,7 +81,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
TextWidget
(
context
,
"Contact Details"
),
//
TextWidget(context, "Contact Details"),
ListView
.
builder
(
itemCount:
customerDetails
.
length
,
shrinkWrap:
true
,
...
...
@@ -68,9 +112,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
padding:
EdgeInsets
.
all
(
8.0
),
decoration:
BoxDecoration
(
color:
Color
(
0xFFE6F6FF
),
borderRadius:
BorderRadius
.
circular
(
8
,
),
borderRadius:
BorderRadius
.
circular
(
8
),
),
child:
SvgPicture
.
asset
(
"assets/svg/crm_contact_profile.svg"
,
...
...
@@ -86,8 +128,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
CrossAxisAlignment
.
start
,
children:
[
Text
(
customerDetails
[
index
].
name
??
"-"
,
customerDetails
[
index
].
name
??
"-"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
...
...
@@ -103,13 +144,26 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
flex:
1
,
child:
InkResponse
(
onTap:
()
{
provider
.
editNameController
.
text
=
customerDetails
[
index
].
name
??
""
;
provider
.
editDesignationController
.
text
=
customerDetails
[
index
].
designation
??
""
;
provider
.
editMobileNumberController
.
text
=
customerDetails
[
index
].
mob1
??
""
;
provider
.
editAlternativeMobileController
.
text
=
customerDetails
[
index
].
mob2
??
""
;
provider
.
editTelephoneController
.
text
=
customerDetails
[
index
].
tel
??
""
;
provider
.
editEmailController
.
text
=
customerDetails
[
index
].
email
??
""
;
_showEditContactSheet
(
context
,
index
,
provider
.
accountDetails
.
id
!);
provider
.
editNameController
.
text
=
customerDetails
[
index
].
name
??
""
;
provider
.
editDesignationController
.
text
=
customerDetails
[
index
].
designation
??
""
;
provider
.
editMobileNumberController
.
text
=
customerDetails
[
index
].
mob1
??
""
;
provider
.
editAlternativeMobileController
.
text
=
customerDetails
[
index
].
mob2
??
""
;
provider
.
editTelephoneController
.
text
=
customerDetails
[
index
].
tel
??
""
;
provider
.
editEmailController
.
text
=
customerDetails
[
index
].
email
??
""
;
_showEditContactSheet
(
context
,
index
,
provider
.
accountDetails
.
id
!,
);
},
child:
Container
(
height:
35
,
...
...
@@ -123,10 +177,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
),
],
),
Divider
(
thickness:
0.5
,
color:
Color
(
0xFFD7D7D7
),
),
Divider
(
thickness:
0.5
,
color:
Color
(
0xFFD7D7D7
)),
...
List
.
generate
(
5
,
(
j
)
{
final
textheads
=
[
"Mobile"
,
...
...
@@ -148,8 +199,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
horizontal:
0
,
),
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Expanded
(
child:
Text
(
...
...
@@ -189,7 +239,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
alignment:
Alignment
.
bottomCenter
,
child:
InkWell
(
onTap:
()
{
_showAddContactSheet
(
context
,
provider
.
accountDetails
.
id
!);
_showAddContactSheet
(
context
,
provider
.
accountDetails
.
id
!);
},
child:
Container
(
alignment:
Alignment
.
bottomCenter
,
...
...
@@ -215,14 +265,12 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
),
floatingActionButtonLocation:
FloatingActionButtonLocation
.
centerFloat
,
),
),
);
},
);
}
Future
<
void
>
_showAddContactSheet
(
BuildContext
context
,
accID
)
{
Future
<
void
>
_showAddContactSheet
(
BuildContext
context
,
accID
)
{
return
showModalBottomSheet
(
useSafeArea:
true
,
isDismissible:
true
,
...
...
@@ -330,9 +378,16 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
),
errorWidget
(
context
,
provider
.
emailError
),
InkWell
(
onTap:
provider
.
isLoading
?
null
:(){
onTap:
provider
.
isLoading
?
null
:
()
{
provider
.
isLoading
=
true
;
provider
.
crmProspectDetailsAddContactAPIFunction
(
context
,
accID
);
provider
.
crmProspectDetailsAddContactAPIFunction
(
context
,
accID
,
);
},
child:
Container
(
alignment:
Alignment
.
center
,
...
...
@@ -348,7 +403,14 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
borderRadius:
BorderRadius
.
circular
(
14.0
),
),
child:
Center
(
child:
provider
.
isLoading
?
CircularProgressIndicator
.
adaptive
(
valueColor:
AlwaysStoppedAnimation
(
AppColors
.
white
),):
Text
(
child:
provider
.
isLoading
?
CircularProgressIndicator
.
adaptive
(
valueColor:
AlwaysStoppedAnimation
(
AppColors
.
white
,
),
)
:
Text
(
"Submit"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
Colors
.
white
),
...
...
@@ -369,7 +431,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
);
}
Future
<
void
>
_showEditContactSheet
(
BuildContext
context
,
index
,
accid
)
{
Future
<
void
>
_showEditContactSheet
(
BuildContext
context
,
index
,
accid
)
{
return
showModalBottomSheet
(
useSafeArea:
true
,
isDismissible:
true
,
...
...
@@ -479,9 +541,17 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
errorWidget
(
context
,
provider
.
editEmailError
),
InkWell
(
onTap:
provider
.
isLoading
?
null
:(){
onTap:
provider
.
isLoading
?
null
:
()
{
provider
.
isLoading
=
true
;
provider
.
crmProspectDetailsEditContactAPIFunction
(
context
,
provider
.
contactList
[
index
].
id
,
accid
);
provider
.
crmProspectDetailsEditContactAPIFunction
(
context
,
provider
.
contactList
[
index
].
id
,
accid
,
);
},
child:
Container
(
alignment:
Alignment
.
center
,
...
...
@@ -497,7 +567,14 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
borderRadius:
BorderRadius
.
circular
(
14.0
),
),
child:
Center
(
child:
provider
.
isLoading
?
CircularProgressIndicator
.
adaptive
(
valueColor:
AlwaysStoppedAnimation
(
AppColors
.
white
),):
Text
(
child:
provider
.
isLoading
?
CircularProgressIndicator
.
adaptive
(
valueColor:
AlwaysStoppedAnimation
(
AppColors
.
white
,
),
)
:
Text
(
"Submit"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
Colors
.
white
),
...
...
lib/screens/crm/prospectLeadDetails.dart
View file @
c92f4c79
import
'dart:io'
;
import
'package:connectivity_plus/connectivity_plus.dart'
;
import
'package:flutter/material.dart'
;
import
'package:generp/Notifiers/crmProvider/crmProspectDetailsProvider.dart'
;
import
'package:generp/Utils/commonServices.dart'
;
import
'package:generp/screens/crm/LeadDetailsByMode.dart'
;
import
'package:provider/provider.dart'
;
...
...
@@ -13,17 +15,28 @@ class ProspectLeadDetails extends StatefulWidget {
final
leadID
;
final
mode
;
const
ProspectLeadDetails
({
super
.
key
,
required
this
.
leadID
,
required
this
.
mode
});
const
ProspectLeadDetails
({
super
.
key
,
required
this
.
leadID
,
required
this
.
mode
,
});
@override
State
<
ProspectLeadDetails
>
createState
()
=>
_ProspectLeadDetailsState
();
}
class
_ProspectLeadDetailsState
extends
State
<
ProspectLeadDetails
>
{
Map
_source
=
{
ConnectivityResult
.
mobile
:
true
};
final
MyConnectivity
_connectivity
=
MyConnectivity
.
instance
;
@override
void
initState
()
{
// TODO: implement initState
super
.
initState
();
_connectivity
.
initialise
();
_connectivity
.
myStream
.
listen
((
source
)
{
setState
(()
=>
_source
=
source
);
});
WidgetsBinding
.
instance
.
addPostFrameCallback
((
timeStamp
)
{
final
provider
=
Provider
.
of
<
crmProspectDetailsProvider
>(
context
,
...
...
@@ -32,17 +45,45 @@ class _ProspectLeadDetailsState extends State<ProspectLeadDetails> {
});
}
@override
void
dispose
()
{
// TODO: implement dispose
super
.
dispose
();
_connectivity
.
disposeStream
();
}
@override
Widget
build
(
BuildContext
context
)
{
return
Consumer
<
crmProspectDetailsProvider
>(
builder:
(
context
,
provider
,
child
)
{
var
customerDetails
=
provider
.
leadList
;
return
WillPopScope
(
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:
Platform
.
isIOS
?
false
:
true
,
child:
Scaffold
(
bottom:
true
,
child:
_scaffold
(
context
),
),
)
:
_scaffold
(
context
)
:
NoNetwork
(
context
);
}
Widget
_scaffold
(
BuildContext
context
)
{
return
Consumer
<
crmProspectDetailsProvider
>(
builder:
(
context
,
provider
,
child
)
{
var
customerDetails
=
provider
.
leadList
;
return
Scaffold
(
resizeToAvoidBottomInset:
true
,
appBar:
appbar
(
context
,
"Lead Details"
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
...
...
@@ -51,7 +92,6 @@ class _ProspectLeadDetailsState extends State<ProspectLeadDetails> {
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
TextWidget
(
context
,
"Lead Details"
),
ListView
.
builder
(
itemCount:
customerDetails
.
length
,
shrinkWrap:
true
,
...
...
@@ -73,7 +113,11 @@ class _ProspectLeadDetailsState extends State<ProspectLeadDetails> {
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
List
.
generate
(
5
,
(
j
)
{
final
textheads
=
[
"Lead Id"
,
"Date Created"
,
"Lead Status"
,
"Lead Open / Close"
,
"View Details"
"Lead Id"
,
"Date Created"
,
"Lead Status"
,
"Lead Open / Close"
,
"View Details"
,
];
final
textSubheads
=
[
customerDetails
[
index
].
id
??
"-"
,
...
...
@@ -88,8 +132,7 @@ class _ProspectLeadDetailsState extends State<ProspectLeadDetails> {
horizontal:
0
,
),
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Expanded
(
flex:
2
,
...
...
@@ -99,33 +142,54 @@ class _ProspectLeadDetailsState extends State<ProspectLeadDetails> {
overflow:
TextOverflow
.
ellipsis
,
),
),
if
(
textSubheads
[
j
]==
"View"
)...[
if
(
textSubheads
[
j
]
==
"View"
)
...[
Expanded
(
flex:
3
,
child:
InkResponse
(
onTap:
()
async
{
var
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
LeadDetailsByMode
(
mode:
""
,
pageTitleName:
"Lead Details"
,
leadId:
widget
.
leadID
),));
if
(
res
==
true
){
provider
.
crmProspectDetailsAPIFunction
(
context
,
widget
.
leadID
);
onTap:
()
async
{
var
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
LeadDetailsByMode
(
mode:
""
,
pageTitleName:
"Lead Details"
,
leadId:
widget
.
leadID
,
),
),
);
if
(
res
==
true
)
{
provider
.
crmProspectDetailsAPIFunction
(
context
,
widget
.
leadID
,
);
}
},
child:
Text
(
textSubheads
[
j
]==
""
?
"-"
:
textSubheads
[
j
],
textSubheads
[
j
]
==
""
?
"-"
:
textSubheads
[
j
],
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
color:
AppColors
.
app_blue
,
decorationColor:
AppColors
.
app_blue
,
decoration:
TextDecoration
.
underline
decoration:
TextDecoration
.
underline
,
),
),
),
),
]
else
...[
]
else
...[
Expanded
(
flex:
3
,
child:
Text
(
textSubheads
[
j
]==
""
?
"-"
:
textSubheads
[
j
],
textSubheads
[
j
]
==
""
?
"-"
:
textSubheads
[
j
],
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
...
...
@@ -133,7 +197,7 @@ class _ProspectLeadDetailsState extends State<ProspectLeadDetails> {
),
),
),
]
]
,
],
),
);
...
...
@@ -156,7 +220,10 @@ class _ProspectLeadDetailsState extends State<ProspectLeadDetails> {
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
AddProspectLeads
(
leadID:
widget
.
leadID
,
mode:
widget
.
mode
,),
(
context
)
=>
AddProspectLeads
(
leadID:
widget
.
leadID
,
mode:
widget
.
mode
,
),
),
);
if
(
res
==
true
)
{
...
...
@@ -190,8 +257,6 @@ class _ProspectLeadDetailsState extends State<ProspectLeadDetails> {
),
floatingActionButtonLocation:
FloatingActionButtonLocation
.
centerFloat
,
),
),
);
},
);
...
...
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment