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
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
import
'dart:io'
;
import
'package:auto_size_text/auto_size_text.dart'
;
import
'package:connectivity_plus/connectivity_plus.dart'
;
import
'package:dropdown_button2/dropdown_button2.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:generp/Notifiers/commonProvider/accountLedgerProvider.dart'
;
import
'package:generp/Utils/commonServices.dart'
;
import
'package:generp/screens/commom/transactionDetails.dart'
;
import
'package:provider/provider.dart'
;
...
...
@@ -24,10 +26,17 @@ class Accountledger extends StatefulWidget {
class
_AccountledgerState
extends
State
<
Accountledger
>
{
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
)
{
var
provider
=
Provider
.
of
<
Accountledgerprovider
>(
context
,
listen:
false
);
provider
.
dropDownAPI
(
context
);
...
...
@@ -35,13 +44,48 @@ class _AccountledgerState extends State<Accountledger> {
_showFilterSheet
(
context
);
});
}
Future
<
bool
>
_onBackPressed
(
BuildContext
context
)
async
{
Provider
.
of
<
Accountledgerprovider
>(
context
,
listen:
false
).
resetAll
();
Navigator
.
pop
(
context
,
true
);
return
true
;
}
@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
<
Accountledgerprovider
>(
builder:
(
context
,
provider
,
child
)
{
final
groupedData
=
provider
.
groupByDate
(
provider
.
ledgerList
);
...
...
@@ -70,7 +114,7 @@ class _AccountledgerState extends State<Accountledger> {
"Bank UPI ID"
,
"State"
,
"District"
,
"Sub Locality"
"Sub Locality"
,
];
var
values
=
[
...
...
@@ -97,11 +141,7 @@ class _AccountledgerState extends State<Accountledger> {
totalHeadings
=
[...
headings
,
...
headings2
];
totalValues
=
[...
values
,
...
values2
];
}
return
WillPopScope
(
child:
SafeArea
(
top:
false
,
bottom:
Platform
.
isIOS
?
false
:
true
,
child:
Scaffold
(
return
Scaffold
(
resizeToAvoidBottomInset:
true
,
appBar:
appbar2
(
context
,
...
...
@@ -110,23 +150,23 @@ class _AccountledgerState extends State<Accountledger> {
Row
(
children:
[
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
5
,
vertical:
5
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
5
,
vertical:
5
),
decoration:
BoxDecoration
(
color:
Color
(
0xFFE6F6FF
),
borderRadius:
BorderRadius
.
circular
(
8
),
),
child:
Row
(
children:
[
SvgPicture
.
asset
(
"assets/svg/fin_ic.svg"
,
height:
12
,),
SizedBox
(
width:
5
,),
Text
(
"
${provider.balanceDetails.balance.toString()}
"
??
"-"
,
style:
TextStyle
(
fontSize:
12
,
),)
SvgPicture
.
asset
(
"assets/svg/fin_ic.svg"
,
height:
12
),
SizedBox
(
width:
5
),
Text
(
"
${provider.balanceDetails.balance.toString()}
"
??
"-"
,
style:
TextStyle
(
fontSize:
12
),
),
],
),
),
SizedBox
(
width:
10
,),
),
SizedBox
(
width:
10
),
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
5
,
vertical:
5
),
...
...
@@ -136,30 +176,41 @@ class _AccountledgerState extends State<Accountledger> {
_showFilterSheet
(
context
);
},
child:
SvgPicture
.
asset
(
"assets/svg/search_ic.svg"
,
height:
25
),
child:
SvgPicture
.
asset
(
"assets/svg/search_ic.svg"
,
height:
25
,
),
),
),
],
),
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
provider
.
isLoading
?
Center
(
child:
CircularProgressIndicator
.
adaptive
(
body:
provider
.
isLoading
?
Center
(
child:
CircularProgressIndicator
.
adaptive
(
valueColor:
AlwaysStoppedAnimation
<
Color
>(
AppColors
.
app_blue
)
)):
SizedBox
(
AppColors
.
app_blue
,
),
),
)
:
SizedBox
(
child:
SingleChildScrollView
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Padding
(
padding:
const
EdgeInsets
.
all
(
8.0
),
child:
Text
(
"
${provider.selectedAcVal??""}
"
+
" "
+
"Account Ledger List"
),
child:
Text
(
"
${provider.selectedAcVal ?? ""}
"
+
" "
+
"Account Ledger List"
,
),
),
if
(
provider
.
ledgerList
.
isEmpty
)...[
if
(
provider
.
ledgerList
.
isEmpty
)
...[
Emptywidget
(
context
),
]
else
...[
]
else
...[
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
...
...
@@ -182,22 +233,26 @@ class _AccountledgerState extends State<Accountledger> {
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
AutoSizeText
(
"
${provider.balanceDetails.totalCredit}
"
,
style:
TextStyle
(
color:
Color
(
0xFFED3424
),
fontFamily:
"JakartaRegular"
,
fontSize:
2
0
,
fontSize:
2
5
,
),
minFontSize:
20
,
maxLines:
2
,
minFontSize:
18
,
maxFontSize:
25
,
),
Text
(
"credit"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
)),
style:
TextStyle
(
color:
Color
(
0xFF818181
),
),
),
],
),
...
...
@@ -218,21 +273,25 @@ class _AccountledgerState extends State<Accountledger> {
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
AutoSizeText
(
"
${provider.balanceDetails.totalDebit}
"
,
style:
TextStyle
(
color:
Color
(
0xFFED3424
),
fontFamily:
"JakartaRegular"
,
fontSize:
2
0
,
fontSize:
2
5
,
),
minFontSize:
20
,
minFontSize:
18
,
maxFontSize:
25
,
maxLines:
2
,
),
Text
(
"debit"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
)),
style:
TextStyle
(
color:
Color
(
0xFF818181
),
),
),
],
),
...
...
@@ -244,7 +303,10 @@ class _AccountledgerState extends State<Accountledger> {
Container
(
alignment:
Alignment
.
topLeft
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
child:
Text
(
"Account Details"
,
style:
TextStyle
(
...
...
@@ -269,10 +331,9 @@ class _AccountledgerState extends State<Accountledger> {
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
...
List
.
generate
(
totalHeadings
.
length
,
(
index
)
{
...
List
.
generate
(
totalHeadings
.
length
,
(
index
,
)
{
return
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
...
...
@@ -300,14 +361,14 @@ class _AccountledgerState extends State<Accountledger> {
),
),
),
],
),
);
}),
InkResponse
(
onTap:
()
async
{
provider
.
showMoreDetails
=
!
provider
.
showMoreDetails
;
provider
.
showMoreDetails
=
!
provider
.
showMoreDetails
;
},
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
...
...
@@ -320,14 +381,15 @@ class _AccountledgerState extends State<Accountledger> {
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
,
),
),
],
),
),
...
...
@@ -343,13 +405,16 @@ class _AccountledgerState extends State<Accountledger> {
String
date
=
groupedData
.
keys
.
elementAt
(
index
);
List
<
LedgerList
>
items
=
groupedData
[
date
]!;
if
(
provider
.
ledgerList
.
isEmpty
)
{
return
Center
(
child:
Text
(
"No Data Available"
));
return
Center
(
child:
Text
(
"No Data Available"
),
);
}
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
5
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Container
(
padding:
EdgeInsets
.
only
(
bottom:
5
),
...
...
@@ -363,21 +428,26 @@ class _AccountledgerState extends State<Accountledger> {
),
),
...
items
.
map
((
item
)
{
double
running_balance
=
0
;
int
currentIndex
=
provider
.
ledgerList
.
indexOf
(
item
,
);
for
(
var
i
=
0
;
i
<=
currentIndex
;
i
++)
{
var
ledgerItem
=
provider
.
ledgerList
[
i
];
int
currentIndex
=
provider
.
ledgerList
.
indexOf
(
item
);
for
(
var
i
=
0
;
i
<=
currentIndex
;
i
++
)
{
var
ledgerItem
=
provider
.
ledgerList
[
i
];
double
credit
=
double
.
tryParse
(
ledgerItem
.
creditAmount
.
toString
(),
ledgerItem
.
creditAmount
.
toString
(),
)
??
0
;
double
debit
=
double
.
tryParse
(
ledgerItem
.
debitAmount
.
toString
(),
ledgerItem
.
debitAmount
.
toString
(),
)
??
0
;
running_balance
+=
(
debit
-
credit
);
...
...
@@ -388,10 +458,14 @@ class _AccountledgerState extends State<Accountledger> {
horizontal:
10
,
vertical:
10
,
),
margin:
EdgeInsets
.
symmetric
(
vertical:
5
),
margin:
EdgeInsets
.
symmetric
(
vertical:
5
,
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
borderRadius:
BorderRadius
.
circular
(
16
,
),
),
child:
Column
(
children:
[
...
...
@@ -408,13 +482,17 @@ class _AccountledgerState extends State<Accountledger> {
"assets/images/trans_debit.png"
,
height:
45
,
width:
45
,
fit:
BoxFit
.
contain
,
fit:
BoxFit
.
contain
,
)
:
Image
.
asset
(
"assets/images/trans_credit.png"
,
height:
45
,
width:
45
,
fit:
BoxFit
.
contain
,
fit:
BoxFit
.
contain
,
),
),
),
...
...
@@ -424,12 +502,16 @@ class _AccountledgerState extends State<Accountledger> {
child:
SizedBox
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
CrossAxisAlignment
.
start
,
children:
[
Text
(
item
.
description
??
"-"
,
item
.
description
??
"-"
,
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
...
...
@@ -445,14 +527,18 @@ class _AccountledgerState extends State<Accountledger> {
flex:
3
,
child:
SizedBox
(
child:
RichText
(
textAlign:
TextAlign
.
right
,
textAlign:
TextAlign
.
right
,
maxLines:
1
,
overflow:
TextOverflow
.
ellipsis
,
overflow:
TextOverflow
.
ellipsis
,
text:
TextSpan
(
children:
[
TextSpan
(
text:
item
.
type
==
"Credit"
item
.
type
==
"Credit"
?
"-"
:
"+"
,
style:
TextStyle
(
...
...
@@ -517,10 +603,16 @@ class _AccountledgerState extends State<Accountledger> {
context,
MaterialPageRoute(
builder:
(context) => Transactiondetails(
paymentID: item.refId,
(context) =>
Transactiondetails(
paymentID:
item.refId,
type: item.type,
),
settings: RouteSettings(
name:
"
Transactiondetails
",
),
),
);
},
...
...
@@ -530,16 +622,20 @@ class _AccountledgerState extends State<Accountledger> {
),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
CrossAxisAlignment
.center,
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Text(
"
View
Details
",
style: TextStyle(
fontFamily: "
JakartaMedium
",
fontFamily:
"
JakartaMedium
",
fontSize: 14,
color: AppColors.app_blue,
color:
AppColors
.app_blue,
),
),
SizedBox(width: 5),
...
...
@@ -560,23 +656,15 @@ class _AccountledgerState extends State<Accountledger> {
},
),
],
],
),
),
),
),
),
onWillPop: () {
return _onBackPressed(context);
},
);
},
);
}
Future<void> _showFilterSheet(BuildContext context) {
return showModalBottomSheet(
useSafeArea: true,
...
...
@@ -593,7 +681,7 @@ class _AccountledgerState extends State<Accountledger> {
child: Consumer<Accountledgerprovider>(
builder: (context, provider, child) {
return Container(
height: MediaQuery.of(context).size.height
*
0.35,
height: MediaQuery.of(context).size.height
*
0.35,
padding: EdgeInsets.only(
bottom: MediaQuery.of(context).viewInsets.bottom,
),
...
...
@@ -653,7 +741,12 @@ class _AccountledgerState extends State<Accountledger> {
),
)
.toList(),
value:provider.accounts.contains(provider.selectedAccount)?provider.selectedAccount:null,
value:
provider.accounts.contains(
provider.selectedAccount,
)
? provider.selectedAccount
: null,
// value: provider.selectedAccount,
onChanged: (Accounts? value) {
if (value != null) {
...
...
@@ -678,14 +771,12 @@ class _AccountledgerState extends State<Accountledger> {
dropdownSearchData: DropdownSearchData(
searchInnerWidgetHeight: 50,
searchController:
provider
.searchAccountController,
provider.searchAccountController,
searchInnerWidget: Padding(
padding: const EdgeInsets.all(8),
child: TextFormField(
controller:
provider
.searchAccountController,
provider.searchAccountController,
decoration: InputDecoration(
isDense: true,
contentPadding:
...
...
@@ -720,8 +811,10 @@ class _AccountledgerState extends State<Accountledger> {
},
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
menuItemStyleData:
ddtheme.menuItemStyleData,
dropdownStyleData:
ddtheme.dropdownStyleData,
),
),
],
...
...
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
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'
;
...
...
@@ -7,6 +8,7 @@ import 'package:flutter_svg/svg.dart';
import
'package:generp/Notifiers/commonProvider/accountsListProvider.dart'
;
import
'package:generp/Utils/ShakeWidget.dart'
;
import
'package:generp/Utils/app_colors.dart'
;
import
'package:generp/Utils/commonServices.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:generp/Utils/dropdownTheme.dart'
;
import
'package:provider/provider.dart'
;
...
...
@@ -17,48 +19,71 @@ import '../../Models/commonModels/commonAddAccountsViewResponse.dart';
class
Addcommonpayment
extends
StatefulWidget
{
final
from
;
const
Addcommonpayment
({
super
.
key
,
required
this
.
from
});
const
Addcommonpayment
({
super
.
key
,
required
this
.
from
});
@override
State
<
Addcommonpayment
>
createState
()
=>
_AddcommonpaymentState
();
}
class
_AddcommonpaymentState
extends
State
<
Addcommonpayment
>{
class
_AddcommonpaymentState
extends
State
<
Addcommonpayment
>
{
Dropdowntheme
ddtheme
=
Dropdowntheme
();
List
<
FocusNode
>
focusNodes
=
List
.
generate
(
20
,
(
index
)
=>
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
prov
=
Provider
.
of
<
Accountslistprovider
>(
context
,
listen:
false
);
prov
.
addCommonAccountViewAPI
(
context
);
});
}
@override
void
dispose
()
{
focusNodes
.
map
((
e
)
=>
e
.
dispose
()
,
);
focusNodes
.
map
((
e
)
=>
e
.
dispose
());
super
.
dispose
();
_connectivity
.
disposeStream
();
}
@override
Widget
build
(
BuildContext
context
)
{
return
Consumer
<
Accountslistprovider
>(
builder:
(
context
,
provider
,
child
)
{
return
WillPopScope
(
onWillPop:
()
async
{
provider
.
resetValues
();
return
onBackPressed
(
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:
Platform
.
isIOS
?
false
:
true
,
child:
Scaffold
(
bottom:
true
,
child:
_scaffold
(
context
),
),
)
:
_scaffold
(
context
)
:
NoNetwork
(
context
);
}
Widget
_scaffold
(
BuildContext
context
)
{
return
Consumer
<
Accountslistprovider
>(
builder:
(
context
,
provider
,
child
)
{
return
Scaffold
(
resizeToAvoidBottomInset:
true
,
appBar:
appbar2
(
context
,
...
...
@@ -73,14 +98,8 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
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
),
...
...
@@ -118,17 +137,14 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
items:
provider
.
accountTypes
.
map
(
(
act
)
=>
DropdownMenuItem
<
String
>(
(
act
)
=>
DropdownMenuItem
<
String
>(
value:
act
,
child:
Text
(
act
,
style:
const
TextStyle
(
fontSize:
14
,
),
overflow:
TextOverflow
.
ellipsis
,
overflow:
TextOverflow
.
ellipsis
,
),
),
)
...
...
@@ -150,10 +166,8 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
},
buttonStyleData:
ddtheme
.
buttonStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
),
),
],
...
...
@@ -178,7 +192,7 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
null
,
focusNodes
[
0
],
focusNodes
[
1
],
TextInputAction
.
next
TextInputAction
.
next
,
),
errorWidget
(
context
,
provider
.
nameError
),
textControllerWidget
(
...
...
@@ -213,12 +227,10 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
false
,
null
,
focusNodes
[
12
],
focusNodes
[
13
],
TextInputAction
.
next
),
errorWidget
(
context
,
provider
.
contactPersonError
,
focusNodes
[
13
],
TextInputAction
.
next
,
),
errorWidget
(
context
,
provider
.
contactPersonError
),
],
),
),
...
...
@@ -226,8 +238,7 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
Column
(
children:
[
InkResponse
(
onTap:
()
=>
provider
.
isVisible
=
!
provider
.
isVisible
,
onTap:
()
=>
provider
.
isVisible
=
!
provider
.
isVisible
,
child:
Center
(
child:
Text
(
provider
.
isVisible
...
...
@@ -241,13 +252,13 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
),
),
),
if
(
provider
.
addMoreDetailsError
!=
null
)...[
if
(
provider
.
addMoreDetailsError
!=
null
)
...[
Center
(
child:
ShakeWidget
(
key:
Key
(
"value"
),
duration:
Duration
(
milliseconds:
700
),
child:
Text
(
provider
.
addMoreDetailsError
??
""
,
provider
.
addMoreDetailsError
??
""
,
style:
TextStyle
(
color:
Colors
.
red
,
fontSize:
13
,
...
...
@@ -262,7 +273,6 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
...
...
@@ -277,8 +287,7 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
"State"
),
DropdownButtonHideUnderline
(
...
...
@@ -287,7 +296,10 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
Expanded
(
child:
DropdownButton2
<
States
>(
focusNode:
focusNodes
[
2
],
autofocus:
focusNodes
[
2
].
hasFocus
?
true
:
false
,
autofocus:
focusNodes
[
2
].
hasFocus
?
true
:
false
,
isExpanded:
true
,
hint:
Text
(
'Select State'
,
...
...
@@ -297,12 +309,16 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
items:
provider
.
states
.
map
(
(
states
)
=>
DropdownMenuItem
<
States
>(
(
states
,
)
=>
DropdownMenuItem
<
States
>(
value:
states
,
child:
Text
(
states
.
name
??
''
,
style:
const
TextStyle
(
style:
const
TextStyle
(
fontSize:
14
,
),
overflow:
...
...
@@ -321,8 +337,11 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
// value: provider.selectedState,
onChanged:
(
States
?
value
)
{
if
(
value
!=
null
)
{
if
(
provider
.
states
.
isNotEmpty
)
{
provider
.
selectedState
=
value
;
if
(
provider
.
states
.
isNotEmpty
)
{
provider
.
selectedState
=
value
;
print
(
"Selected Complaint Type:
${value.name}
, ID:
${value.id}
"
,
);
...
...
@@ -333,7 +352,8 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
provider
.
selectedStateID
.
toString
(),
);
if
(
provider
.
selectedDistricts
!=
if
(
provider
.
selectedDistricts
!=
null
)
{
provider
.
states
.
clear
();
// provider.selectedDistricts = null;
...
...
@@ -354,12 +374,16 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
dropdownSearchData:
DropdownSearchData
(
searchInnerWidgetHeight:
50
,
searchController:
provider
.
stateSearchController
,
provider
.
stateSearchController
,
searchInnerWidget:
Padding
(
padding:
const
EdgeInsets
.
all
(
8
),
padding:
const
EdgeInsets
.
all
(
8
,
),
child:
TextFormField
(
controller:
provider
.
stateSearchController
,
provider
.
stateSearchController
,
decoration:
InputDecoration
(
isDense:
true
,
contentPadding:
...
...
@@ -367,19 +391,26 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
horizontal:
10
,
vertical:
8
,
),
hintText:
'Search States...'
,
hintText:
'Search States...'
,
border:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
circular
(
8
),
BorderRadius
.
circular
(
8
,
),
),
),
),
searchMatchFn:
(
item
,
searchValue
)
{
),
searchMatchFn:
(
item
,
searchValue
,
)
{
return
item
.
value
?.
name
?.
toLowerCase
()
.
contains
(
searchValue
.
toLowerCase
(),
searchValue
.
toLowerCase
(),
)
??
false
;
},
...
...
@@ -390,8 +421,10 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
.
clear
();
}
},
buttonStyleData:
ddtheme
.
buttonStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
buttonStyleData:
ddtheme
.
buttonStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
...
...
@@ -418,12 +451,16 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
items:
provider
.
districts
.
map
(
(
dist
)
=>
DropdownMenuItem
<
Districts
>(
(
dist
,
)
=>
DropdownMenuItem
<
Districts
>(
value:
dist
,
child:
Text
(
dist
.
district
??
''
,
style:
const
TextStyle
(
style:
const
TextStyle
(
fontSize:
14
,
),
overflow:
...
...
@@ -435,30 +472,39 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
.
toList
(),
value:
provider
.
districts
.
contains
(
provider
.
selectedDistricts
,
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}
"
);
if
(
provider
.
districts
.
isNotEmpty
)
{
provider
.
selectedDistricts
=
value
;
print
(
"Selected ID:
${value.id}
"
,
);
provider
.
selectedDistrictId
=
value
.
id
!;
provider
.
selectedDistrictValue
=
value
.
district
!;
print
(
"hfjkshfg"
+
provider
.
selectedDistrictId
provider
.
selectedDistrictId
.
toString
(),
);
if
(
provider
.
selectedSubLocations
!=
if
(
provider
.
selectedSubLocations
!=
null
)
{
// provider.selectedSubLocations =
// null;
provider
.
selectedSubLocID
=
null
;
provider
.
selectedSubLocID
=
null
;
provider
.
selectedSubLocValue
=
null
;
}
...
...
@@ -472,9 +518,12 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
dropdownSearchData:
DropdownSearchData
(
searchInnerWidgetHeight:
50
,
searchController:
provider
.
districtSearchController
,
provider
.
districtSearchController
,
searchInnerWidget:
Padding
(
padding:
const
EdgeInsets
.
all
(
8
),
padding:
const
EdgeInsets
.
all
(
8
,
),
child:
TextFormField
(
controller:
provider
...
...
@@ -486,31 +535,41 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
horizontal:
10
,
vertical:
8
,
),
hintText:
'Search Districts...'
,
hintText:
'Search Districts...'
,
border:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
circular
(
8
),
BorderRadius
.
circular
(
8
,
),
),
),
),
),
searchMatchFn:
(
item
,
searchValue
)
{
searchMatchFn:
(
item
,
searchValue
,
)
{
return
item
.
value
?.
district
?.
toLowerCase
()
.
contains
(
searchValue
.
toLowerCase
(),
searchValue
.
toLowerCase
(),
)
??
false
;
},
),
onMenuStateChange:
(
isOpen
)
{
if
(!
isOpen
)
{
provider
.
districtSearchController
provider
.
districtSearchController
.
clear
();
}
},
buttonStyleData:
ddtheme
.
buttonStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
buttonStyleData:
ddtheme
.
buttonStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
...
...
@@ -537,17 +596,22 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
items:
provider
.
subLocations
.
map
(
(
subloc
)
=>
DropdownMenuItem
<
(
subloc
,
)
=>
DropdownMenuItem
<
SubLocations
>(
value:
subloc
,
child:
Text
(
subloc
.
subLocality
??
''
,
style:
const
TextStyle
(
subloc
.
subLocality
??
''
,
style:
const
TextStyle
(
fontSize:
14
,
),
overflow:
TextOverflow
.
ellipsis
,
TextOverflow
.
ellipsis
,
),
),
)
...
...
@@ -555,9 +619,11 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
// value: provider.selectedSubLocations,
value:
provider
.
subLocations
.
contains
(
provider
.
selectedSubLocations
,
provider
.
selectedSubLocations
,
)
?
provider
.
selectedSubLocations
?
provider
.
selectedSubLocations
:
null
,
onChanged:
(
SubLocations
?
value
)
{
if
(
value
!=
null
)
{
...
...
@@ -566,14 +632,17 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
.
isNotEmpty
)
{
provider
.
selectedSubLocations
=
value
;
print
(
"Selected ID:
${value.id}
"
);
print
(
"Selected ID:
${value.id}
"
,
);
provider
.
selectedSubLocID
=
value
.
id
!;
provider
.
selectedSubLocValue
=
value
.
subLocality
!;
print
(
"hfjkshfg"
+
provider
.
selectedSubLocID
provider
.
selectedSubLocID
.
toString
(),
);
}
...
...
@@ -582,12 +651,16 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
dropdownSearchData:
DropdownSearchData
(
searchInnerWidgetHeight:
50
,
searchController:
provider
.
subLocSearchController
,
provider
.
subLocSearchController
,
searchInnerWidget:
Padding
(
padding:
const
EdgeInsets
.
all
(
8
),
padding:
const
EdgeInsets
.
all
(
8
,
),
child:
TextFormField
(
controller:
provider
.
subLocSearchController
,
provider
.
subLocSearchController
,
decoration:
InputDecoration
(
isDense:
true
,
contentPadding:
...
...
@@ -599,16 +672,22 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
'Search Sub Locality...'
,
border:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
circular
(
8
),
BorderRadius
.
circular
(
8
,
),
),
),
),
),
searchMatchFn:
(
item
,
searchValue
)
{
searchMatchFn:
(
item
,
searchValue
,
)
{
return
item
.
value
?.
subLocality
?.
toLowerCase
()
.
contains
(
searchValue
.
toLowerCase
(),
searchValue
.
toLowerCase
(),
)
??
false
;
},
...
...
@@ -619,8 +698,10 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
.
clear
();
}
},
buttonStyleData:
ddtheme
.
buttonStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
buttonStyleData:
ddtheme
.
buttonStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
...
...
@@ -643,7 +724,6 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
focusNodes
[
5
],
null
,
TextInputAction
.
done
,
),
errorWidget
(
context
,
provider
.
addressError
),
Text
(
...
...
@@ -667,10 +747,7 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
focusNodes
[
7
],
TextInputAction
.
next
,
),
errorWidget
(
context
,
provider
.
banknameError
,
),
errorWidget
(
context
,
provider
.
banknameError
),
textControllerWidget
(
context
,
provider
.
branchNameController
,
...
...
@@ -680,7 +757,9 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
TextInputType
.
text
,
false
,
null
,
focusNodes
[
7
],
focusNodes
[
8
],
TextInputAction
.
next
focusNodes
[
7
],
focusNodes
[
8
],
TextInputAction
.
next
,
),
errorWidget
(
context
,
...
...
@@ -696,12 +775,10 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
false
,
null
,
focusNodes
[
8
],
focusNodes
[
9
],
TextInputAction
.
next
),
errorWidget
(
context
,
provider
.
bankIFSCError
,
focusNodes
[
9
],
TextInputAction
.
next
,
),
errorWidget
(
context
,
provider
.
bankIFSCError
),
textControllerWidget
(
context
,
provider
.
bankHolderNameController
,
...
...
@@ -712,7 +789,8 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
false
,
null
,
focusNodes
[
9
],
focusNodes
[
10
],
TextInputAction
.
next
focusNodes
[
10
],
TextInputAction
.
next
,
),
errorWidget
(
context
,
...
...
@@ -728,7 +806,8 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
false
,
FilteringTextInputFormatter
.
digitsOnly
,
focusNodes
[
10
],
focusNodes
[
11
],
TextInputAction
.
next
focusNodes
[
11
],
TextInputAction
.
next
,
),
errorWidget
(
context
,
...
...
@@ -745,7 +824,7 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
null
,
focusNodes
[
11
],
focusNodes
[
12
],
TextInputAction
.
next
TextInputAction
.
next
,
),
errorWidget
(
context
,
provider
.
upiError
),
],
...
...
@@ -765,8 +844,7 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
"Contact Details"
,
...
...
@@ -779,8 +857,7 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
textControllerWidget
(
context
,
provider
.
contectPersonDesignationController
,
provider
.
contectPersonDesignationController
,
"Contact Person Designation"
,
"Enter Contact Person Designation"
,
provider
.
updateDesignation
,
...
...
@@ -788,7 +865,8 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
false
,
null
,
focusNodes
[
13
],
focusNodes
[
14
],
TextInputAction
.
next
focusNodes
[
14
],
TextInputAction
.
next
,
),
errorWidget
(
context
,
...
...
@@ -813,13 +891,11 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
false
,
FilteringTextInputFormatter
.
digitsOnly
,
focusNodes
[
14
],
focusNodes
[
15
],
TextInputAction
.
next
,
focusNodes
[
15
],
TextInputAction
.
next
,
10
,
),
errorWidget
(
context
,
provider
.
altMobError
,
),
errorWidget
(
context
,
provider
.
altMobError
),
textControllerWidget
(
context
,
provider
.
contectPersonTeleController
,
...
...
@@ -830,7 +906,8 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
false
,
FilteringTextInputFormatter
.
digitsOnly
,
focusNodes
[
15
],
focusNodes
[
16
],
TextInputAction
.
next
focusNodes
[
16
],
TextInputAction
.
next
,
),
errorWidget
(
context
,
provider
.
teleError
),
textControllerWidget
(
...
...
@@ -843,7 +920,8 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
false
,
null
,
focusNodes
[
16
],
focusNodes
[
17
],
TextInputAction
.
next
focusNodes
[
17
],
TextInputAction
.
next
,
),
errorWidget
(
context
,
provider
.
mailError
),
],
...
...
@@ -865,7 +943,7 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
?
null
:
()
{
provider
.
submitClickced
=
true
;
provider
.
submitCommonAccountsAPI
(
context
,
widget
.
from
);
provider
.
submitCommonAccountsAPI
(
context
,
widget
.
from
);
},
child:
Container
(
height:
45
,
...
...
@@ -891,8 +969,6 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
),
),
),
),
),
);
},
);
...
...
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
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:generp/Notifiers/crmProvider/addProspectLeadsProvider.dart'
;
import
'package:generp/Utils/commonServices.dart'
;
import
'package:generp/Utils/dropdownTheme.dart'
;
import
'package:provider/provider.dart'
;
import
'../../Models/crmModels/crmProspectDetailsAddLeadsResponse.dart'
;
...
...
@@ -23,31 +25,68 @@ class AddProspectLeads extends StatefulWidget {
class
_AddProspectLeadsState
extends
State
<
AddProspectLeads
>
{
Dropdowntheme
ddtheme
=
Dropdowntheme
();
Map
_source
=
{
ConnectivityResult
.
mobile
:
true
};
final
MyConnectivity
_connectivity
=
MyConnectivity
.
instance
;
@override
void
initState
()
{
super
.
initState
();
_connectivity
.
initialise
();
_connectivity
.
myStream
.
listen
((
source
)
{
setState
(()
=>
_source
=
source
);
});
WidgetsBinding
.
instance
.
addPostFrameCallback
((
_
)
async
{
final
provider
=
Provider
.
of
<
Addprospectleadsprovider
>(
context
,
listen:
false
);
await
provider
.
crmProspectDetailsAddLeadsViewAPIFunction
(
context
,
widget
.
mode
);
final
provider
=
Provider
.
of
<
Addprospectleadsprovider
>(
context
,
listen:
false
,
);
await
provider
.
crmProspectDetailsAddLeadsViewAPIFunction
(
context
,
widget
.
mode
,
);
// Initialize controllers and dropdowns after API call
provider
.
initializeForm
(
context
);
});
}
@override
void
dispose
()
{
// TODO: implement dispose
super
.
dispose
();
_connectivity
.
disposeStream
();
}
@override
Widget
build
(
BuildContext
context
)
{
return
Consumer
<
Addprospectleadsprovider
>(
builder:
(
context
,
editProvider
,
child
)
{
return
WillPopScope
(
onWillPop:
()
async
{
editProvider
.
resetForm
();
return
true
;
},
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
<
Addprospectleadsprovider
>(
builder:
(
context
,
editProvider
,
child
)
{
return
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
white
,
appBar:
appbar2
(
...
...
@@ -75,22 +114,18 @@ class _AddProspectLeadsState extends State<AddProspectLeads> {
items:
editProvider
.
employeeList
.
map
(
(
slist
)
=>
DropdownMenuItem
<
Employees
>(
(
slist
)
=>
DropdownMenuItem
<
Employees
>(
value:
slist
,
child:
Text
(
slist
.
name
!,
style:
TextStyle
(
fontSize:
14
,
),
style:
TextStyle
(
fontSize:
14
),
),
),
)
.
toList
(),
value:
editProvider
.
employeeList
.
contains
(
editProvider
.
selectedEmployee
,
editProvider
.
selectedEmployee
,
)
?
editProvider
.
selectedEmployee
:
null
,
...
...
@@ -98,15 +133,10 @@ class _AddProspectLeadsState extends State<AddProspectLeads> {
// value: provider.selectedEmployees,
onChanged:
(
Employees
?
value
)
{
if
(
value
!=
null
)
{
if
(
editProvider
.
employeeList
.
isNotEmpty
)
{
editProvider
.
selectedEmployee
=
value
;
editProvider
.
selectedEmployeeId
=
value
!.
id
!;
editProvider
.
selectedEmployeeValue
=
if
(
editProvider
.
employeeList
.
isNotEmpty
)
{
editProvider
.
selectedEmployee
=
value
;
editProvider
.
selectedEmployeeId
=
value
!.
id
!;
editProvider
.
selectedEmployeeValue
=
value
!.
name
!;
}
}
...
...
@@ -114,32 +144,26 @@ class _AddProspectLeadsState extends State<AddProspectLeads> {
isExpanded:
true
,
dropdownSearchData:
DropdownSearchData
(
searchInnerWidgetHeight:
50
,
searchController:
editProvider
.
searchController
,
searchController:
editProvider
.
searchController
,
searchInnerWidget:
Padding
(
padding:
const
EdgeInsets
.
all
(
8
),
child:
TextFormField
(
controller:
editProvider
.
searchController
,
controller:
editProvider
.
searchController
,
decoration:
InputDecoration
(
isDense:
true
,
contentPadding:
const
EdgeInsets
.
symmetric
(
contentPadding:
const
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
8
,
),
hintText:
'Search account...'
,
border:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
circular
(
8
),
borderRadius:
BorderRadius
.
circular
(
8
),
),
),
),
),
searchMatchFn:
(
item
,
searchValue
)
{
return
item
.
value
?.
name
?.
toLowerCase
()
.
contains
(
return
item
.
value
?.
name
?.
toLowerCase
().
contains
(
searchValue
.
toLowerCase
(),
)
??
false
;
...
...
@@ -147,23 +171,19 @@ class _AddProspectLeadsState extends State<AddProspectLeads> {
),
onMenuStateChange:
(
isOpen
)
{
if
(!
isOpen
)
{
editProvider
.
searchController
.
clear
();
editProvider
.
searchController
.
clear
();
}
},
buttonStyleData:
ddtheme
.
buttonStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
),
),
],
),
),
InkResponse
(
onTap:
()
{
editProvider
.
editAddNewRow
();
...
...
@@ -192,14 +212,18 @@ class _AddProspectLeadsState extends State<AddProspectLeads> {
),
),
if
(
editProvider
.
leadProductsList
.
isNotEmpty
||
editProvider
.
editProductPriceControllers
.
isNotEmpty
)...[
editProvider
.
editProductPriceControllers
.
isNotEmpty
)
...[
ListView
.
builder
(
itemCount:
editProvider
.
editProductPriceControllers
.
length
,
itemCount:
editProvider
.
editProductPriceControllers
.
length
,
physics:
const
NeverScrollableScrollPhysics
(),
shrinkWrap:
true
,
itemBuilder:
(
context
,
j
)
{
return
Container
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
margin:
const
EdgeInsets
.
symmetric
(
vertical:
10
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
...
...
@@ -220,34 +244,58 @@ class _AddProspectLeadsState extends State<AddProspectLeads> {
style:
TextStyle
(
fontSize:
14
),
overflow:
TextOverflow
.
ellipsis
,
),
items:
editProvider
.
leadProductsList
.
map
((
ord
)
=>
DropdownMenuItem
<
Products
>(
items:
editProvider
.
leadProductsList
.
map
(
(
ord
)
=>
DropdownMenuItem
<
Products
>(
value:
ord
,
child:
Text
(
"(Product Name:
${ord.name}
)"
,
style:
const
TextStyle
(
fontSize:
14
),
overflow:
TextOverflow
.
ellipsis
,
style:
const
TextStyle
(
fontSize:
14
,
),
overflow:
TextOverflow
.
ellipsis
,
),
),
)
)
)
.
toList
(),
value:
editProvider
.
selectedProductIds
[
j
]
!=
null
?
editProvider
.
leadProductsList
.
firstWhere
(
(
ord
)
=>
ord
.
id
==
editProvider
.
selectedProductIds
[
j
],
orElse:
()
=>
editProvider
.
leadProductsList
[
0
],
value:
editProvider
.
selectedProductIds
[
j
]
!=
null
?
editProvider
.
leadProductsList
.
firstWhere
(
(
ord
)
=>
ord
.
id
==
editProvider
.
selectedProductIds
[
j
],
orElse:
()
=>
editProvider
.
leadProductsList
[
0
],
)
:
null
,
onChanged:
(
Products
?
value
)
{
if
(
value
!=
null
)
{
editProvider
.
updateSelectedProductIds
(
j
,
value
);
editProvider
.
updateSelectedProductIds
(
j
,
value
,
);
editProvider
.
selectedProductIds
[
j
]
=
value
.
id
?.
toString
()
??
''
;
editProvider
.
updateTotalAmount
(
j
);
}
},
buttonStyleData:
ddtheme
.
buttonStyleData
,
buttonStyleData:
ddtheme
.
buttonStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
),
),
],
...
...
@@ -260,10 +308,12 @@ class _AddProspectLeadsState extends State<AddProspectLeads> {
flex:
2
,
child:
textControllerWidget
(
context
,
editProvider
.
editProductPriceControllers
[
j
],
editProvider
.
editProductPriceControllers
[
j
],
"Product Price"
,
"Enter Product Price"
,
(
value
)
=>
editProvider
.
updateTotalAmount
(
j
),
(
value
)
=>
editProvider
.
updateTotalAmount
(
j
),
TextInputType
.
number
,
false
,
FilteringTextInputFormatter
.
digitsOnly
,
...
...
@@ -281,7 +331,8 @@ class _AddProspectLeadsState extends State<AddProspectLeads> {
editProvider
.
editQuantityControllers
[
j
],
"Quantity"
,
"Enter Quantity"
,
(
value
)
=>
editProvider
.
updateTotalAmount
(
j
),
(
value
)
=>
editProvider
.
updateTotalAmount
(
j
),
TextInputType
.
number
,
false
,
FilteringTextInputFormatter
.
digitsOnly
,
...
...
@@ -296,7 +347,8 @@ class _AddProspectLeadsState extends State<AddProspectLeads> {
flex:
2
,
child:
textControllerWidget
(
context
,
editProvider
.
editTotalAmountControllers
[
j
],
editProvider
.
editTotalAmountControllers
[
j
],
"Total Amount"
,
"Enter Total Amount"
,
(
_
)
{},
...
...
@@ -307,7 +359,6 @@ class _AddProspectLeadsState extends State<AddProspectLeads> {
),
],
),
],
),
);
...
...
@@ -321,20 +372,17 @@ class _AddProspectLeadsState extends State<AddProspectLeads> {
Expanded
(
child:
DropdownButton2
<
String
>(
hint:
Text
(
"Select S
alutation
"
,
"Select S
tatus
"
,
style:
TextStyle
(
fontSize:
14
),
),
items:
editProvider
.
statusList
.
map
(
(
slist
)
=>
DropdownMenuItem
<
String
>(
(
slist
)
=>
DropdownMenuItem
<
String
>(
value:
slist
,
child:
Text
(
slist
,
style:
TextStyle
(
fontSize:
14
,
),
style:
TextStyle
(
fontSize:
14
),
),
),
)
...
...
@@ -342,9 +390,7 @@ class _AddProspectLeadsState extends State<AddProspectLeads> {
value:
editProvider
.
selectedStatus
,
onChanged:
(
String
?
value
)
{
if
(
value
!=
null
)
{
if
(
editProvider
.
statusList
.
isNotEmpty
)
{
if
(
editProvider
.
statusList
.
isNotEmpty
)
{
editProvider
.
selectedStatus
=
value
;
}
}
...
...
@@ -352,10 +398,8 @@ class _AddProspectLeadsState extends State<AddProspectLeads> {
isExpanded:
true
,
buttonStyleData:
ddtheme
.
buttonStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
),
),
],
...
...
@@ -365,14 +409,21 @@ class _AddProspectLeadsState extends State<AddProspectLeads> {
),
),
),
floatingActionButtonLocation:
FloatingActionButtonLocation
.
centerFloat
,
floatingActionButtonLocation:
FloatingActionButtonLocation
.
centerFloat
,
bottomNavigationBar:
InkResponse
(
onTap:
editProvider
.
submitLoading
onTap:
editProvider
.
submitLoading
?
null
:
()
{
editProvider
.
submitForm
(
context
,
widget
.
mode
,
widget
.
leadID
,
editProvider
.
selectedEmployeeId
,
editProvider
.
selectedStatus
);
editProvider
.
submitForm
(
context
,
widget
.
mode
,
widget
.
leadID
,
editProvider
.
selectedEmployeeId
,
editProvider
.
selectedStatus
,
);
// editProvider.crmProspectDetailsAddLeadsSubmitAPIFunction(context, mode, account_id, acc_manager_id, products, lead_status)
},
child:
Container
(
height:
45
,
...
...
@@ -383,9 +434,12 @@ class _AddProspectLeadsState extends State<AddProspectLeads> {
color:
AppColors
.
app_blue
,
borderRadius:
BorderRadius
.
circular
(
15
),
),
child:
editProvider
.
submitLoading
child:
editProvider
.
submitLoading
?
CircularProgressIndicator
.
adaptive
(
valueColor:
AlwaysStoppedAnimation
<
Color
>(
AppColors
.
app_blue
),
valueColor:
AlwaysStoppedAnimation
<
Color
>(
AppColors
.
app_blue
,
),
)
:
const
Text
(
"Submit"
,
...
...
@@ -397,8 +451,6 @@ class _AddProspectLeadsState extends State<AddProspectLeads> {
),
),
),
),
),
);
},
);
...
...
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