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

ios changes in Navigation swipe gestures.

parent ee178d55
PODS: PODS:
- app_settings (5.1.1):
- Flutter
- camera_avfoundation (0.0.1): - camera_avfoundation (0.0.1):
- Flutter - Flutter
- connectivity_plus (0.0.1): - connectivity_plus (0.0.1):
...@@ -167,6 +169,7 @@ PODS: ...@@ -167,6 +169,7 @@ PODS:
- FlutterMacOS - FlutterMacOS
DEPENDENCIES: DEPENDENCIES:
- app_settings (from `.symlinks/plugins/app_settings/ios`)
- camera_avfoundation (from `.symlinks/plugins/camera_avfoundation/ios`) - camera_avfoundation (from `.symlinks/plugins/camera_avfoundation/ios`)
- connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`) - connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`)
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`) - device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
...@@ -219,6 +222,8 @@ SPEC REPOS: ...@@ -219,6 +222,8 @@ SPEC REPOS:
- SDWebImageWebPCoder - SDWebImageWebPCoder
EXTERNAL SOURCES: EXTERNAL SOURCES:
app_settings:
:path: ".symlinks/plugins/app_settings/ios"
camera_avfoundation: camera_avfoundation:
:path: ".symlinks/plugins/camera_avfoundation/ios" :path: ".symlinks/plugins/camera_avfoundation/ios"
connectivity_plus: connectivity_plus:
...@@ -281,6 +286,7 @@ EXTERNAL SOURCES: ...@@ -281,6 +286,7 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/webview_flutter_wkwebview/darwin" :path: ".symlinks/plugins/webview_flutter_wkwebview/darwin"
SPEC CHECKSUMS: SPEC CHECKSUMS:
app_settings: 58017cd26b604ae98c3e65acbdd8ba173703cc82
camera_avfoundation: adb0207d868b2d873e895371d88448399ab78d87 camera_avfoundation: adb0207d868b2d873e895371d88448399ab78d87
connectivity_plus: 2a701ffec2c0ae28a48cf7540e279787e77c447d connectivity_plus: 2a701ffec2c0ae28a48cf7540e279787e77c447d
device_info_plus: bf2e3232933866d73fe290f2942f2156cdd10342 device_info_plus: bf2e3232933866d73fe290f2942f2156cdd10342
......
...@@ -610,6 +610,7 @@ class Accountslistprovider extends ChangeNotifier { ...@@ -610,6 +610,7 @@ class Accountslistprovider extends ChangeNotifier {
} }
resetValues() { resetValues() {
print("rv");
_selectedAccountType = null; _selectedAccountType = null;
_selectedState = null; _selectedState = null;
_selectedDistricts = null; _selectedDistricts = null;
......
...@@ -975,6 +975,7 @@ class Requestionlistprovider extends ChangeNotifier { ...@@ -975,6 +975,7 @@ class Requestionlistprovider extends ChangeNotifier {
// } // }
void resetForm() { void resetForm() {
print("ios calling");
_submitClicked = false; _submitClicked = false;
accountSearchController.clear(); accountSearchController.clear();
paymentAccountSearchController.clear(); paymentAccountSearchController.clear();
......
...@@ -448,10 +448,10 @@ class Paymentreceiptsprovider extends ChangeNotifier { ...@@ -448,10 +448,10 @@ class Paymentreceiptsprovider extends ChangeNotifier {
...data.receiptAccounts!, ...data.receiptAccounts!,
]; ];
_receiptPaymentModes = data.paymentModes!; _receiptPaymentModes = data.paymentModes!;
_receiptPaymentModes = [PaymentModes( _receiptPaymentModes = [
name: "Select", PaymentModes(name: "Select", id: ""),
id: "" ...data.paymentModes!,
),...data.paymentModes!]; ];
_receiptAccounts = data.accounts!; _receiptAccounts = data.accounts!;
_receiptAccounts = [ _receiptAccounts = [
Accounts(name: "Select", id: ""), Accounts(name: "Select", id: ""),
...@@ -709,6 +709,7 @@ class Paymentreceiptsprovider extends ChangeNotifier { ...@@ -709,6 +709,7 @@ class Paymentreceiptsprovider extends ChangeNotifier {
} }
void resetForm() { void resetForm() {
print("rf");
_submitClicked = false; _submitClicked = false;
accountSearchController.clear(); accountSearchController.clear();
paymentAccountSearchController.clear(); paymentAccountSearchController.clear();
......
String didPushed = ""; String didPushed = "";
String didPopped = ""; String didPopped = "";
String routeSettingName = "";
...@@ -208,11 +208,10 @@ NoNetwork(context) { ...@@ -208,11 +208,10 @@ NoNetwork(context) {
// Image.asset('assets/images/no_wifi.png', width: 100, height: 100), // Image.asset('assets/images/no_wifi.png', width: 100, height: 100),
SizedBox(height: 10), SizedBox(height: 10),
Center( Center(
child: Text("You are Offline", child: Text(
style: TextStyle( "You are Offline",
fontSize: 16, style: TextStyle(fontSize: 16, color: AppColors.semi_black),
color: AppColors.semi_black ),
),),
), ),
SizedBox(height: 10), SizedBox(height: 10),
Text( Text(
...@@ -306,16 +305,18 @@ class MyNavigatorObserver extends NavigatorObserver { ...@@ -306,16 +305,18 @@ class MyNavigatorObserver extends NavigatorObserver {
super.didPush(route, previousRoute); super.didPush(route, previousRoute);
// Called when a route has been pushed onto the navigator. // Called when a route has been pushed onto the navigator.
didPushed = "true"; didPushed = "true";
routeSettingName = route.settings.name.toString();
print('Route pushed: ${route.settings.name}'); print('Route pushed: ${route.settings.name}');
print('didPushed$didPushed'); print('didPushed: $didPushed');
} }
@override @override
void didPop(Route route, Route? previousRoute) { void didPop(Route route, Route? previousRoute) {
super.didPop(route, previousRoute); super.didPop(route, previousRoute);
didPopped = "true"; didPopped = "true";
routeSettingName = route.settings.name.toString();
// Called when a route has been popped off the navigator. // Called when a route has been popped off the navigator.
print('Route popped: ${route.settings.name}'); print('Route popped: ${route.settings.name}');
print('didPopped${didPopped}'); print('didPopped: ${didPopped}');
} }
} }
import 'dart:io'; import 'dart:io';
import 'package:auto_size_text/auto_size_text.dart'; 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:dropdown_button2/dropdown_button2.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:generp/Notifiers/commonProvider/accountLedgerProvider.dart'; import 'package:generp/Notifiers/commonProvider/accountLedgerProvider.dart';
import 'package:generp/Utils/commonServices.dart';
import 'package:generp/screens/commom/transactionDetails.dart'; import 'package:generp/screens/commom/transactionDetails.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
...@@ -24,10 +26,17 @@ class Accountledger extends StatefulWidget { ...@@ -24,10 +26,17 @@ class Accountledger extends StatefulWidget {
class _AccountledgerState extends State<Accountledger> { class _AccountledgerState extends State<Accountledger> {
Dropdowntheme ddtheme = Dropdowntheme(); Dropdowntheme ddtheme = Dropdowntheme();
Map _source = {ConnectivityResult.mobile: true};
final MyConnectivity _connectivity = MyConnectivity.instance;
@override @override
void initState() { void initState() {
// TODO: implement initState // TODO: implement initState
super.initState(); super.initState();
_connectivity.initialise();
_connectivity.myStream.listen((source) {
setState(() => _source = source);
});
WidgetsBinding.instance.addPostFrameCallback((timeStamp) { WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
var provider = Provider.of<Accountledgerprovider>(context, listen: false); var provider = Provider.of<Accountledgerprovider>(context, listen: false);
provider.dropDownAPI(context); provider.dropDownAPI(context);
...@@ -35,13 +44,48 @@ class _AccountledgerState extends State<Accountledger> { ...@@ -35,13 +44,48 @@ class _AccountledgerState extends State<Accountledger> {
_showFilterSheet(context); _showFilterSheet(context);
}); });
} }
Future<bool> _onBackPressed(BuildContext context) async { Future<bool> _onBackPressed(BuildContext context) async {
Provider.of<Accountledgerprovider>(context, listen: false).resetAll(); Provider.of<Accountledgerprovider>(context, listen: false).resetAll();
Navigator.pop(context, true); Navigator.pop(context, true);
return true; return true;
} }
@override
void dispose() {
// TODO: implement dispose
super.dispose();
_connectivity.disposeStream();
}
@override @override
Widget build(BuildContext context) { 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>( return Consumer<Accountledgerprovider>(
builder: (context, provider, child) { builder: (context, provider, child) {
final groupedData = provider.groupByDate(provider.ledgerList); final groupedData = provider.groupByDate(provider.ledgerList);
...@@ -70,7 +114,7 @@ class _AccountledgerState extends State<Accountledger> { ...@@ -70,7 +114,7 @@ class _AccountledgerState extends State<Accountledger> {
"Bank UPI ID", "Bank UPI ID",
"State", "State",
"District", "District",
"Sub Locality" "Sub Locality",
]; ];
var values = [ var values = [
...@@ -97,11 +141,7 @@ class _AccountledgerState extends State<Accountledger> { ...@@ -97,11 +141,7 @@ class _AccountledgerState extends State<Accountledger> {
totalHeadings = [...headings, ...headings2]; totalHeadings = [...headings, ...headings2];
totalValues = [...values, ...values2]; totalValues = [...values, ...values2];
} }
return WillPopScope( return Scaffold(
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
appBar: appbar2( appBar: appbar2(
context, context,
...@@ -110,23 +150,23 @@ class _AccountledgerState extends State<Accountledger> { ...@@ -110,23 +150,23 @@ class _AccountledgerState extends State<Accountledger> {
Row( Row(
children: [ children: [
Container( Container(
padding: EdgeInsets.symmetric(horizontal: 5,vertical: 5), padding: EdgeInsets.symmetric(horizontal: 5, vertical: 5),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFFE6F6FF), color: Color(0xFFE6F6FF),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
child: Row( child: Row(
children: [ children: [
SvgPicture.asset("assets/svg/fin_ic.svg",height: 12,), SvgPicture.asset("assets/svg/fin_ic.svg", height: 12),
SizedBox(width: 5,), SizedBox(width: 5),
Text("${provider.balanceDetails.balance.toString()}"??"-",style: TextStyle( Text(
fontSize: 12, "${provider.balanceDetails.balance.toString()}" ?? "-",
),) style: TextStyle(fontSize: 12),
),
], ],
), ),
),SizedBox(width: 10,), ),
SizedBox(width: 10),
Container( Container(
padding: EdgeInsets.symmetric(horizontal: 5, vertical: 5), padding: EdgeInsets.symmetric(horizontal: 5, vertical: 5),
...@@ -136,30 +176,41 @@ class _AccountledgerState extends State<Accountledger> { ...@@ -136,30 +176,41 @@ class _AccountledgerState extends State<Accountledger> {
_showFilterSheet(context); _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, backgroundColor: AppColors.scaffold_bg_color,
body: provider.isLoading body:
? Center(child: CircularProgressIndicator.adaptive( provider.isLoading
? Center(
child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>( valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue) AppColors.app_blue,
)):SizedBox( ),
),
)
: SizedBox(
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.all(8.0), 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), Emptywidget(context),
]else...[ ] else ...[
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
...@@ -182,22 +233,26 @@ class _AccountledgerState extends State<Accountledger> { ...@@ -182,22 +233,26 @@ class _AccountledgerState extends State<Accountledger> {
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(16),
), ),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
AutoSizeText( AutoSizeText(
"${provider.balanceDetails.totalCredit}", "${provider.balanceDetails.totalCredit}",
style: TextStyle( style: TextStyle(
color: Color(0xFFED3424), color: Color(0xFFED3424),
fontFamily: "JakartaRegular", fontFamily: "JakartaRegular",
fontSize: 20, fontSize: 25,
), ),
minFontSize: 20, maxLines: 2,
minFontSize: 18,
maxFontSize: 25, maxFontSize: 25,
), ),
Text( Text(
"credit", "credit",
style: TextStyle(color: Color(0xFF818181)), style: TextStyle(
color: Color(0xFF818181),
),
), ),
], ],
), ),
...@@ -218,21 +273,25 @@ class _AccountledgerState extends State<Accountledger> { ...@@ -218,21 +273,25 @@ class _AccountledgerState extends State<Accountledger> {
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(16),
), ),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
AutoSizeText( AutoSizeText(
"${provider.balanceDetails.totalDebit}", "${provider.balanceDetails.totalDebit}",
style: TextStyle( style: TextStyle(
color: Color(0xFFED3424), color: Color(0xFFED3424),
fontFamily: "JakartaRegular", fontFamily: "JakartaRegular",
fontSize: 20, fontSize: 25,
), ),
minFontSize: 20, minFontSize: 18,
maxFontSize: 25, maxFontSize: 25,
maxLines: 2,
), ),
Text( Text(
"debit", "debit",
style: TextStyle(color: Color(0xFF818181)), style: TextStyle(
color: Color(0xFF818181),
),
), ),
], ],
), ),
...@@ -244,7 +303,10 @@ class _AccountledgerState extends State<Accountledger> { ...@@ -244,7 +303,10 @@ class _AccountledgerState extends State<Accountledger> {
Container( Container(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
padding: EdgeInsets.symmetric(horizontal: 10,vertical: 10), padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
child: Text( child: Text(
"Account Details", "Account Details",
style: TextStyle( style: TextStyle(
...@@ -269,10 +331,9 @@ class _AccountledgerState extends State<Accountledger> { ...@@ -269,10 +331,9 @@ class _AccountledgerState extends State<Accountledger> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
...List.generate(totalHeadings.length, (
...List.generate(totalHeadings.length, (index) { index,
) {
return Container( return Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
horizontal: 10, horizontal: 10,
...@@ -300,14 +361,14 @@ class _AccountledgerState extends State<Accountledger> { ...@@ -300,14 +361,14 @@ class _AccountledgerState extends State<Accountledger> {
), ),
), ),
), ),
], ],
), ),
); );
}), }),
InkResponse( InkResponse(
onTap: () async { onTap: () async {
provider.showMoreDetails = !provider.showMoreDetails; provider.showMoreDetails =
!provider.showMoreDetails;
}, },
child: Container( child: Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
...@@ -320,14 +381,15 @@ class _AccountledgerState extends State<Accountledger> { ...@@ -320,14 +381,15 @@ class _AccountledgerState extends State<Accountledger> {
MainAxisAlignment.center, MainAxisAlignment.center,
children: [ children: [
Text( Text(
provider.showMoreDetails?"- Show Less": "+ More Details", provider.showMoreDetails
? "- Show Less"
: "+ More Details",
style: TextStyle( style: TextStyle(
fontFamily: "JakartaMedium", fontFamily: "JakartaMedium",
fontSize: 14, fontSize: 14,
color: AppColors.app_blue, color: AppColors.app_blue,
), ),
), ),
], ],
), ),
), ),
...@@ -343,13 +405,16 @@ class _AccountledgerState extends State<Accountledger> { ...@@ -343,13 +405,16 @@ class _AccountledgerState extends State<Accountledger> {
String date = groupedData.keys.elementAt(index); String date = groupedData.keys.elementAt(index);
List<LedgerList> items = groupedData[date]!; List<LedgerList> items = groupedData[date]!;
if (provider.ledgerList.isEmpty) { if (provider.ledgerList.isEmpty) {
return Center(child: Text("No Data Available")); return Center(
child: Text("No Data Available"),
);
} }
return Container( return Container(
padding: EdgeInsets.symmetric(vertical: 5), padding: EdgeInsets.symmetric(vertical: 5),
margin: EdgeInsets.symmetric(horizontal: 10), margin: EdgeInsets.symmetric(horizontal: 10),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Container( Container(
padding: EdgeInsets.only(bottom: 5), padding: EdgeInsets.only(bottom: 5),
...@@ -363,21 +428,26 @@ class _AccountledgerState extends State<Accountledger> { ...@@ -363,21 +428,26 @@ class _AccountledgerState extends State<Accountledger> {
), ),
), ),
...items.map((item) { ...items.map((item) {
double running_balance = 0; double running_balance = 0;
int currentIndex = provider.ledgerList.indexOf( int currentIndex = provider.ledgerList
item, .indexOf(item);
); for (
for (var i = 0; i <= currentIndex; i++) { var i = 0;
var ledgerItem = provider.ledgerList[i]; i <= currentIndex;
i++
) {
var ledgerItem =
provider.ledgerList[i];
double credit = double credit =
double.tryParse( double.tryParse(
ledgerItem.creditAmount.toString(), ledgerItem.creditAmount
.toString(),
) ?? ) ??
0; 0;
double debit = double debit =
double.tryParse( double.tryParse(
ledgerItem.debitAmount.toString(), ledgerItem.debitAmount
.toString(),
) ?? ) ??
0; 0;
running_balance += (debit - credit); running_balance += (debit - credit);
...@@ -388,10 +458,14 @@ class _AccountledgerState extends State<Accountledger> { ...@@ -388,10 +458,14 @@ class _AccountledgerState extends State<Accountledger> {
horizontal: 10, horizontal: 10,
vertical: 10, vertical: 10,
), ),
margin: EdgeInsets.symmetric(vertical: 5), margin: EdgeInsets.symmetric(
vertical: 5,
),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(
16,
),
), ),
child: Column( child: Column(
children: [ children: [
...@@ -408,13 +482,17 @@ class _AccountledgerState extends State<Accountledger> { ...@@ -408,13 +482,17 @@ class _AccountledgerState extends State<Accountledger> {
"assets/images/trans_debit.png", "assets/images/trans_debit.png",
height: 45, height: 45,
width: 45, width: 45,
fit: BoxFit.contain, fit:
BoxFit
.contain,
) )
: Image.asset( : Image.asset(
"assets/images/trans_credit.png", "assets/images/trans_credit.png",
height: 45, height: 45,
width: 45, width: 45,
fit: BoxFit.contain, fit:
BoxFit
.contain,
), ),
), ),
), ),
...@@ -424,12 +502,16 @@ class _AccountledgerState extends State<Accountledger> { ...@@ -424,12 +502,16 @@ class _AccountledgerState extends State<Accountledger> {
child: SizedBox( child: SizedBox(
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment
.start,
children: [ children: [
Text( Text(
item.description ?? "-", item.description ??
"-",
maxLines: 2, maxLines: 2,
overflow: TextOverflow.ellipsis, overflow:
TextOverflow
.ellipsis,
style: TextStyle( style: TextStyle(
fontFamily: fontFamily:
"JakartaMedium", "JakartaMedium",
...@@ -445,14 +527,18 @@ class _AccountledgerState extends State<Accountledger> { ...@@ -445,14 +527,18 @@ class _AccountledgerState extends State<Accountledger> {
flex: 3, flex: 3,
child: SizedBox( child: SizedBox(
child: RichText( child: RichText(
textAlign: TextAlign.right, textAlign:
TextAlign.right,
maxLines: 1, maxLines: 1,
overflow: TextOverflow.ellipsis, overflow:
TextOverflow
.ellipsis,
text: TextSpan( text: TextSpan(
children: [ children: [
TextSpan( TextSpan(
text: text:
item.type == "Credit" item.type ==
"Credit"
? "-" ? "-"
: "+", : "+",
style: TextStyle( style: TextStyle(
...@@ -517,10 +603,16 @@ class _AccountledgerState extends State<Accountledger> { ...@@ -517,10 +603,16 @@ class _AccountledgerState extends State<Accountledger> {
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: builder:
(context) => Transactiondetails( (context) =>
paymentID: item.refId, Transactiondetails(
paymentID:
item.refId,
type: item.type, type: item.type,
), ),
settings: RouteSettings(
name:
"Transactiondetails",
),
), ),
); );
}, },
...@@ -530,16 +622,20 @@ class _AccountledgerState extends State<Accountledger> { ...@@ -530,16 +622,20 @@ class _AccountledgerState extends State<Accountledger> {
), ),
child: Row( child: Row(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.center, CrossAxisAlignment
.center,
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.start, MainAxisAlignment.start,
children: [ children: [
Text( Text(
"View Details", "View Details",
style: TextStyle( style: TextStyle(
fontFamily: "JakartaMedium", fontFamily:
"JakartaMedium",
fontSize: 14, fontSize: 14,
color: AppColors.app_blue, color:
AppColors
.app_blue,
), ),
), ),
SizedBox(width: 5), SizedBox(width: 5),
...@@ -560,23 +656,15 @@ class _AccountledgerState extends State<Accountledger> { ...@@ -560,23 +656,15 @@ class _AccountledgerState extends State<Accountledger> {
}, },
), ),
], ],
], ],
), ),
), ),
), ),
),
),
onWillPop: () {
return _onBackPressed(context);
},
); );
}, },
); );
} }
Future<void> _showFilterSheet(BuildContext context) { Future<void> _showFilterSheet(BuildContext context) {
return showModalBottomSheet( return showModalBottomSheet(
useSafeArea: true, useSafeArea: true,
...@@ -593,7 +681,7 @@ class _AccountledgerState extends State<Accountledger> { ...@@ -593,7 +681,7 @@ class _AccountledgerState extends State<Accountledger> {
child: Consumer<Accountledgerprovider>( child: Consumer<Accountledgerprovider>(
builder: (context, provider, child) { builder: (context, provider, child) {
return Container( return Container(
height: MediaQuery.of(context).size.height*0.35, height: MediaQuery.of(context).size.height * 0.35,
padding: EdgeInsets.only( padding: EdgeInsets.only(
bottom: MediaQuery.of(context).viewInsets.bottom, bottom: MediaQuery.of(context).viewInsets.bottom,
), ),
...@@ -653,7 +741,12 @@ class _AccountledgerState extends State<Accountledger> { ...@@ -653,7 +741,12 @@ class _AccountledgerState extends State<Accountledger> {
), ),
) )
.toList(), .toList(),
value:provider.accounts.contains(provider.selectedAccount)?provider.selectedAccount:null, value:
provider.accounts.contains(
provider.selectedAccount,
)
? provider.selectedAccount
: null,
// value: provider.selectedAccount, // value: provider.selectedAccount,
onChanged: (Accounts? value) { onChanged: (Accounts? value) {
if (value != null) { if (value != null) {
...@@ -678,14 +771,12 @@ class _AccountledgerState extends State<Accountledger> { ...@@ -678,14 +771,12 @@ class _AccountledgerState extends State<Accountledger> {
dropdownSearchData: DropdownSearchData( dropdownSearchData: DropdownSearchData(
searchInnerWidgetHeight: 50, searchInnerWidgetHeight: 50,
searchController: searchController:
provider provider.searchAccountController,
.searchAccountController,
searchInnerWidget: Padding( searchInnerWidget: Padding(
padding: const EdgeInsets.all(8), padding: const EdgeInsets.all(8),
child: TextFormField( child: TextFormField(
controller: controller:
provider provider.searchAccountController,
.searchAccountController,
decoration: InputDecoration( decoration: InputDecoration(
isDense: true, isDense: true,
contentPadding: contentPadding:
...@@ -720,8 +811,10 @@ class _AccountledgerState extends State<Accountledger> { ...@@ -720,8 +811,10 @@ class _AccountledgerState extends State<Accountledger> {
}, },
buttonStyleData: ddtheme.buttonStyleData, buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData, iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData, menuItemStyleData:
dropdownStyleData: ddtheme.dropdownStyleData, ddtheme.menuItemStyleData,
dropdownStyleData:
ddtheme.dropdownStyleData,
), ),
), ),
], ],
......
import 'dart:io'; import 'dart:io';
import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:generp/Notifiers/commonProvider/accountsListProvider.dart'; import 'package:generp/Notifiers/commonProvider/accountsListProvider.dart';
import 'package:generp/Utils/app_colors.dart'; import 'package:generp/Utils/app_colors.dart';
import 'package:generp/Utils/commonServices.dart';
import 'package:generp/Utils/commonWidgets.dart'; import 'package:generp/Utils/commonWidgets.dart';
import 'package:generp/screens/commom/accountsListDetails.dart'; import 'package:generp/screens/commom/accountsListDetails.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
...@@ -20,11 +22,17 @@ class _AccountslistState extends State<Accountslist> { ...@@ -20,11 +22,17 @@ class _AccountslistState extends State<Accountslist> {
ScrollController scrollController = ScrollController(); ScrollController scrollController = ScrollController();
FocusNode focusNode1 = FocusNode(); FocusNode focusNode1 = FocusNode();
FocusNode focusNode2 = FocusNode(); FocusNode focusNode2 = FocusNode();
Map _source = {ConnectivityResult.mobile: true};
final MyConnectivity _connectivity = MyConnectivity.instance;
@override @override
void initState() { void initState() {
// TODO: implement initState // TODO: implement initState
super.initState(); super.initState();
_connectivity.initialise();
_connectivity.myStream.listen((source) {
setState(() => _source = source);
});
WidgetsBinding.instance.addPostFrameCallback((timeStamp) { WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
var provider = Provider.of<Accountslistprovider>(context, listen: false); var provider = Provider.of<Accountslistprovider>(context, listen: false);
provider.commonAccountListAPIFunction(context); provider.commonAccountListAPIFunction(context);
...@@ -37,30 +45,54 @@ class _AccountslistState extends State<Accountslist> { ...@@ -37,30 +45,54 @@ class _AccountslistState extends State<Accountslist> {
scrollController.position.maxScrollExtent * 0.9 && scrollController.position.maxScrollExtent * 0.9 &&
!provider.isLoading && !provider.isLoading &&
provider.hasMoreData) { provider.hasMoreData) {
provider provider.commonAccountListAPIFunction(context);
.commonAccountListAPIFunction(context);
} }
}); });
}); });
} }
@override
@override
void dispose() { void dispose() {
// TODO: implement dispose // TODO: implement dispose
super.dispose(); super.dispose();
scrollController.dispose(); scrollController.dispose();
_connectivity.disposeStream();
} }
@override @override
Widget build(BuildContext context) { 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>( return Consumer<Accountslistprovider>(
builder: (context, provider, child) { builder: (context, provider, child) {
var accountList = provider.accountsList; var accountList = provider.accountsList;
print(accountList.length); print(accountList.length);
return WillPopScope( return Scaffold(
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
appBar: appbar2( appBar: appbar2(
context, context,
...@@ -73,22 +105,19 @@ class _AccountslistState extends State<Accountslist> { ...@@ -73,22 +105,19 @@ class _AccountslistState extends State<Accountslist> {
onTap: () { onTap: () {
_showFilterSheet(context); _showFilterSheet(context);
}, },
child: SvgPicture.asset( child: SvgPicture.asset("assets/svg/filter_ic.svg", height: 18),
"assets/svg/filter_ic.svg",
height: 18,
),
), ),
), ),
), ),
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
body: provider.isLoading? body:
Center( provider.isLoading
? Center(
child: CircularProgressIndicator( child: CircularProgressIndicator(
valueColor: AlwaysStoppedAnimation(AppColors.app_blue), valueColor: AlwaysStoppedAnimation(AppColors.app_blue),
), ),
) )
: : accountList.isNotEmpty
accountList.isNotEmpty
? SizedBox( ? SizedBox(
child: Scrollbar( child: Scrollbar(
child: SingleChildScrollView( child: SingleChildScrollView(
...@@ -96,7 +125,11 @@ class _AccountslistState extends State<Accountslist> { ...@@ -96,7 +125,11 @@ class _AccountslistState extends State<Accountslist> {
child: Column( child: Column(
children: [ children: [
ListView.builder( ListView.builder(
itemCount: accountList.length + (provider.hasMoreData && provider.isLoading ? 1 : 0), itemCount:
accountList.length +
(provider.hasMoreData && provider.isLoading
? 1
: 0),
shrinkWrap: true, shrinkWrap: true,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, index) { itemBuilder: (context, index) {
...@@ -112,8 +145,7 @@ class _AccountslistState extends State<Accountslist> { ...@@ -112,8 +145,7 @@ class _AccountslistState extends State<Accountslist> {
return Padding( return Padding(
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
child: Center( child: Center(
child: child: CircularProgressIndicator.adaptive(
CircularProgressIndicator.adaptive(
valueColor: valueColor:
AlwaysStoppedAnimation<Color>( AlwaysStoppedAnimation<Color>(
AppColors.app_blue, AppColors.app_blue,
...@@ -171,8 +203,7 @@ class _AccountslistState extends State<Accountslist> { ...@@ -171,8 +203,7 @@ class _AccountslistState extends State<Accountslist> {
"JakartaMedium", "JakartaMedium",
fontSize: 14, fontSize: 14,
color: color:
AppColors AppColors.semi_black,
.semi_black,
), ),
), ),
Text( Text(
...@@ -183,8 +214,7 @@ class _AccountslistState extends State<Accountslist> { ...@@ -183,8 +214,7 @@ class _AccountslistState extends State<Accountslist> {
fontFamily: fontFamily:
"JakartaMedium", "JakartaMedium",
fontSize: 14, fontSize: 14,
color: color: AppColors.app_blue,
AppColors.app_blue,
), ),
), ),
], ],
...@@ -223,11 +253,9 @@ class _AccountslistState extends State<Accountslist> { ...@@ -223,11 +253,9 @@ class _AccountslistState extends State<Accountslist> {
child: Text( child: Text(
headings[j], headings[j],
style: TextStyle( style: TextStyle(
fontFamily: fontFamily: "JakartaMedium",
"JakartaMedium",
fontSize: 14, fontSize: 14,
color: color: AppColors.semi_black,
AppColors.semi_black,
), ),
), ),
), ),
...@@ -236,11 +264,9 @@ class _AccountslistState extends State<Accountslist> { ...@@ -236,11 +264,9 @@ class _AccountslistState extends State<Accountslist> {
child: Text( child: Text(
subHeadings[j] ?? "-", subHeadings[j] ?? "-",
style: TextStyle( style: TextStyle(
fontFamily: fontFamily: "JakartaMedium",
"JakartaMedium",
fontSize: 14, fontSize: 14,
color: color: AppColors.grey_thick,
AppColors.grey_thick,
), ),
), ),
), ),
...@@ -303,12 +329,6 @@ class _AccountslistState extends State<Accountslist> { ...@@ -303,12 +329,6 @@ class _AccountslistState extends State<Accountslist> {
), ),
) )
: Emptywidget(context), : Emptywidget(context),
),
),
onWillPop: () {
provider.pageNum = 1;
return _onBackPressed(context);
},
); );
}, },
); );
...@@ -367,7 +387,7 @@ class _AccountslistState extends State<Accountslist> { ...@@ -367,7 +387,7 @@ class _AccountslistState extends State<Accountslist> {
null, null,
focusNode1, focusNode1,
focusNode2, focusNode2,
TextInputAction.next TextInputAction.next,
), ),
textControllerWidget( textControllerWidget(
context, context,
...@@ -381,7 +401,7 @@ class _AccountslistState extends State<Accountslist> { ...@@ -381,7 +401,7 @@ class _AccountslistState extends State<Accountslist> {
focusNode2, focusNode2,
null, null,
TextInputAction.done, TextInputAction.done,
10 10,
), ),
InkResponse( InkResponse(
onTap: () { onTap: () {
......
import 'dart:io'; import 'dart:io';
import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:generp/Notifiers/commonProvider/accountDetailsProvider.dart'; import 'package:generp/Notifiers/commonProvider/accountDetailsProvider.dart';
import 'package:generp/Utils/app_colors.dart'; import 'package:generp/Utils/app_colors.dart';
import 'package:generp/Utils/commonServices.dart';
import 'package:generp/Utils/commonWidgets.dart'; import 'package:generp/Utils/commonWidgets.dart';
import 'package:generp/screens/commom/transactionDetails.dart'; import 'package:generp/screens/commom/transactionDetails.dart';
import 'package:generp/screens/finance/submitPaymentRequestionListsByMode.dart'; import 'package:generp/screens/finance/submitPaymentRequestionListsByMode.dart';
...@@ -21,18 +23,58 @@ class Accountslistdetails extends StatefulWidget { ...@@ -21,18 +23,58 @@ class Accountslistdetails extends StatefulWidget {
} }
class _AccountslistdetailsState extends State<Accountslistdetails> { class _AccountslistdetailsState extends State<Accountslistdetails> {
Map _source = {ConnectivityResult.mobile: true};
final MyConnectivity _connectivity = MyConnectivity.instance;
@override @override
void initState() { void initState() {
// TODO: implement initState // TODO: implement initState
super.initState(); super.initState();
_connectivity.initialise();
_connectivity.myStream.listen((source) {
setState(() => _source = source);
});
WidgetsBinding.instance.addPostFrameCallback((timeStamp) { WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
var prov = Provider.of<Accountdetailsprovider>(context, listen: false); var prov = Provider.of<Accountdetailsprovider>(context, listen: false);
prov.accountdetailsAPIFunction(context, widget.accountID); prov.accountdetailsAPIFunction(context, widget.accountID);
}); });
} }
@override
void dispose() {
// TODO: implement dispose
super.dispose();
_connectivity.disposeStream();
}
@override @override
Widget build(BuildContext context) { 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>( return Consumer<Accountdetailsprovider>(
builder: (context, provider, child) { builder: (context, provider, child) {
final groupedData = provider.groupByDate(provider.ledgerList); final groupedData = provider.groupByDate(provider.ledgerList);
...@@ -49,11 +91,7 @@ class _AccountslistdetailsState extends State<Accountslistdetails> { ...@@ -49,11 +91,7 @@ class _AccountslistdetailsState extends State<Accountslistdetails> {
} }
overallBalance = totalDebit - totalCredit; overallBalance = totalDebit - totalCredit;
return WillPopScope( return Scaffold(
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
appBar: appbar2( appBar: appbar2(
context, context,
"Account Details", "Account Details",
...@@ -123,9 +161,7 @@ class _AccountslistdetailsState extends State<Accountslistdetails> { ...@@ -123,9 +161,7 @@ class _AccountslistdetailsState extends State<Accountslistdetails> {
), ),
Text( Text(
"credit", "credit",
style: TextStyle( style: TextStyle(color: Color(0xFF818181)),
color: Color(0xFF818181),
),
), ),
], ],
), ),
...@@ -164,9 +200,7 @@ class _AccountslistdetailsState extends State<Accountslistdetails> { ...@@ -164,9 +200,7 @@ class _AccountslistdetailsState extends State<Accountslistdetails> {
), ),
Text( Text(
"debit", "debit",
style: TextStyle( style: TextStyle(color: Color(0xFF818181)),
color: Color(0xFF818181),
),
), ),
], ],
), ),
...@@ -184,14 +218,8 @@ class _AccountslistdetailsState extends State<Accountslistdetails> { ...@@ -184,14 +218,8 @@ class _AccountslistdetailsState extends State<Accountslistdetails> {
// ), // ),
// ), // ),
Container( Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(horizontal: 10, vertical: 10),
horizontal: 10, margin: EdgeInsets.symmetric(horizontal: 10, vertical: 10),
vertical: 10,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(16),
...@@ -223,8 +251,7 @@ class _AccountslistdetailsState extends State<Accountslistdetails> { ...@@ -223,8 +251,7 @@ class _AccountslistdetailsState extends State<Accountslistdetails> {
provider.accountDetails.bankIfscCode ?? "-", provider.accountDetails.bankIfscCode ?? "-",
provider.accountDetails.bankAccountHolderName ?? provider.accountDetails.bankAccountHolderName ??
"-", "-",
provider.accountDetails.bankAccountNumber ?? provider.accountDetails.bankAccountNumber ?? "-",
"-",
provider.accountDetails.bankUpiId ?? "-", provider.accountDetails.bankUpiId ?? "-",
provider.accountDetails.state ?? "-", provider.accountDetails.state ?? "-",
provider.accountDetails.district ?? "-", provider.accountDetails.district ?? "-",
...@@ -292,8 +319,9 @@ class _AccountslistdetailsState extends State<Accountslistdetails> { ...@@ -292,8 +319,9 @@ class _AccountslistdetailsState extends State<Accountslistdetails> {
), ),
...items.map((item) { ...items.map((item) {
double running_balance = 0; double running_balance = 0;
int currentIndex = provider.ledgerList int currentIndex = provider.ledgerList.indexOf(
.indexOf(item); item,
);
for (var i = 0; i <= currentIndex; i++) { for (var i = 0; i <= currentIndex; i++) {
var ledgerItem = provider.ledgerList[i]; var ledgerItem = provider.ledgerList[i];
double credit = double credit =
...@@ -358,8 +386,7 @@ class _AccountslistdetailsState extends State<Accountslistdetails> { ...@@ -358,8 +386,7 @@ class _AccountslistdetailsState extends State<Accountslistdetails> {
overflow: overflow:
TextOverflow.ellipsis, TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontFamily: fontFamily: "JakartaMedium",
"JakartaMedium",
fontSize: 12, fontSize: 12,
), ),
), ),
...@@ -374,20 +401,16 @@ class _AccountslistdetailsState extends State<Accountslistdetails> { ...@@ -374,20 +401,16 @@ class _AccountslistdetailsState extends State<Accountslistdetails> {
child: RichText( child: RichText(
maxLines: 1, maxLines: 1,
textAlign: TextAlign.right, textAlign: TextAlign.right,
overflow: overflow: TextOverflow.ellipsis,
TextOverflow.ellipsis,
text: TextSpan( text: TextSpan(
children: [ children: [
TextSpan( TextSpan(
text: text:
item.type == item.type == "Credit"
"Credit"
? "-" ? "-"
: "+", : "+",
style: TextStyle( style: TextStyle(
color: Color( color: Color(0xFF2D2D2D),
0xFF2D2D2D,
),
fontSize: 13, fontSize: 13,
fontFamily: fontFamily:
"JakartaRegular", "JakartaRegular",
...@@ -397,9 +420,7 @@ class _AccountslistdetailsState extends State<Accountslistdetails> { ...@@ -397,9 +420,7 @@ class _AccountslistdetailsState extends State<Accountslistdetails> {
text: text:
"₹${item.type == "Credit" ? "${item.creditAmount}" : "${item.debitAmount}"}", "₹${item.type == "Credit" ? "${item.creditAmount}" : "${item.debitAmount}"}",
style: TextStyle( style: TextStyle(
color: Color( color: Color(0xFF2D2D2D),
0xFF2D2D2D,
),
fontSize: 13, fontSize: 13,
fontFamily: fontFamily:
"JakartaMedium", "JakartaMedium",
...@@ -446,8 +467,7 @@ class _AccountslistdetailsState extends State<Accountslistdetails> { ...@@ -446,8 +467,7 @@ class _AccountslistdetailsState extends State<Accountslistdetails> {
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: builder:
(context) => (context) => Transactiondetails(
Transactiondetails(
paymentID: item.refId, paymentID: item.refId,
type: item.type, type: item.type,
), ),
...@@ -489,19 +509,20 @@ class _AccountslistdetailsState extends State<Accountslistdetails> { ...@@ -489,19 +509,20 @@ class _AccountslistdetailsState extends State<Accountslistdetails> {
); );
}, },
), ),
if(["Vendor","Customer"].contains(provider.accountDetails.type))...[ if ([
"Vendor",
"Customer",
].contains(provider.accountDetails.type)) ...[
InkWell( InkWell(
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: builder:
(context) => (context) => Submitpaymentrequestionlistsbymode(
Submitpaymentrequestionlistsbymode(
mode: "other", mode: "other",
pageTitleName: pageTitleName: "Add Payment Request (Other)",
"Add Payment Request (Other)", accountId: provider.accountDetails.id!,
accountId:provider.accountDetails.id!
), ),
), ),
); );
...@@ -532,16 +553,11 @@ class _AccountslistdetailsState extends State<Accountslistdetails> { ...@@ -532,16 +553,11 @@ class _AccountslistdetailsState extends State<Accountslistdetails> {
), ),
), ),
), ),
] ],
], ],
), ),
), ),
), ),
),
),
onWillPop: () {
return _onBackPressed(context);
},
); );
}, },
); );
......
import 'dart:io'; import 'dart:io';
import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:dropdown_button2/dropdown_button2.dart'; import 'package:dropdown_button2/dropdown_button2.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
...@@ -7,6 +8,7 @@ import 'package:flutter_svg/svg.dart'; ...@@ -7,6 +8,7 @@ import 'package:flutter_svg/svg.dart';
import 'package:generp/Notifiers/commonProvider/accountsListProvider.dart'; import 'package:generp/Notifiers/commonProvider/accountsListProvider.dart';
import 'package:generp/Utils/ShakeWidget.dart'; import 'package:generp/Utils/ShakeWidget.dart';
import 'package:generp/Utils/app_colors.dart'; import 'package:generp/Utils/app_colors.dart';
import 'package:generp/Utils/commonServices.dart';
import 'package:generp/Utils/commonWidgets.dart'; import 'package:generp/Utils/commonWidgets.dart';
import 'package:generp/Utils/dropdownTheme.dart'; import 'package:generp/Utils/dropdownTheme.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
...@@ -17,48 +19,71 @@ import '../../Models/commonModels/commonAddAccountsViewResponse.dart'; ...@@ -17,48 +19,71 @@ import '../../Models/commonModels/commonAddAccountsViewResponse.dart';
class Addcommonpayment extends StatefulWidget { class Addcommonpayment extends StatefulWidget {
final from; final from;
const Addcommonpayment({super.key,required this.from}); const Addcommonpayment({super.key, required this.from});
@override @override
State<Addcommonpayment> createState() => _AddcommonpaymentState(); State<Addcommonpayment> createState() => _AddcommonpaymentState();
} }
class _AddcommonpaymentState extends State<Addcommonpayment>{ class _AddcommonpaymentState extends State<Addcommonpayment> {
Dropdowntheme ddtheme = Dropdowntheme(); Dropdowntheme ddtheme = Dropdowntheme();
List<FocusNode> focusNodes = List.generate(20, (index) => FocusNode()); List<FocusNode> focusNodes = List.generate(20, (index) => FocusNode());
Map _source = {ConnectivityResult.mobile: true};
final MyConnectivity _connectivity = MyConnectivity.instance;
@override @override
void initState() { void initState() {
// TODO: implement initState // TODO: implement initState
super.initState(); super.initState();
_connectivity.initialise();
_connectivity.myStream.listen((source) {
setState(() => _source = source);
});
WidgetsBinding.instance.addPostFrameCallback((timeStamp) { WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
var prov = Provider.of<Accountslistprovider>(context, listen: false); var prov = Provider.of<Accountslistprovider>(context, listen: false);
prov.addCommonAccountViewAPI(context); prov.addCommonAccountViewAPI(context);
}); });
} }
@override @override
void dispose() { void dispose() {
focusNodes.map((e) => e.dispose(),); focusNodes.map((e) => e.dispose());
super.dispose(); super.dispose();
_connectivity.disposeStream();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Consumer<Accountslistprovider>( switch (_source.keys.toList()[0]) {
builder: (context, provider, child) { case ConnectivityResult.mobile:
return WillPopScope( connection = 'Online';
onWillPop: () async { break;
provider.resetValues(); case ConnectivityResult.wifi:
return onBackPressed(context); connection = 'Online';
}, break;
case ConnectivityResult.none:
default:
connection = 'Offline';
}
return (connection == "Online")
? Platform.isAndroid
? WillPopScope(
onWillPop: () => onBackPressed(context),
child: SafeArea( child: SafeArea(
top: false, top: false,
bottom: Platform.isIOS?false:true, bottom: true,
child: Scaffold( child: _scaffold(context),
),
)
: _scaffold(context)
: NoNetwork(context);
}
Widget _scaffold(BuildContext context) {
return Consumer<Accountslistprovider>(
builder: (context, provider, child) {
return Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
appBar: appbar2( appBar: appbar2(
context, context,
...@@ -73,14 +98,8 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{ ...@@ -73,14 +98,8 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(horizontal: 10, vertical: 10),
horizontal: 10, margin: EdgeInsets.symmetric(horizontal: 10, vertical: 10),
vertical: 10,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(16),
...@@ -118,17 +137,14 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{ ...@@ -118,17 +137,14 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
items: items:
provider.accountTypes provider.accountTypes
.map( .map(
(act) => (act) => DropdownMenuItem<String>(
DropdownMenuItem<String>(
value: act, value: act,
child: Text( child: Text(
act, act,
style: const TextStyle( style: const TextStyle(
fontSize: 14, fontSize: 14,
), ),
overflow: overflow: TextOverflow.ellipsis,
TextOverflow
.ellipsis,
), ),
), ),
) )
...@@ -150,10 +166,8 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{ ...@@ -150,10 +166,8 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
}, },
buttonStyleData: ddtheme.buttonStyleData, buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData, iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: menuItemStyleData: ddtheme.menuItemStyleData,
ddtheme.menuItemStyleData, dropdownStyleData: ddtheme.dropdownStyleData,
dropdownStyleData:
ddtheme.dropdownStyleData,
), ),
), ),
], ],
...@@ -178,7 +192,7 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{ ...@@ -178,7 +192,7 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
null, null,
focusNodes[0], focusNodes[0],
focusNodes[1], focusNodes[1],
TextInputAction.next TextInputAction.next,
), ),
errorWidget(context, provider.nameError), errorWidget(context, provider.nameError),
textControllerWidget( textControllerWidget(
...@@ -213,12 +227,10 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{ ...@@ -213,12 +227,10 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
false, false,
null, null,
focusNodes[12], focusNodes[12],
focusNodes[13],TextInputAction.next focusNodes[13],
), TextInputAction.next,
errorWidget(
context,
provider.contactPersonError,
), ),
errorWidget(context, provider.contactPersonError),
], ],
), ),
), ),
...@@ -226,8 +238,7 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{ ...@@ -226,8 +238,7 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
Column( Column(
children: [ children: [
InkResponse( InkResponse(
onTap: onTap: () => provider.isVisible = !provider.isVisible,
() => provider.isVisible = !provider.isVisible,
child: Center( child: Center(
child: Text( child: Text(
provider.isVisible provider.isVisible
...@@ -241,13 +252,13 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{ ...@@ -241,13 +252,13 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
), ),
), ),
), ),
if(provider.addMoreDetailsError!=null)...[ if (provider.addMoreDetailsError != null) ...[
Center( Center(
child: ShakeWidget( child: ShakeWidget(
key: Key("value"), key: Key("value"),
duration: Duration(milliseconds: 700), duration: Duration(milliseconds: 700),
child: Text( child: Text(
provider.addMoreDetailsError??"", provider.addMoreDetailsError ?? "",
style: TextStyle( style: TextStyle(
color: Colors.red, color: Colors.red,
fontSize: 13, fontSize: 13,
...@@ -262,7 +273,6 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{ ...@@ -262,7 +273,6 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
margin: EdgeInsets.symmetric( margin: EdgeInsets.symmetric(
horizontal: 10, horizontal: 10,
...@@ -277,8 +287,7 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{ ...@@ -277,8 +287,7 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(16),
), ),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
Text("State"), Text("State"),
DropdownButtonHideUnderline( DropdownButtonHideUnderline(
...@@ -287,7 +296,10 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{ ...@@ -287,7 +296,10 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
Expanded( Expanded(
child: DropdownButton2<States>( child: DropdownButton2<States>(
focusNode: focusNodes[2], focusNode: focusNodes[2],
autofocus: focusNodes[2].hasFocus?true:false, autofocus:
focusNodes[2].hasFocus
? true
: false,
isExpanded: true, isExpanded: true,
hint: Text( hint: Text(
'Select State', 'Select State',
...@@ -297,12 +309,16 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{ ...@@ -297,12 +309,16 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
items: items:
provider.states provider.states
.map( .map(
(states) => (
DropdownMenuItem<States>( states,
) => DropdownMenuItem<
States
>(
value: states, value: states,
child: Text( child: Text(
states.name ?? '', states.name ?? '',
style: const TextStyle( style:
const TextStyle(
fontSize: 14, fontSize: 14,
), ),
overflow: overflow:
...@@ -321,8 +337,11 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{ ...@@ -321,8 +337,11 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
// value: provider.selectedState, // value: provider.selectedState,
onChanged: (States? value) { onChanged: (States? value) {
if (value != null) { if (value != null) {
if (provider.states.isNotEmpty) { if (provider
provider.selectedState = value; .states
.isNotEmpty) {
provider.selectedState =
value;
print( print(
"Selected Complaint Type: ${value.name}, ID: ${value.id}", "Selected Complaint Type: ${value.name}, ID: ${value.id}",
); );
...@@ -333,7 +352,8 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{ ...@@ -333,7 +352,8 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
provider.selectedStateID provider.selectedStateID
.toString(), .toString(),
); );
if (provider.selectedDistricts != if (provider
.selectedDistricts !=
null) { null) {
provider.states.clear(); provider.states.clear();
// provider.selectedDistricts = null; // provider.selectedDistricts = null;
...@@ -354,12 +374,16 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{ ...@@ -354,12 +374,16 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
dropdownSearchData: DropdownSearchData( dropdownSearchData: DropdownSearchData(
searchInnerWidgetHeight: 50, searchInnerWidgetHeight: 50,
searchController: searchController:
provider.stateSearchController, provider
.stateSearchController,
searchInnerWidget: Padding( searchInnerWidget: Padding(
padding: const EdgeInsets.all(8), padding: const EdgeInsets.all(
8,
),
child: TextFormField( child: TextFormField(
controller: controller:
provider.stateSearchController, provider
.stateSearchController,
decoration: InputDecoration( decoration: InputDecoration(
isDense: true, isDense: true,
contentPadding: contentPadding:
...@@ -367,19 +391,26 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{ ...@@ -367,19 +391,26 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
horizontal: 10, horizontal: 10,
vertical: 8, vertical: 8,
), ),
hintText: 'Search States...', hintText:
'Search States...',
border: OutlineInputBorder( border: OutlineInputBorder(
borderRadius: borderRadius:
BorderRadius.circular(8), BorderRadius.circular(
8,
), ),
), ),
), ),
), ),
searchMatchFn: (item, searchValue) { ),
searchMatchFn: (
item,
searchValue,
) {
return item.value?.name return item.value?.name
?.toLowerCase() ?.toLowerCase()
.contains( .contains(
searchValue.toLowerCase(), searchValue
.toLowerCase(),
) ?? ) ??
false; false;
}, },
...@@ -390,8 +421,10 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{ ...@@ -390,8 +421,10 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
.clear(); .clear();
} }
}, },
buttonStyleData: ddtheme.buttonStyleData, buttonStyleData:
iconStyleData: ddtheme.iconStyleData, ddtheme.buttonStyleData,
iconStyleData:
ddtheme.iconStyleData,
menuItemStyleData: menuItemStyleData:
ddtheme.menuItemStyleData, ddtheme.menuItemStyleData,
dropdownStyleData: dropdownStyleData:
...@@ -418,12 +451,16 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{ ...@@ -418,12 +451,16 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
items: items:
provider.districts provider.districts
.map( .map(
(dist) => (
DropdownMenuItem<Districts>( dist,
) => DropdownMenuItem<
Districts
>(
value: dist, value: dist,
child: Text( child: Text(
dist.district ?? '', dist.district ?? '',
style: const TextStyle( style:
const TextStyle(
fontSize: 14, fontSize: 14,
), ),
overflow: overflow:
...@@ -435,30 +472,39 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{ ...@@ -435,30 +472,39 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
.toList(), .toList(),
value: value:
provider.districts.contains( provider.districts.contains(
provider.selectedDistricts, provider
.selectedDistricts,
) )
? provider.selectedDistricts ? provider.selectedDistricts
: null, : null,
// value: provider.selectedDistricts, // value: provider.selectedDistricts,
onChanged: (Districts? value) { onChanged: (Districts? value) {
if (value != null) { if (value != null) {
if (provider.districts.isNotEmpty) { if (provider
provider.selectedDistricts = value; .districts
print("Selected ID: ${value.id}"); .isNotEmpty) {
provider.selectedDistricts =
value;
print(
"Selected ID: ${value.id}",
);
provider.selectedDistrictId = provider.selectedDistrictId =
value.id!; value.id!;
provider.selectedDistrictValue = provider.selectedDistrictValue =
value.district!; value.district!;
print( print(
"hfjkshfg" + "hfjkshfg" +
provider.selectedDistrictId provider
.selectedDistrictId
.toString(), .toString(),
); );
if (provider.selectedSubLocations != if (provider
.selectedSubLocations !=
null) { null) {
// provider.selectedSubLocations = // provider.selectedSubLocations =
// null; // null;
provider.selectedSubLocID = null; provider.selectedSubLocID =
null;
provider.selectedSubLocValue = provider.selectedSubLocValue =
null; null;
} }
...@@ -472,9 +518,12 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{ ...@@ -472,9 +518,12 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
dropdownSearchData: DropdownSearchData( dropdownSearchData: DropdownSearchData(
searchInnerWidgetHeight: 50, searchInnerWidgetHeight: 50,
searchController: searchController:
provider.districtSearchController, provider
.districtSearchController,
searchInnerWidget: Padding( searchInnerWidget: Padding(
padding: const EdgeInsets.all(8), padding: const EdgeInsets.all(
8,
),
child: TextFormField( child: TextFormField(
controller: controller:
provider provider
...@@ -486,31 +535,41 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{ ...@@ -486,31 +535,41 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
horizontal: 10, horizontal: 10,
vertical: 8, vertical: 8,
), ),
hintText: 'Search Districts...', hintText:
'Search Districts...',
border: OutlineInputBorder( border: OutlineInputBorder(
borderRadius: borderRadius:
BorderRadius.circular(8), BorderRadius.circular(
8,
),
), ),
), ),
), ),
), ),
searchMatchFn: (item, searchValue) { searchMatchFn: (
item,
searchValue,
) {
return item.value?.district return item.value?.district
?.toLowerCase() ?.toLowerCase()
.contains( .contains(
searchValue.toLowerCase(), searchValue
.toLowerCase(),
) ?? ) ??
false; false;
}, },
), ),
onMenuStateChange: (isOpen) { onMenuStateChange: (isOpen) {
if (!isOpen) { if (!isOpen) {
provider.districtSearchController provider
.districtSearchController
.clear(); .clear();
} }
}, },
buttonStyleData: ddtheme.buttonStyleData, buttonStyleData:
iconStyleData: ddtheme.iconStyleData, ddtheme.buttonStyleData,
iconStyleData:
ddtheme.iconStyleData,
menuItemStyleData: menuItemStyleData:
ddtheme.menuItemStyleData, ddtheme.menuItemStyleData,
dropdownStyleData: dropdownStyleData:
...@@ -537,17 +596,22 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{ ...@@ -537,17 +596,22 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
items: items:
provider.subLocations provider.subLocations
.map( .map(
(subloc) => DropdownMenuItem< (
subloc,
) => DropdownMenuItem<
SubLocations SubLocations
>( >(
value: subloc, value: subloc,
child: Text( child: Text(
subloc.subLocality ?? '', subloc.subLocality ??
style: const TextStyle( '',
style:
const TextStyle(
fontSize: 14, fontSize: 14,
), ),
overflow: overflow:
TextOverflow.ellipsis, TextOverflow
.ellipsis,
), ),
), ),
) )
...@@ -555,9 +619,11 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{ ...@@ -555,9 +619,11 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
// value: provider.selectedSubLocations, // value: provider.selectedSubLocations,
value: value:
provider.subLocations.contains( provider.subLocations.contains(
provider.selectedSubLocations, provider
.selectedSubLocations,
) )
? provider.selectedSubLocations ? provider
.selectedSubLocations
: null, : null,
onChanged: (SubLocations? value) { onChanged: (SubLocations? value) {
if (value != null) { if (value != null) {
...@@ -566,14 +632,17 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{ ...@@ -566,14 +632,17 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
.isNotEmpty) { .isNotEmpty) {
provider.selectedSubLocations = provider.selectedSubLocations =
value; value;
print("Selected ID: ${value.id}"); print(
"Selected ID: ${value.id}",
);
provider.selectedSubLocID = provider.selectedSubLocID =
value.id!; value.id!;
provider.selectedSubLocValue = provider.selectedSubLocValue =
value.subLocality!; value.subLocality!;
print( print(
"hfjkshfg" + "hfjkshfg" +
provider.selectedSubLocID provider
.selectedSubLocID
.toString(), .toString(),
); );
} }
...@@ -582,12 +651,16 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{ ...@@ -582,12 +651,16 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
dropdownSearchData: DropdownSearchData( dropdownSearchData: DropdownSearchData(
searchInnerWidgetHeight: 50, searchInnerWidgetHeight: 50,
searchController: searchController:
provider.subLocSearchController, provider
.subLocSearchController,
searchInnerWidget: Padding( searchInnerWidget: Padding(
padding: const EdgeInsets.all(8), padding: const EdgeInsets.all(
8,
),
child: TextFormField( child: TextFormField(
controller: controller:
provider.subLocSearchController, provider
.subLocSearchController,
decoration: InputDecoration( decoration: InputDecoration(
isDense: true, isDense: true,
contentPadding: contentPadding:
...@@ -599,16 +672,22 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{ ...@@ -599,16 +672,22 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
'Search Sub Locality...', 'Search Sub Locality...',
border: OutlineInputBorder( border: OutlineInputBorder(
borderRadius: borderRadius:
BorderRadius.circular(8), BorderRadius.circular(
8,
),
), ),
), ),
), ),
), ),
searchMatchFn: (item, searchValue) { searchMatchFn: (
item,
searchValue,
) {
return item.value?.subLocality return item.value?.subLocality
?.toLowerCase() ?.toLowerCase()
.contains( .contains(
searchValue.toLowerCase(), searchValue
.toLowerCase(),
) ?? ) ??
false; false;
}, },
...@@ -619,8 +698,10 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{ ...@@ -619,8 +698,10 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
.clear(); .clear();
} }
}, },
buttonStyleData: ddtheme.buttonStyleData, buttonStyleData:
iconStyleData: ddtheme.iconStyleData, ddtheme.buttonStyleData,
iconStyleData:
ddtheme.iconStyleData,
menuItemStyleData: menuItemStyleData:
ddtheme.menuItemStyleData, ddtheme.menuItemStyleData,
dropdownStyleData: dropdownStyleData:
...@@ -643,7 +724,6 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{ ...@@ -643,7 +724,6 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
focusNodes[5], focusNodes[5],
null, null,
TextInputAction.done, TextInputAction.done,
), ),
errorWidget(context, provider.addressError), errorWidget(context, provider.addressError),
Text( Text(
...@@ -667,10 +747,7 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{ ...@@ -667,10 +747,7 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
focusNodes[7], focusNodes[7],
TextInputAction.next, TextInputAction.next,
), ),
errorWidget( errorWidget(context, provider.banknameError),
context,
provider.banknameError,
),
textControllerWidget( textControllerWidget(
context, context,
provider.branchNameController, provider.branchNameController,
...@@ -680,7 +757,9 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{ ...@@ -680,7 +757,9 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
TextInputType.text, TextInputType.text,
false, false,
null, null,
focusNodes[7],focusNodes[8],TextInputAction.next focusNodes[7],
focusNodes[8],
TextInputAction.next,
), ),
errorWidget( errorWidget(
context, context,
...@@ -696,12 +775,10 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{ ...@@ -696,12 +775,10 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
false, false,
null, null,
focusNodes[8], focusNodes[8],
focusNodes[9],TextInputAction.next focusNodes[9],
), TextInputAction.next,
errorWidget(
context,
provider.bankIFSCError,
), ),
errorWidget(context, provider.bankIFSCError),
textControllerWidget( textControllerWidget(
context, context,
provider.bankHolderNameController, provider.bankHolderNameController,
...@@ -712,7 +789,8 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{ ...@@ -712,7 +789,8 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
false, false,
null, null,
focusNodes[9], focusNodes[9],
focusNodes[10],TextInputAction.next focusNodes[10],
TextInputAction.next,
), ),
errorWidget( errorWidget(
context, context,
...@@ -728,7 +806,8 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{ ...@@ -728,7 +806,8 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
false, false,
FilteringTextInputFormatter.digitsOnly, FilteringTextInputFormatter.digitsOnly,
focusNodes[10], focusNodes[10],
focusNodes[11],TextInputAction.next focusNodes[11],
TextInputAction.next,
), ),
errorWidget( errorWidget(
context, context,
...@@ -745,7 +824,7 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{ ...@@ -745,7 +824,7 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
null, null,
focusNodes[11], focusNodes[11],
focusNodes[12], focusNodes[12],
TextInputAction.next TextInputAction.next,
), ),
errorWidget(context, provider.upiError), errorWidget(context, provider.upiError),
], ],
...@@ -765,8 +844,7 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{ ...@@ -765,8 +844,7 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(16),
), ),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
Text( Text(
"Contact Details", "Contact Details",
...@@ -779,8 +857,7 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{ ...@@ -779,8 +857,7 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
textControllerWidget( textControllerWidget(
context, context,
provider provider.contectPersonDesignationController,
.contectPersonDesignationController,
"Contact Person Designation", "Contact Person Designation",
"Enter Contact Person Designation", "Enter Contact Person Designation",
provider.updateDesignation, provider.updateDesignation,
...@@ -788,7 +865,8 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{ ...@@ -788,7 +865,8 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
false, false,
null, null,
focusNodes[13], focusNodes[13],
focusNodes[14],TextInputAction.next focusNodes[14],
TextInputAction.next,
), ),
errorWidget( errorWidget(
context, context,
...@@ -813,13 +891,11 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{ ...@@ -813,13 +891,11 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
false, false,
FilteringTextInputFormatter.digitsOnly, FilteringTextInputFormatter.digitsOnly,
focusNodes[14], focusNodes[14],
focusNodes[15],TextInputAction.next, focusNodes[15],
TextInputAction.next,
10, 10,
), ),
errorWidget( errorWidget(context, provider.altMobError),
context,
provider.altMobError,
),
textControllerWidget( textControllerWidget(
context, context,
provider.contectPersonTeleController, provider.contectPersonTeleController,
...@@ -830,7 +906,8 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{ ...@@ -830,7 +906,8 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
false, false,
FilteringTextInputFormatter.digitsOnly, FilteringTextInputFormatter.digitsOnly,
focusNodes[15], focusNodes[15],
focusNodes[16],TextInputAction.next focusNodes[16],
TextInputAction.next,
), ),
errorWidget(context, provider.teleError), errorWidget(context, provider.teleError),
textControllerWidget( textControllerWidget(
...@@ -843,7 +920,8 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{ ...@@ -843,7 +920,8 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
false, false,
null, null,
focusNodes[16], focusNodes[16],
focusNodes[17],TextInputAction.next focusNodes[17],
TextInputAction.next,
), ),
errorWidget(context, provider.mailError), errorWidget(context, provider.mailError),
], ],
...@@ -865,7 +943,7 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{ ...@@ -865,7 +943,7 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
? null ? null
: () { : () {
provider.submitClickced = true; provider.submitClickced = true;
provider.submitCommonAccountsAPI(context,widget.from); provider.submitCommonAccountsAPI(context, widget.from);
}, },
child: Container( child: Container(
height: 45, height: 45,
...@@ -891,8 +969,6 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{ ...@@ -891,8 +969,6 @@ class _AddcommonpaymentState extends State<Addcommonpayment>{
), ),
), ),
), ),
),
),
); );
}, },
); );
......
import 'dart:io'; import 'dart:io';
import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:generp/Notifiers/crmProvider/crmLeadDetailsProvider.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/AppointmentDetails.dart';
import 'package:generp/screens/crm/FollowUpDetails.dart'; import 'package:generp/screens/crm/FollowUpDetails.dart';
import 'package:generp/screens/crm/QuotationDetails.dart'; import 'package:generp/screens/crm/QuotationDetails.dart';
...@@ -32,10 +34,17 @@ class LeadDetailsByMode extends StatefulWidget { ...@@ -32,10 +34,17 @@ class LeadDetailsByMode extends StatefulWidget {
} }
class _LeadDetailsByModeState extends State<LeadDetailsByMode> { class _LeadDetailsByModeState extends State<LeadDetailsByMode> {
Map _source = {ConnectivityResult.mobile: true};
final MyConnectivity _connectivity = MyConnectivity.instance;
@override @override
void initState() { void initState() {
// TODO: implement initState // TODO: implement initState
super.initState(); super.initState();
_connectivity.initialise();
_connectivity.myStream.listen((source) {
setState(() => _source = source);
});
WidgetsBinding.instance.addPostFrameCallback((timeStamp) { WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
final provider = Provider.of<crmLeadDetailsProvider>( final provider = Provider.of<crmLeadDetailsProvider>(
context, context,
...@@ -45,33 +54,60 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> { ...@@ -45,33 +54,60 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> {
}); });
} }
@override
void dispose() {
// TODO: implement dispose
super.dispose();
_connectivity.disposeStream();
}
@override @override
Widget build(BuildContext context) { 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>( return Consumer<crmLeadDetailsProvider>(
builder: (context, provider, child) { builder: (context, provider, child) {
var leadDetails = provider.leadDetails; var leadDetails = provider.leadDetails;
var headings1 = [ var headings1 = [
"Account Manager Name", "Account Manager Name",
"Account Created By", "Account Created By",
"Address", "Address",
"Lead Status", "Lead Status",
"Last Followup Date" "Last Followup Date",
]; ];
var subHeadings1 = [ var subHeadings1 = [
provider.accountDetails!.accManager ?? "-",
provider.accountDetails!.accManager??"-", provider.accountDetails!.owner ?? "-",
provider.accountDetails!.owner??"-", provider.leadDetails!.address ?? "-",
provider.leadDetails!.address??"-", provider.leadDetails!.status ?? "-",
provider.leadDetails!.status??"-", provider.followupDetails.first!.fdate ?? "-",
provider.followupDetails.first!.fdate??"-",
]; ];
var headings2 = [ var headings2 = [
"State", "State",
"District", "District",
...@@ -84,29 +120,25 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> { ...@@ -84,29 +120,25 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> {
]; ];
var subHeadings2 = [ var subHeadings2 = [
provider.accountDetails!.state??"-", provider.accountDetails!.state ?? "-",
provider.accountDetails!.district??"-", provider.accountDetails!.district ?? "-",
provider.accountDetails!.subLocality??"-", provider.accountDetails!.subLocality ?? "-",
provider.accountDetails!.source??"-", provider.accountDetails!.source ?? "-",
provider.accountDetails!.reference??"-", provider.accountDetails!.reference ?? "-",
provider.accountDetails!.team??"-", provider.accountDetails!.team ?? "-",
provider.accountDetails!.segment??"-", provider.accountDetails!.segment ?? "-",
"${provider.leadDetails!.lage??"-"} days", "${provider.leadDetails!.lage ?? "-"} days",
]; ];
var totalHeadings = [...headings1]; var totalHeadings = [...headings1];
var totalSubHeadings = [...subHeadings1]; var totalSubHeadings = [...subHeadings1];
if(provider.showMoreDetails){ if (provider.showMoreDetails) {
totalHeadings = [...headings1,...headings2]; totalHeadings = [...headings1, ...headings2];
totalSubHeadings = [...subHeadings1,...subHeadings2]; totalSubHeadings = [...subHeadings1, ...subHeadings2];
} }
return WillPopScope( return Scaffold(
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
appBar: appbar2( appBar: appbar2(
context, context,
...@@ -168,7 +200,7 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> { ...@@ -168,7 +200,7 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> {
), ),
), ),
SizedBox(width: 10), SizedBox(width: 10),
if(provider.showEditButton=="1") if (provider.showEditButton == "1")
Expanded( Expanded(
flex: 1, flex: 1,
child: InkResponse( child: InkResponse(
...@@ -181,12 +213,16 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> { ...@@ -181,12 +213,16 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> {
leadID: leadDetails.id, leadID: leadDetails.id,
mode: widget.mode, mode: widget.mode,
accountID: leadDetails.accId, accountID: leadDetails.accId,
companyName:leadDetails.name, companyName: leadDetails.name,
), ),
), ),
); );
if(res==true){ if (res == true) {
provider.crmLeadDetailsAPIFunction(context, widget.leadId, widget.mode); provider.crmLeadDetailsAPIFunction(
context,
widget.leadId,
widget.mode,
);
} }
}, },
child: Container( child: Container(
...@@ -261,24 +297,21 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> { ...@@ -261,24 +297,21 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> {
provider.showMoreDetails = !provider.showMoreDetails; provider.showMoreDetails = !provider.showMoreDetails;
}, },
child: Container( child: Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(vertical: 5),
vertical: 5,
),
child: Row( child: Row(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.center,
CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.center,
children: [ children: [
Text( Text(
provider.showMoreDetails?"- Show Less": "+ More Details", provider.showMoreDetails
? "- Show Less"
: "+ More Details",
style: TextStyle( style: TextStyle(
fontFamily: "JakartaMedium", fontFamily: "JakartaMedium",
fontSize: 14, fontSize: 14,
color: AppColors.app_blue, color: AppColors.app_blue,
), ),
), ),
], ],
), ),
), ),
...@@ -288,12 +321,6 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> { ...@@ -288,12 +321,6 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> {
), ),
), ),
), ),
),
),
onWillPop: () {
return onBackPressed(context);
},
); );
}, },
); );
...@@ -336,7 +363,10 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> { ...@@ -336,7 +363,10 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> {
left: 15, left: 15,
right: 15, right: 15,
top: 10, top: 10,
),padding: EdgeInsets.only( bottom: MediaQuery.of(context).viewInsets.bottom,), ),
padding: EdgeInsets.only(
bottom: MediaQuery.of(context).viewInsets.bottom,
),
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
...@@ -345,16 +375,16 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> { ...@@ -345,16 +375,16 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> {
SizedBox(height: 15), SizedBox(height: 15),
...List.generate(assetnames.length, (index) { ...List.generate(assetnames.length, (index) {
return ListTile( return ListTile(
onTap: () { onTap: () {
Navigator.pop(context,true); Navigator.pop(context, true);
switch (index) { switch (index) {
case 0: case 0:
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => Productdetails( builder:
(context) => Productdetails(
leadID: provider.leadDetails.id, leadID: provider.leadDetails.id,
mode: widget.mode, mode: widget.mode,
), ),
...@@ -418,8 +448,6 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> { ...@@ -418,8 +448,6 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> {
), ),
); );
}), }),
], ],
), ),
), ),
......
import 'dart:io'; import 'dart:io';
import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:dropdown_button2/dropdown_button2.dart'; import 'package:dropdown_button2/dropdown_button2.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
...@@ -10,6 +11,7 @@ import 'package:generp/Models/crmModels/GetSourceOnReferenceResponse.dart'; ...@@ -10,6 +11,7 @@ import 'package:generp/Models/crmModels/GetSourceOnReferenceResponse.dart';
import 'package:generp/Models/crmModels/GetSubLocOnDistrictResponse.dart'; import 'package:generp/Models/crmModels/GetSubLocOnDistrictResponse.dart';
import 'package:generp/Models/crmModels/LeadListViewResponse.dart'; import 'package:generp/Models/crmModels/LeadListViewResponse.dart';
import 'package:generp/Notifiers/crmProvider/LeadListProvider.dart'; import 'package:generp/Notifiers/crmProvider/LeadListProvider.dart';
import 'package:generp/Utils/commonServices.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:generp/screens/screensExports.dart'; import 'package:generp/screens/screensExports.dart';
...@@ -36,11 +38,17 @@ class Leadlistbymode extends StatefulWidget { ...@@ -36,11 +38,17 @@ class Leadlistbymode extends StatefulWidget {
class _LeadlistbymodeState extends State<Leadlistbymode> { class _LeadlistbymodeState extends State<Leadlistbymode> {
Dropdowntheme ddtheme = Dropdowntheme(); Dropdowntheme ddtheme = Dropdowntheme();
Map _source = {ConnectivityResult.mobile: true};
final MyConnectivity _connectivity = MyConnectivity.instance;
@override @override
void initState() { void initState() {
// TODO: implement initState // TODO: implement initState
super.initState(); super.initState();
_connectivity.initialise();
_connectivity.myStream.listen((source) {
setState(() => _source = source);
});
WidgetsBinding.instance.addPostFrameCallback((timeStamp) { WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
final provider = Provider.of<Leadlistprovider>(context, listen: false); final provider = Provider.of<Leadlistprovider>(context, listen: false);
provider.crmLeadListViewAPIFunction(context, widget.mode); provider.crmLeadListViewAPIFunction(context, widget.mode);
...@@ -78,19 +86,45 @@ class _LeadlistbymodeState extends State<Leadlistbymode> { ...@@ -78,19 +86,45 @@ class _LeadlistbymodeState extends State<Leadlistbymode> {
}); });
} }
@override
void dispose() {
// TODO: implement dispose
super.dispose();
_connectivity.disposeStream();
}
@override @override
Widget build(BuildContext context) { 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>( return Consumer<Leadlistprovider>(
builder: (context, provider, child) { builder: (context, provider, child) {
final crmLists = provider.crmLeadList; final crmLists = provider.crmLeadList;
return WillPopScope( return Scaffold(
onWillPop: () {
return onBackPressed(context);
},
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
appBar: appbar2( appBar: appbar2(
context, context,
...@@ -111,7 +145,8 @@ class _LeadlistbymodeState extends State<Leadlistbymode> { ...@@ -111,7 +145,8 @@ class _LeadlistbymodeState extends State<Leadlistbymode> {
), ),
), ),
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
body: provider.isLoading body:
provider.isLoading
? Center( ? Center(
child: CircularProgressIndicator.adaptive( child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>( valueColor: AlwaysStoppedAnimation<Color>(
...@@ -130,9 +165,7 @@ class _LeadlistbymodeState extends State<Leadlistbymode> { ...@@ -130,9 +165,7 @@ class _LeadlistbymodeState extends State<Leadlistbymode> {
itemBuilder: (context, index) { itemBuilder: (context, index) {
if (crmLists.isEmpty) { if (crmLists.isEmpty) {
return SizedBox( return SizedBox(
child: Center( child: Center(child: Text("No Data Available")),
child: Text("No Data Available"),
),
); );
} }
return Container( return Container(
...@@ -160,8 +193,9 @@ class _LeadlistbymodeState extends State<Leadlistbymode> { ...@@ -160,8 +193,9 @@ class _LeadlistbymodeState extends State<Leadlistbymode> {
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFFE6F6FF), color: Color(0xFFE6F6FF),
borderRadius: borderRadius: BorderRadius.circular(
BorderRadius.circular(8), 8,
),
), ),
child: SvgPicture.asset( child: SvgPicture.asset(
"assets/svg/se_block_head.svg", "assets/svg/se_block_head.svg",
...@@ -196,8 +230,9 @@ class _LeadlistbymodeState extends State<Leadlistbymode> { ...@@ -196,8 +230,9 @@ class _LeadlistbymodeState extends State<Leadlistbymode> {
vertical: 10, vertical: 10,
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius: BorderRadius.circular(
BorderRadius.circular(8), 8,
),
color: Color(0xFFE3FFE0), color: Color(0xFFE3FFE0),
), ),
child: Center( child: Center(
...@@ -234,9 +269,7 @@ class _LeadlistbymodeState extends State<Leadlistbymode> { ...@@ -234,9 +269,7 @@ class _LeadlistbymodeState extends State<Leadlistbymode> {
crmLists[index].openStatus, crmLists[index].openStatus,
]; ];
return Container( return Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(vertical: 5),
vertical: 5,
),
child: Row( child: Row(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
...@@ -283,9 +316,7 @@ class _LeadlistbymodeState extends State<Leadlistbymode> { ...@@ -283,9 +316,7 @@ class _LeadlistbymodeState extends State<Leadlistbymode> {
); );
}, },
child: Container( child: Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(vertical: 5),
vertical: 5,
),
child: Row( child: Row(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.center, CrossAxisAlignment.center,
...@@ -316,8 +347,6 @@ class _LeadlistbymodeState extends State<Leadlistbymode> { ...@@ -316,8 +347,6 @@ class _LeadlistbymodeState extends State<Leadlistbymode> {
), ),
) )
: Emptywidget(context), : Emptywidget(context),
),
),
); );
}, },
); );
......
import 'dart:io';
import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:dropdown_button2/dropdown_button2.dart'; import 'package:dropdown_button2/dropdown_button2.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart'; import 'package:flutter/gestures.dart';
...@@ -5,6 +8,7 @@ import 'package:flutter/material.dart'; ...@@ -5,6 +8,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:generp/Notifiers/NearByGeneratorsProvider.dart'; import 'package:generp/Notifiers/NearByGeneratorsProvider.dart';
import 'package:generp/Utils/app_colors.dart'; import 'package:generp/Utils/app_colors.dart';
import 'package:generp/Utils/commonServices.dart';
import 'package:generp/Utils/commonWidgets.dart'; import 'package:generp/Utils/commonWidgets.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:interactive_slider/interactive_slider.dart'; import 'package:interactive_slider/interactive_slider.dart';
...@@ -21,37 +25,85 @@ class NearbyOpenLeads extends StatefulWidget { ...@@ -21,37 +25,85 @@ class NearbyOpenLeads extends StatefulWidget {
} }
class _NearbyOpenLeadsState extends State<NearbyOpenLeads> { class _NearbyOpenLeadsState extends State<NearbyOpenLeads> {
Map _source = {ConnectivityResult.mobile: true};
final MyConnectivity _connectivity = MyConnectivity.instance;
Dropdowntheme ddtheme = Dropdowntheme(); Dropdowntheme ddtheme = Dropdowntheme();
@override @override
void initState() { void initState() {
// TODO: implement initState // TODO: implement initState
super.initState(); super.initState();
_connectivity.initialise();
_connectivity.myStream.listen((source) {
setState(() => _source = source);
});
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
final provider = Provider.of<crmNearbyOpenLeadsProvider>(context,listen: false); final provider = Provider.of<crmNearbyOpenLeadsProvider>(
context,
listen: false,
);
provider.getLocationPermission(context); provider.getLocationPermission(context);
},); });
}
@override
void dispose() {
// TODO: implement dispose
super.dispose();
_connectivity.disposeStream();
} }
@override @override
Widget build(BuildContext context) { 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"); debugPrint("Nearbygenerators widget rebuilt");
return Consumer<crmNearbyOpenLeadsProvider>(builder: (context, provider, child) { return Consumer<crmNearbyOpenLeadsProvider>(
builder: (context, provider, child) {
var sendWidget = GestureDetector( var sendWidget = GestureDetector(
onTap: () { onTap: () {
_showFilterBottomSheet(context); _showFilterBottomSheet(context);
}, },
child: SvgPicture.asset("assets/svg/filter_ic.svg",height: 25,)); child: SvgPicture.asset("assets/svg/filter_ic.svg", height: 25),
);
return WillPopScope( return Scaffold(
onWillPop: () => onBackPressed(context),
child: Scaffold(
resizeToAvoidBottomInset: true, 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, backgroundColor: AppColors.scaffold_bg_color,
body: SafeArea( body: SafeArea(
child: Container( child: Container(
child: SingleChildScrollView( child: SingleChildScrollView(
child:Column( child: Column(
children: [ children: [
ClipRRect( ClipRRect(
// Apply border radius using ClipRRect // Apply border radius using ClipRRect
...@@ -62,21 +114,28 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> { ...@@ -62,21 +114,28 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> {
// padding: EdgeInsets.fromLTRB(10, 20, 10, 20), // padding: EdgeInsets.fromLTRB(10, 20, 10, 20),
child: Container( child: Container(
height: MediaQuery.of(context).size.height, height: MediaQuery.of(context).size.height,
child: Stack(children: [ child: Stack(
children: [
GoogleMap( GoogleMap(
myLocationEnabled: true, myLocationEnabled: true,
zoomGesturesEnabled: true, zoomGesturesEnabled: true,
zoomControlsEnabled: true, zoomControlsEnabled: true,
gestureRecognizers: { gestureRecognizers: {
Factory<OneSequenceGestureRecognizer>(() => EagerGestureRecognizer()), Factory<OneSequenceGestureRecognizer>(
Factory<PanGestureRecognizer>(() => PanGestureRecognizer()), () => EagerGestureRecognizer(),
Factory<ScaleGestureRecognizer>(() => ScaleGestureRecognizer()), // Prioritize pinch-to-zoom ),
Factory<PanGestureRecognizer>(
() => PanGestureRecognizer(),
),
Factory<ScaleGestureRecognizer>(
() => ScaleGestureRecognizer(),
), // Prioritize pinch-to-zoom
}, },
initialCameraPosition: CameraPosition( initialCameraPosition: CameraPosition(
target: provider.startLocation, target: provider.startLocation,
zoom:14.0 zoom: 14.0,
), ),
markers:provider.markers.toSet(), markers: provider.markers.toSet(),
mapType: MapType.normal, mapType: MapType.normal,
onMapCreated: (controller) { onMapCreated: (controller) {
setState(() { setState(() {
...@@ -84,10 +143,11 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> { ...@@ -84,10 +143,11 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> {
}); });
}, },
onCameraMove: (position) { onCameraMove: (position) {
provider.onCameraMove(context,position); provider.onCameraMove(context, position);
}, },
), ),
]), ],
),
), ),
), ),
], ],
...@@ -95,12 +155,11 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> { ...@@ -95,12 +155,11 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> {
), ),
), ),
), ),
),
); );
},); },
);
} }
Future<void> _showFilterBottomSheet(BuildContext context) { Future<void> _showFilterBottomSheet(BuildContext context) {
return showModalBottomSheet( return showModalBottomSheet(
useSafeArea: true, useSafeArea: true,
...@@ -115,14 +174,17 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> { ...@@ -115,14 +174,17 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> {
builder: (context, setState) { builder: (context, setState) {
return SafeArea( return SafeArea(
child: Consumer<crmNearbyOpenLeadsProvider>( child: Consumer<crmNearbyOpenLeadsProvider>(
builder: (context,provider,child) { builder: (context, provider, child) {
return Container( return Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
bottom: 15, bottom: 15,
left: 15, left: 15,
right: 15, right: 15,
top: 15, top: 15,
),padding: EdgeInsets.only( bottom: MediaQuery.of(context).viewInsets.bottom,), ),
padding: EdgeInsets.only(
bottom: MediaQuery.of(context).viewInsets.bottom,
),
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
...@@ -163,15 +225,17 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> { ...@@ -163,15 +225,17 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> {
InteractiveSlider( InteractiveSlider(
min: 1.0, min: 1.0,
max: 50.0, max: 50.0,
padding: EdgeInsets.symmetric(horizontal: 0, padding: EdgeInsets.symmetric(
vertical: 0), horizontal: 0,
vertical: 0,
),
iconSize: 0.0, iconSize: 0.0,
enabled: true, enabled: true,
// backgroundColor: AppColors.app_blue, // backgroundColor: AppColors.app_blue,
foregroundColor: AppColors.app_blue, foregroundColor: AppColors.app_blue,
segmentDividerColor:Color(0xFFF6F6F8), segmentDividerColor: Color(0xFFF6F6F8),
onChanged: (value) { onChanged: (value) {
provider.currentValue = value; provider.currentValue = value;
// provider.debounce(() { // provider.debounce(() {
...@@ -199,7 +263,10 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> { ...@@ -199,7 +263,10 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> {
child: InkWell( child: InkWell(
onTap: () { onTap: () {
provider.debounce(() { provider.debounce(() {
provider.LoadNearbyOpenLeadsAPI(context,provider.currentValue); provider.LoadNearbyOpenLeadsAPI(
context,
provider.currentValue,
);
Navigator.pop(context); Navigator.pop(context);
}, Duration(milliseconds: 500)); }, Duration(milliseconds: 500));
}, },
...@@ -212,14 +279,14 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> { ...@@ -212,14 +279,14 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> {
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(14.0), borderRadius: BorderRadius.circular(14.0),
color: AppColors.app_blue color: AppColors.app_blue,
), ),
child: Text( child: Text(
"Search", "Search",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontFamily: 'JakartaMedium', fontFamily: 'JakartaMedium',
color: Colors.white color: Colors.white,
), ),
), ),
), ),
...@@ -231,7 +298,7 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> { ...@@ -231,7 +298,7 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> {
), ),
), ),
); );
} },
), ),
); );
}, },
......
import 'dart:io'; import 'dart:io';
import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:dropdown_button2/dropdown_button2.dart'; import 'package:dropdown_button2/dropdown_button2.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:generp/Notifiers/crmProvider/crmEditProspectAccountProvider.dart'; import 'package:generp/Notifiers/crmProvider/crmEditProspectAccountProvider.dart';
import 'package:generp/Notifiers/crmProvider/crmLeadDetailsProvider.dart'; import 'package:generp/Notifiers/crmProvider/crmLeadDetailsProvider.dart';
import 'package:generp/Utils/commonServices.dart';
import 'package:generp/Utils/dropdownTheme.dart'; import 'package:generp/Utils/dropdownTheme.dart';
import 'package:generp/screens/crm/prospectContactDetails.dart'; import 'package:generp/screens/crm/prospectContactDetails.dart';
import 'package:generp/screens/crm/prospectLeadDetails.dart'; import 'package:generp/screens/crm/prospectLeadDetails.dart';
...@@ -39,11 +41,17 @@ class ProspectDetailsByMode extends StatefulWidget { ...@@ -39,11 +41,17 @@ class ProspectDetailsByMode extends StatefulWidget {
class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
Dropdowntheme ddtheme = Dropdowntheme(); Dropdowntheme ddtheme = Dropdowntheme();
Map _source = {ConnectivityResult.mobile: true};
final MyConnectivity _connectivity = MyConnectivity.instance;
@override @override
void initState() { void initState() {
// TODO: implement initState // TODO: implement initState
super.initState(); super.initState();
_connectivity.initialise();
_connectivity.myStream.listen((source) {
setState(() => _source = source);
});
WidgetsBinding.instance.addPostFrameCallback((timeStamp) { WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
final provider = Provider.of<crmProspectDetailsProvider>( final provider = Provider.of<crmProspectDetailsProvider>(
context, context,
...@@ -63,6 +71,13 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -63,6 +71,13 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
}); });
} }
@override
void dispose() {
// TODO: implement dispose
super.dispose();
_connectivity.disposeStream();
}
void prefill() async { void prefill() async {
final editProvider = Provider.of<Crmeditprospectaccountprovider>( final editProvider = Provider.of<Crmeditprospectaccountprovider>(
context, context,
...@@ -160,6 +175,32 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -160,6 +175,32 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
@override @override
Widget build(BuildContext context) { 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< return Consumer2<
crmProspectDetailsProvider, crmProspectDetailsProvider,
Crmeditprospectaccountprovider Crmeditprospectaccountprovider
...@@ -167,11 +208,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -167,11 +208,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
builder: (context, provider, editProvider, child) { builder: (context, provider, editProvider, child) {
var leadDetails = provider.accountDetails; var leadDetails = provider.accountDetails;
return WillPopScope( return Scaffold(
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
appBar: appbar2( appBar: appbar2(
context, context,
...@@ -233,7 +270,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -233,7 +270,7 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
), ),
), ),
if(provider.showTransferAccount=="1")...[ if (provider.showTransferAccount == "1") ...[
SizedBox(width: 5), SizedBox(width: 5),
Expanded( Expanded(
flex: 1, flex: 1,
...@@ -339,12 +376,6 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -339,12 +376,6 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
), ),
), ),
), ),
),
),
onWillPop: () {
return onBackPressed(context);
},
); );
}, },
); );
...@@ -560,8 +591,11 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -560,8 +591,11 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
return StatefulBuilder( return StatefulBuilder(
builder: (context, setState) { builder: (context, setState) {
return SafeArea( return SafeArea(
child: Consumer2<Crmeditprospectaccountprovider,crmProspectDetailsProvider>( child: Consumer2<
builder: (context, provider,prosDetProvider, child) { Crmeditprospectaccountprovider,
crmProspectDetailsProvider
>(
builder: (context, provider, prosDetProvider, child) {
return Container( return Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
bottom: 15, bottom: 15,
...@@ -777,7 +811,11 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -777,7 +811,11 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
widget.mode, widget.mode,
provider.selectedDistrictId, provider.selectedDistrictId,
); );
prosDetProvider.crmProspectDetailsAPIFunction(context, widget.leadId); prosDetProvider
.crmProspectDetailsAPIFunction(
context,
widget.leadId,
);
} }
} }
}, },
...@@ -892,7 +930,6 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -892,7 +930,6 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
provider.selectedSubLocationId, provider.selectedSubLocationId,
); );
Navigator.pop(context); Navigator.pop(context);
}, },
child: Container( child: Container(
height: 45, height: 45,
......
import 'dart:io'; import 'dart:io';
import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:dropdown_button2/dropdown_button2.dart'; import 'package:dropdown_button2/dropdown_button2.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:generp/Utils/commonServices.dart';
import 'package:generp/Utils/dropdownTheme.dart'; import 'package:generp/Utils/dropdownTheme.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
...@@ -23,37 +25,68 @@ class ProspectListByMode extends StatefulWidget { ...@@ -23,37 +25,68 @@ class ProspectListByMode extends StatefulWidget {
} }
class _ProspectListByModeState extends State<ProspectListByMode> { class _ProspectListByModeState extends State<ProspectListByMode> {
Dropdowntheme ddtheme = Dropdowntheme(); Dropdowntheme ddtheme = Dropdowntheme();
Map _source = {ConnectivityResult.mobile: true};
final MyConnectivity _connectivity = MyConnectivity.instance;
@override @override
void initState() { void initState() {
// TODO: implement initState // TODO: implement initState
super.initState(); super.initState();
_connectivity.initialise();
_connectivity.myStream.listen((source) {
setState(() => _source = source);
});
WidgetsBinding.instance.addPostFrameCallback((timeStamp) { WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
final provider = Provider.of<ProspectListProvider>(context, listen: false); final provider = Provider.of<ProspectListProvider>(
provider.crmProspectListViewAPIFunction(context, widget.mode);
provider.crmProspectListAPIFunction(
context, 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 @override
Widget build(BuildContext context) { 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>( return Consumer<ProspectListProvider>(
builder: (context, provider, child) { builder: (context, provider, child) {
final crmLists = provider.accountList; final crmLists = provider.accountList;
return WillPopScope( // ignore: deprecated_member_use
onWillPop: () { return Scaffold(
return onBackPressed(context);
},
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
appBar: appbar2( appBar: appbar2(
context, context,
...@@ -74,7 +107,8 @@ class _ProspectListByModeState extends State<ProspectListByMode> { ...@@ -74,7 +107,8 @@ class _ProspectListByModeState extends State<ProspectListByMode> {
), ),
), ),
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
body: provider.isLoading body:
provider.isLoading
? Center( ? Center(
child: CircularProgressIndicator.adaptive( child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>( valueColor: AlwaysStoppedAnimation<Color>(
...@@ -93,9 +127,7 @@ class _ProspectListByModeState extends State<ProspectListByMode> { ...@@ -93,9 +127,7 @@ class _ProspectListByModeState extends State<ProspectListByMode> {
itemBuilder: (context, index) { itemBuilder: (context, index) {
if (crmLists.isEmpty) { if (crmLists.isEmpty) {
return SizedBox( return SizedBox(
child: Center( child: Center(child: Text("No Data Available")),
child: Text("No Data Available"),
),
); );
} }
...@@ -125,8 +157,9 @@ class _ProspectListByModeState extends State<ProspectListByMode> { ...@@ -125,8 +157,9 @@ class _ProspectListByModeState extends State<ProspectListByMode> {
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFFE6F6FF), color: Color(0xFFE6F6FF),
borderRadius: borderRadius: BorderRadius.circular(
BorderRadius.circular(8), 8,
),
), ),
child: SvgPicture.asset( child: SvgPicture.asset(
"assets/svg/se_block_head.svg", "assets/svg/se_block_head.svg",
...@@ -153,7 +186,6 @@ class _ProspectListByModeState extends State<ProspectListByMode> { ...@@ -153,7 +186,6 @@ class _ProspectListByModeState extends State<ProspectListByMode> {
), ),
), ),
), ),
], ],
), ),
Divider( Divider(
...@@ -179,9 +211,7 @@ class _ProspectListByModeState extends State<ProspectListByMode> { ...@@ -179,9 +211,7 @@ class _ProspectListByModeState extends State<ProspectListByMode> {
crmLists[index].gstNumber, crmLists[index].gstNumber,
]; ];
return Container( return Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(vertical: 5),
vertical: 5,
),
child: Row( child: Row(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
...@@ -215,21 +245,20 @@ class _ProspectListByModeState extends State<ProspectListByMode> { ...@@ -215,21 +245,20 @@ class _ProspectListByModeState extends State<ProspectListByMode> {
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: builder:
(context) => (context) => ProspectDetailsByMode(
ProspectDetailsByMode(
pageTitleName: pageTitleName:
widget widget.pageTitleName,
.pageTitleName,
mode: widget.mode, mode: widget.mode,
leadId:provider.accountList[index].aid, leadId:
provider
.accountList[index]
.aid,
), ),
), ),
); );
}, },
child: Container( child: Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(vertical: 5),
vertical: 5,
),
child: Row( child: Row(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.center, CrossAxisAlignment.center,
...@@ -255,16 +284,11 @@ class _ProspectListByModeState extends State<ProspectListByMode> { ...@@ -255,16 +284,11 @@ class _ProspectListByModeState extends State<ProspectListByMode> {
], ],
), ),
); );
}, },
), ),
), ),
) )
: : Emptywidget(context),
Emptywidget(context)
),
),
); );
}, },
); );
...@@ -292,7 +316,9 @@ class _ProspectListByModeState extends State<ProspectListByMode> { ...@@ -292,7 +316,9 @@ class _ProspectListByModeState extends State<ProspectListByMode> {
right: 15, right: 15,
top: 10, top: 10,
), ),
padding: EdgeInsets.only(bottom:MediaQuery.of(context).viewInsets.bottom,), padding: EdgeInsets.only(
bottom: MediaQuery.of(context).viewInsets.bottom,
),
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
...@@ -314,7 +340,7 @@ class _ProspectListByModeState extends State<ProspectListByMode> { ...@@ -314,7 +340,7 @@ class _ProspectListByModeState extends State<ProspectListByMode> {
], ],
), ),
if(widget.mode!="executive")...[ if (widget.mode != "executive") ...[
TextWidget(context, "Employee"), TextWidget(context, "Employee"),
DropdownButtonHideUnderline( DropdownButtonHideUnderline(
child: Row( child: Row(
...@@ -340,31 +366,37 @@ class _ProspectListByModeState extends State<ProspectListByMode> { ...@@ -340,31 +366,37 @@ class _ProspectListByModeState extends State<ProspectListByMode> {
), ),
) )
.toList(), .toList(),
value:provider.employeesList.contains(provider.selectedEmployees) value:
provider.employeesList.contains(
provider.selectedEmployees,
)
? provider.selectedEmployees ? provider.selectedEmployees
: null, : null,
// value: provider.selectedEmployees, // value: provider.selectedEmployees,
onChanged: (Employees? value) { onChanged: (Employees? value) {
if (value != null) { if (value != null) {
if(provider.employeesList.isNotEmpty){ if (provider
.employeesList
.isNotEmpty) {
provider.selectedEmployees = value; provider.selectedEmployees = value;
provider.selectedEmployeeId = value!.id!; provider.selectedEmployeeId =
provider.selectedEmployeeValue = value!.name!; value!.id!;
provider.selectedEmployeeValue =
value!.name!;
} }
} }
}, },
isExpanded: true, isExpanded: true,
dropdownSearchData: DropdownSearchData( dropdownSearchData: DropdownSearchData(
searchInnerWidgetHeight: 50, searchInnerWidgetHeight: 50,
searchController: provider.searchController, searchController:
provider.searchController,
searchInnerWidget: Padding( searchInnerWidget: Padding(
padding: const EdgeInsets.all(8), padding: const EdgeInsets.all(8),
child: TextFormField( child: TextFormField(
controller: controller:
provider provider.searchController,
.searchController,
decoration: InputDecoration( decoration: InputDecoration(
isDense: true, isDense: true,
contentPadding: contentPadding:
...@@ -396,8 +428,10 @@ class _ProspectListByModeState extends State<ProspectListByMode> { ...@@ -396,8 +428,10 @@ class _ProspectListByModeState extends State<ProspectListByMode> {
}, },
buttonStyleData: ddtheme.buttonStyleData, buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData, iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData, menuItemStyleData:
dropdownStyleData: ddtheme.dropdownStyleData, ddtheme.menuItemStyleData,
dropdownStyleData:
ddtheme.dropdownStyleData,
), ),
), ),
], ],
...@@ -426,17 +460,23 @@ class _ProspectListByModeState extends State<ProspectListByMode> { ...@@ -426,17 +460,23 @@ class _ProspectListByModeState extends State<ProspectListByMode> {
null, null,
), ),
InkResponse( InkResponse(
onTap: () { onTap: () {
provider.crmProspectListAPIFunction(context,widget.mode, provider.selectedEmployeeId); provider.crmProspectListAPIFunction(
context,
widget.mode,
provider.selectedEmployeeId,
);
Navigator.pop(context); Navigator.pop(context);
}, },
child: Container( child: Container(
height: 45, height: 45,
alignment: Alignment.center, alignment: Alignment.center,
margin: EdgeInsets.symmetric(horizontal: 10), margin: EdgeInsets.symmetric(horizontal: 10),
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5), padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
decoration: BoxDecoration( decoration: BoxDecoration(
color: AppColors.app_blue, color: AppColors.app_blue,
borderRadius: BorderRadius.circular(15), borderRadius: BorderRadius.circular(15),
...@@ -450,7 +490,7 @@ class _ProspectListByModeState extends State<ProspectListByMode> { ...@@ -450,7 +490,7 @@ class _ProspectListByModeState extends State<ProspectListByMode> {
), ),
), ),
), ),
) ),
], ],
), ),
), ),
......
import 'dart:io'; import 'dart:io';
import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:dropdown_button2/dropdown_button2.dart'; import 'package:dropdown_button2/dropdown_button2.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:generp/Notifiers/crmProvider/addProspectLeadsProvider.dart'; import 'package:generp/Notifiers/crmProvider/addProspectLeadsProvider.dart';
import 'package:generp/Utils/commonServices.dart';
import 'package:generp/Utils/dropdownTheme.dart'; import 'package:generp/Utils/dropdownTheme.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../Models/crmModels/crmProspectDetailsAddLeadsResponse.dart'; import '../../Models/crmModels/crmProspectDetailsAddLeadsResponse.dart';
...@@ -23,31 +25,68 @@ class AddProspectLeads extends StatefulWidget { ...@@ -23,31 +25,68 @@ class AddProspectLeads extends StatefulWidget {
class _AddProspectLeadsState extends State<AddProspectLeads> { class _AddProspectLeadsState extends State<AddProspectLeads> {
Dropdowntheme ddtheme = Dropdowntheme(); Dropdowntheme ddtheme = Dropdowntheme();
Map _source = {ConnectivityResult.mobile: true};
final MyConnectivity _connectivity = MyConnectivity.instance;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
_connectivity.initialise();
_connectivity.myStream.listen((source) {
setState(() => _source = source);
});
WidgetsBinding.instance.addPostFrameCallback((_) async { WidgetsBinding.instance.addPostFrameCallback((_) async {
final provider = Provider.of<Addprospectleadsprovider>(context, listen: false); final provider = Provider.of<Addprospectleadsprovider>(
await provider.crmProspectDetailsAddLeadsViewAPIFunction(context, widget.mode); context,
listen: false,
);
await provider.crmProspectDetailsAddLeadsViewAPIFunction(
context,
widget.mode,
);
// Initialize controllers and dropdowns after API call // Initialize controllers and dropdowns after API call
provider.initializeForm(context); provider.initializeForm(context);
}); });
} }
@override
void dispose() {
// TODO: implement dispose
super.dispose();
_connectivity.disposeStream();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Consumer<Addprospectleadsprovider>( switch (_source.keys.toList()[0]) {
builder: (context, editProvider, child) { case ConnectivityResult.mobile:
return WillPopScope( connection = 'Online';
onWillPop: () async { break;
editProvider.resetForm(); case ConnectivityResult.wifi:
return true; connection = 'Online';
}, break;
case ConnectivityResult.none:
default:
connection = 'Offline';
}
return (connection == "Online")
? Platform.isAndroid
? WillPopScope(
onWillPop: () => onBackPressed(context),
child: SafeArea( child: SafeArea(
top: false, top: false,
bottom: Platform.isIOS?false:true, bottom: true,
child: Scaffold( child: _scaffold(context),
),
)
: _scaffold(context)
: NoNetwork(context);
}
Widget _scaffold(BuildContext context) {
return Consumer<Addprospectleadsprovider>(
builder: (context, editProvider, child) {
return Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
backgroundColor: AppColors.white, backgroundColor: AppColors.white,
appBar: appbar2( appBar: appbar2(
...@@ -75,22 +114,18 @@ class _AddProspectLeadsState extends State<AddProspectLeads> { ...@@ -75,22 +114,18 @@ class _AddProspectLeadsState extends State<AddProspectLeads> {
items: items:
editProvider.employeeList editProvider.employeeList
.map( .map(
(slist) => (slist) => DropdownMenuItem<Employees>(
DropdownMenuItem<Employees>(
value: slist, value: slist,
child: Text( child: Text(
slist.name!, slist.name!,
style: TextStyle( style: TextStyle(fontSize: 14),
fontSize: 14,
),
), ),
), ),
) )
.toList(), .toList(),
value: value:
editProvider.employeeList.contains( editProvider.employeeList.contains(
editProvider editProvider.selectedEmployee,
.selectedEmployee,
) )
? editProvider.selectedEmployee ? editProvider.selectedEmployee
: null, : null,
...@@ -98,15 +133,10 @@ class _AddProspectLeadsState extends State<AddProspectLeads> { ...@@ -98,15 +133,10 @@ class _AddProspectLeadsState extends State<AddProspectLeads> {
// value: provider.selectedEmployees, // value: provider.selectedEmployees,
onChanged: (Employees? value) { onChanged: (Employees? value) {
if (value != null) { if (value != null) {
if (editProvider if (editProvider.employeeList.isNotEmpty) {
.employeeList editProvider.selectedEmployee = value;
.isNotEmpty) { editProvider.selectedEmployeeId = value!.id!;
editProvider.selectedEmployee = editProvider.selectedEmployeeValue =
value;
editProvider.selectedEmployeeId =
value!.id!;
editProvider
.selectedEmployeeValue =
value!.name!; value!.name!;
} }
} }
...@@ -114,32 +144,26 @@ class _AddProspectLeadsState extends State<AddProspectLeads> { ...@@ -114,32 +144,26 @@ class _AddProspectLeadsState extends State<AddProspectLeads> {
isExpanded: true, isExpanded: true,
dropdownSearchData: DropdownSearchData( dropdownSearchData: DropdownSearchData(
searchInnerWidgetHeight: 50, searchInnerWidgetHeight: 50,
searchController: searchController: editProvider.searchController,
editProvider.searchController,
searchInnerWidget: Padding( searchInnerWidget: Padding(
padding: const EdgeInsets.all(8), padding: const EdgeInsets.all(8),
child: TextFormField( child: TextFormField(
controller: controller: editProvider.searchController,
editProvider.searchController,
decoration: InputDecoration( decoration: InputDecoration(
isDense: true, isDense: true,
contentPadding: contentPadding: const EdgeInsets.symmetric(
const EdgeInsets.symmetric(
horizontal: 10, horizontal: 10,
vertical: 8, vertical: 8,
), ),
hintText: 'Search account...', hintText: 'Search account...',
border: OutlineInputBorder( border: OutlineInputBorder(
borderRadius: borderRadius: BorderRadius.circular(8),
BorderRadius.circular(8),
), ),
), ),
), ),
), ),
searchMatchFn: (item, searchValue) { searchMatchFn: (item, searchValue) {
return item.value?.name return item.value?.name?.toLowerCase().contains(
?.toLowerCase()
.contains(
searchValue.toLowerCase(), searchValue.toLowerCase(),
) ?? ) ??
false; false;
...@@ -147,23 +171,19 @@ class _AddProspectLeadsState extends State<AddProspectLeads> { ...@@ -147,23 +171,19 @@ class _AddProspectLeadsState extends State<AddProspectLeads> {
), ),
onMenuStateChange: (isOpen) { onMenuStateChange: (isOpen) {
if (!isOpen) { if (!isOpen) {
editProvider.searchController editProvider.searchController.clear();
.clear();
} }
}, },
buttonStyleData: ddtheme.buttonStyleData, buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData, iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: menuItemStyleData: ddtheme.menuItemStyleData,
ddtheme.menuItemStyleData, dropdownStyleData: ddtheme.dropdownStyleData,
dropdownStyleData:
ddtheme.dropdownStyleData,
), ),
), ),
], ],
), ),
), ),
InkResponse( InkResponse(
onTap: () { onTap: () {
editProvider.editAddNewRow(); editProvider.editAddNewRow();
...@@ -192,14 +212,18 @@ class _AddProspectLeadsState extends State<AddProspectLeads> { ...@@ -192,14 +212,18 @@ class _AddProspectLeadsState extends State<AddProspectLeads> {
), ),
), ),
if (editProvider.leadProductsList.isNotEmpty || if (editProvider.leadProductsList.isNotEmpty ||
editProvider.editProductPriceControllers.isNotEmpty)...[ editProvider.editProductPriceControllers.isNotEmpty) ...[
ListView.builder( ListView.builder(
itemCount: editProvider.editProductPriceControllers.length, itemCount:
editProvider.editProductPriceControllers.length,
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true, shrinkWrap: true,
itemBuilder: (context, j) { itemBuilder: (context, j) {
return Container( return Container(
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 10), padding: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
margin: const EdgeInsets.symmetric(vertical: 10), margin: const EdgeInsets.symmetric(vertical: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
...@@ -220,34 +244,58 @@ class _AddProspectLeadsState extends State<AddProspectLeads> { ...@@ -220,34 +244,58 @@ class _AddProspectLeadsState extends State<AddProspectLeads> {
style: TextStyle(fontSize: 14), style: TextStyle(fontSize: 14),
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
items: editProvider.leadProductsList items:
.map((ord) => DropdownMenuItem<Products>( editProvider.leadProductsList
.map(
(ord) => DropdownMenuItem<
Products
>(
value: ord, value: ord,
child: Text( child: Text(
"(Product Name: ${ord.name})", "(Product Name: ${ord.name})",
style: const TextStyle(fontSize: 14), style: const TextStyle(
overflow: TextOverflow.ellipsis, fontSize: 14,
),
overflow:
TextOverflow.ellipsis,
),
), ),
)) )
.toList(), .toList(),
value: editProvider.selectedProductIds[j] != null value:
? editProvider.leadProductsList.firstWhere( editProvider.selectedProductIds[j] !=
(ord) => ord.id == editProvider.selectedProductIds[j], null
orElse: () => editProvider.leadProductsList[0], ? editProvider.leadProductsList
.firstWhere(
(ord) =>
ord.id ==
editProvider
.selectedProductIds[j],
orElse:
() =>
editProvider
.leadProductsList[0],
) )
: null, : null,
onChanged: (Products? value) { onChanged: (Products? value) {
if (value != null) { if (value != null) {
editProvider.updateSelectedProductIds(j, value); editProvider
.updateSelectedProductIds(
j,
value,
);
editProvider.selectedProductIds[j] = editProvider.selectedProductIds[j] =
value.id?.toString() ?? ''; value.id?.toString() ?? '';
editProvider.updateTotalAmount(j); editProvider.updateTotalAmount(j);
} }
}, },
buttonStyleData: ddtheme.buttonStyleData, buttonStyleData:
ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData, iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData, menuItemStyleData:
dropdownStyleData: ddtheme.dropdownStyleData, ddtheme.menuItemStyleData,
dropdownStyleData:
ddtheme.dropdownStyleData,
), ),
), ),
], ],
...@@ -260,10 +308,12 @@ class _AddProspectLeadsState extends State<AddProspectLeads> { ...@@ -260,10 +308,12 @@ class _AddProspectLeadsState extends State<AddProspectLeads> {
flex: 2, flex: 2,
child: textControllerWidget( child: textControllerWidget(
context, context,
editProvider.editProductPriceControllers[j], editProvider
.editProductPriceControllers[j],
"Product Price", "Product Price",
"Enter Product Price", "Enter Product Price",
(value) => editProvider.updateTotalAmount(j), (value) =>
editProvider.updateTotalAmount(j),
TextInputType.number, TextInputType.number,
false, false,
FilteringTextInputFormatter.digitsOnly, FilteringTextInputFormatter.digitsOnly,
...@@ -281,7 +331,8 @@ class _AddProspectLeadsState extends State<AddProspectLeads> { ...@@ -281,7 +331,8 @@ class _AddProspectLeadsState extends State<AddProspectLeads> {
editProvider.editQuantityControllers[j], editProvider.editQuantityControllers[j],
"Quantity", "Quantity",
"Enter Quantity", "Enter Quantity",
(value) => editProvider.updateTotalAmount(j), (value) =>
editProvider.updateTotalAmount(j),
TextInputType.number, TextInputType.number,
false, false,
FilteringTextInputFormatter.digitsOnly, FilteringTextInputFormatter.digitsOnly,
...@@ -296,7 +347,8 @@ class _AddProspectLeadsState extends State<AddProspectLeads> { ...@@ -296,7 +347,8 @@ class _AddProspectLeadsState extends State<AddProspectLeads> {
flex: 2, flex: 2,
child: textControllerWidget( child: textControllerWidget(
context, context,
editProvider.editTotalAmountControllers[j], editProvider
.editTotalAmountControllers[j],
"Total Amount", "Total Amount",
"Enter Total Amount", "Enter Total Amount",
(_) {}, (_) {},
...@@ -307,7 +359,6 @@ class _AddProspectLeadsState extends State<AddProspectLeads> { ...@@ -307,7 +359,6 @@ class _AddProspectLeadsState extends State<AddProspectLeads> {
), ),
], ],
), ),
], ],
), ),
); );
...@@ -321,20 +372,17 @@ class _AddProspectLeadsState extends State<AddProspectLeads> { ...@@ -321,20 +372,17 @@ class _AddProspectLeadsState extends State<AddProspectLeads> {
Expanded( Expanded(
child: DropdownButton2<String>( child: DropdownButton2<String>(
hint: Text( hint: Text(
"Select Salutation", "Select Status",
style: TextStyle(fontSize: 14), style: TextStyle(fontSize: 14),
), ),
items: items:
editProvider.statusList editProvider.statusList
.map( .map(
(slist) => (slist) => DropdownMenuItem<String>(
DropdownMenuItem<String>(
value: slist, value: slist,
child: Text( child: Text(
slist, slist,
style: TextStyle( style: TextStyle(fontSize: 14),
fontSize: 14,
),
), ),
), ),
) )
...@@ -342,9 +390,7 @@ class _AddProspectLeadsState extends State<AddProspectLeads> { ...@@ -342,9 +390,7 @@ class _AddProspectLeadsState extends State<AddProspectLeads> {
value: editProvider.selectedStatus, value: editProvider.selectedStatus,
onChanged: (String? value) { onChanged: (String? value) {
if (value != null) { if (value != null) {
if (editProvider if (editProvider.statusList.isNotEmpty) {
.statusList
.isNotEmpty) {
editProvider.selectedStatus = value; editProvider.selectedStatus = value;
} }
} }
...@@ -352,10 +398,8 @@ class _AddProspectLeadsState extends State<AddProspectLeads> { ...@@ -352,10 +398,8 @@ class _AddProspectLeadsState extends State<AddProspectLeads> {
isExpanded: true, isExpanded: true,
buttonStyleData: ddtheme.buttonStyleData, buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData, iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: menuItemStyleData: ddtheme.menuItemStyleData,
ddtheme.menuItemStyleData, dropdownStyleData: ddtheme.dropdownStyleData,
dropdownStyleData:
ddtheme.dropdownStyleData,
), ),
), ),
], ],
...@@ -365,14 +409,21 @@ class _AddProspectLeadsState extends State<AddProspectLeads> { ...@@ -365,14 +409,21 @@ class _AddProspectLeadsState extends State<AddProspectLeads> {
), ),
), ),
), ),
floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat, floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
bottomNavigationBar: InkResponse( bottomNavigationBar: InkResponse(
onTap: editProvider.submitLoading onTap:
editProvider.submitLoading
? null ? 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) // editProvider.crmProspectDetailsAddLeadsSubmitAPIFunction(context, mode, account_id, acc_manager_id, products, lead_status)
}, },
child: Container( child: Container(
height: 45, height: 45,
...@@ -383,9 +434,12 @@ class _AddProspectLeadsState extends State<AddProspectLeads> { ...@@ -383,9 +434,12 @@ class _AddProspectLeadsState extends State<AddProspectLeads> {
color: AppColors.app_blue, color: AppColors.app_blue,
borderRadius: BorderRadius.circular(15), borderRadius: BorderRadius.circular(15),
), ),
child: editProvider.submitLoading child:
editProvider.submitLoading
? CircularProgressIndicator.adaptive( ? CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(AppColors.app_blue), valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue,
),
) )
: const Text( : const Text(
"Submit", "Submit",
...@@ -397,8 +451,6 @@ class _AddProspectLeadsState extends State<AddProspectLeads> { ...@@ -397,8 +451,6 @@ class _AddProspectLeadsState extends State<AddProspectLeads> {
), ),
), ),
), ),
),
),
); );
}, },
); );
......
...@@ -39,12 +39,14 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -39,12 +39,14 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
prov.crmPendingTasksAPIFunction(context); prov.crmPendingTasksAPIFunction(context);
}); });
} }
@override
@override
void dispose() { void dispose() {
// TODO: implement dispose // TODO: implement dispose
super.dispose(); super.dispose();
_connectivity.disposeStream(); _connectivity.disposeStream();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
switch (_source.keys.toList()[0]) { switch (_source.keys.toList()[0]) {
...@@ -517,7 +519,12 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -517,7 +519,12 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
FloatingActionButtonLocation.centerFloat, FloatingActionButtonLocation.centerFloat,
floatingActionButton: InkResponse( floatingActionButton: InkResponse(
onTap: () { onTap: () {
if (provider.accessPages
.where((page) => [8, 9].contains(page.id))
.toList()
.contains([8, 9])) {
_showPaymentOptionsSheet(context); _showPaymentOptionsSheet(context);
}
}, },
child: Container( child: Container(
height: 45, height: 45,
......
import 'dart:io'; import 'dart:io';
import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:generp/Utils/commonServices.dart';
import 'package:generp/screens/crm/editProductsList.dart'; import 'package:generp/screens/crm/editProductsList.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
...@@ -12,39 +14,78 @@ import '../../Utils/commonWidgets.dart'; ...@@ -12,39 +14,78 @@ import '../../Utils/commonWidgets.dart';
class Productdetails extends StatefulWidget { class Productdetails extends StatefulWidget {
final leadID; final leadID;
final mode; final mode;
const Productdetails({super.key,required this.leadID,required this.mode}); const Productdetails({super.key, required this.leadID, required this.mode});
@override @override
State<Productdetails> createState() => _ProductdetailsState(); State<Productdetails> createState() => _ProductdetailsState();
} }
class _ProductdetailsState extends State<Productdetails> { class _ProductdetailsState extends State<Productdetails> {
Map _source = {ConnectivityResult.mobile: true};
final MyConnectivity _connectivity = MyConnectivity.instance;
@override @override
void initState() { void initState() {
// TODO: implement initState // TODO: implement initState
super.initState(); super.initState();
_connectivity.initialise();
_connectivity.myStream.listen((source) {
setState(() => _source = source);
});
WidgetsBinding.instance.addPostFrameCallback((timeStamp) { 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); provider.crmLeadDetailsAPIFunction(context, widget.leadID, widget.mode);
},); });
}
@override
void dispose() {
// TODO: implement dispose
super.dispose();
_connectivity.disposeStream();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Consumer<crmLeadDetailsProvider>( switch (_source.keys.toList()[0]) {
builder: (context, provider, child) { case ConnectivityResult.mobile:
var customerDetails = provider.leadProducts; connection = 'Online';
return WillPopScope( break;
case ConnectivityResult.wifi:
connection = 'Online';
break;
case ConnectivityResult.none:
default:
connection = 'Offline';
}
return (connection == "Online")
? Platform.isAndroid
? WillPopScope(
onWillPop: () => onBackPressed(context), onWillPop: () => onBackPressed(context),
child: SafeArea( child: SafeArea(
top: false, top: false,
bottom: Platform.isIOS?false:true, bottom: true,
child: Scaffold( 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, resizeToAvoidBottomInset: true,
appBar: appbar(context, "Product Details"), appBar: appbar(context, "Product Details"),
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
body: SizedBox( body:
provider.leadProducts.isNotEmpty
? SizedBox(
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
...@@ -55,8 +96,14 @@ class _ProductdetailsState extends State<Productdetails> { ...@@ -55,8 +96,14 @@ class _ProductdetailsState extends State<Productdetails> {
shrinkWrap: true, shrinkWrap: true,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return Container( return Container(
margin: EdgeInsets.symmetric(horizontal: 10, vertical: 5), margin: EdgeInsets.symmetric(
padding: EdgeInsets.symmetric(horizontal: 15, vertical: 10), horizontal: 10,
vertical: 5,
),
padding: EdgeInsets.symmetric(
horizontal: 15,
vertical: 10,
),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(20), borderRadius: BorderRadius.circular(20),
...@@ -68,16 +115,15 @@ class _ProductdetailsState extends State<Productdetails> { ...@@ -68,16 +115,15 @@ class _ProductdetailsState extends State<Productdetails> {
"Product Name", "Product Name",
"Product Price", "Product Price",
"Quantity", "Quantity",
"Total Price" "Total Price",
]; ];
final textSubheads = [ final textSubheads = [
customerDetails[index].productName??"-", customerDetails[index].productName ?? "-",
customerDetails[index].price??"-", customerDetails[index].price ?? "-",
customerDetails[index].qty??"-", customerDetails[index].qty ?? "-",
customerDetails[index].price??"-", customerDetails[index].price ?? "-",
]; ];
return Container( return Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
vertical: 6, vertical: 6,
horizontal: 0, horizontal: 0,
...@@ -87,18 +133,19 @@ class _ProductdetailsState extends State<Productdetails> { ...@@ -87,18 +133,19 @@ class _ProductdetailsState extends State<Productdetails> {
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
Expanded( Expanded(
flex:2, flex: 2,
child: Text(textheads[j].toString(), child: Text(
textheads[j].toString(),
maxLines: 2, maxLines: 2,
overflow: TextOverflow.ellipsis,), overflow: TextOverflow.ellipsis,
),
), ),
Expanded( Expanded(
flex: 3, flex: 3,
child: Text( child: Text(
textSubheads[j], textSubheads[j],
maxLines: 2, maxLines: 2,
overflow: overflow: TextOverflow.ellipsis,
TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
color: Color(0xFF818181), color: Color(0xFF818181),
), ),
...@@ -110,23 +157,32 @@ class _ProductdetailsState extends State<Productdetails> { ...@@ -110,23 +157,32 @@ class _ProductdetailsState extends State<Productdetails> {
}), }),
), ),
); );
} },
), ),
SizedBox(height: 75), SizedBox(height: 75),
], ],
), ),
), ),
), )
: Emptywidget(context),
floatingActionButton: Align( floatingActionButton: Align(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
child: InkWell( child: InkWell(
onTap: () async { onTap: () async {
var res = await Navigator.push(context, MaterialPageRoute(builder: (context) => EditProductsList( var res = await Navigator.push(
leadID: widget.leadID, context,
),)); MaterialPageRoute(
if(res==true){ builder:
provider.crmLeadDetailsAPIFunction(context, widget.leadID, widget.mode); (context) => EditProductsList(leadID: widget.leadID),
),
);
if (res == true) {
provider.crmLeadDetailsAPIFunction(
context,
widget.leadID,
widget.mode,
);
} }
}, },
child: Container( child: Container(
...@@ -142,8 +198,10 @@ class _ProductdetailsState extends State<Productdetails> { ...@@ -142,8 +198,10 @@ class _ProductdetailsState extends State<Productdetails> {
child: Text( child: Text(
"Edit Products", "Edit Products",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle(color: Colors.white, style: TextStyle(
fontFamily: "JakartaMedium"), color: Colors.white,
fontFamily: "JakartaMedium",
),
), ),
), ),
), ),
...@@ -151,8 +209,6 @@ class _ProductdetailsState extends State<Productdetails> { ...@@ -151,8 +209,6 @@ class _ProductdetailsState extends State<Productdetails> {
), ),
floatingActionButtonLocation: floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat, FloatingActionButtonLocation.centerFloat,
),
),
); );
}, },
); );
......
import 'dart:io'; import 'dart:io';
import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:generp/Notifiers/crmProvider/crmProspectDetailsProvider.dart'; import 'package:generp/Notifiers/crmProvider/crmProspectDetailsProvider.dart';
import 'package:generp/Utils/commonServices.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../Utils/app_colors.dart'; import '../../Utils/app_colors.dart';
...@@ -11,24 +13,66 @@ import '../../Utils/commonWidgets.dart'; ...@@ -11,24 +13,66 @@ import '../../Utils/commonWidgets.dart';
class ProspectContactDetails extends StatefulWidget { class ProspectContactDetails extends StatefulWidget {
final accountId; final accountId;
const ProspectContactDetails({super.key,required this.accountId}); const ProspectContactDetails({super.key, required this.accountId});
@override @override
State<ProspectContactDetails> createState() => _ProspectContactDetailsState(); State<ProspectContactDetails> createState() => _ProspectContactDetailsState();
} }
class _ProspectContactDetailsState extends State<ProspectContactDetails> { 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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Consumer<crmProspectDetailsProvider>( switch (_source.keys.toList()[0]) {
builder: (context, provider, child) { case ConnectivityResult.mobile:
var customerDetails = provider.contactList; connection = 'Online';
return WillPopScope( break;
case ConnectivityResult.wifi:
connection = 'Online';
break;
case ConnectivityResult.none:
default:
connection = 'Offline';
}
return (connection == "Online")
? Platform.isAndroid
? WillPopScope(
onWillPop: () => onBackPressed(context), onWillPop: () => onBackPressed(context),
child: SafeArea( child: SafeArea(
top: false, top: false,
bottom: Platform.isIOS?false:true, bottom: true,
child: Scaffold( 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, resizeToAvoidBottomInset: true,
appBar: appbar(context, "Contact Details"), appBar: appbar(context, "Contact Details"),
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
...@@ -37,7 +81,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> { ...@@ -37,7 +81,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
TextWidget(context, "Contact Details"), // TextWidget(context, "Contact Details"),
ListView.builder( ListView.builder(
itemCount: customerDetails.length, itemCount: customerDetails.length,
shrinkWrap: true, shrinkWrap: true,
...@@ -68,9 +112,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> { ...@@ -68,9 +112,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFFE6F6FF), color: Color(0xFFE6F6FF),
borderRadius: BorderRadius.circular( borderRadius: BorderRadius.circular(8),
8,
),
), ),
child: SvgPicture.asset( child: SvgPicture.asset(
"assets/svg/crm_contact_profile.svg", "assets/svg/crm_contact_profile.svg",
...@@ -86,8 +128,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> { ...@@ -86,8 +128,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
Text( Text(
customerDetails[index].name ?? customerDetails[index].name ?? "-",
"-",
style: TextStyle( style: TextStyle(
fontFamily: "JakartaMedium", fontFamily: "JakartaMedium",
fontSize: 14, fontSize: 14,
...@@ -103,13 +144,26 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> { ...@@ -103,13 +144,26 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
flex: 1, flex: 1,
child: InkResponse( child: InkResponse(
onTap: () { onTap: () {
provider.editNameController.text = customerDetails[index].name??""; provider.editNameController.text =
provider.editDesignationController.text = customerDetails[index].designation??""; customerDetails[index].name ?? "";
provider.editMobileNumberController.text = customerDetails[index].mob1??""; provider.editDesignationController.text =
provider.editAlternativeMobileController.text = customerDetails[index].mob2??""; customerDetails[index].designation ??
provider.editTelephoneController.text = customerDetails[index].tel??""; "";
provider.editEmailController.text = customerDetails[index].email??""; provider.editMobileNumberController.text =
_showEditContactSheet(context, index,provider.accountDetails.id!); 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( child: Container(
height: 35, height: 35,
...@@ -123,10 +177,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> { ...@@ -123,10 +177,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
), ),
], ],
), ),
Divider( Divider(thickness: 0.5, color: Color(0xFFD7D7D7)),
thickness: 0.5,
color: Color(0xFFD7D7D7),
),
...List.generate(5, (j) { ...List.generate(5, (j) {
final textheads = [ final textheads = [
"Mobile", "Mobile",
...@@ -148,8 +199,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> { ...@@ -148,8 +199,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
horizontal: 0, horizontal: 0,
), ),
child: Row( child: Row(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
...@@ -189,7 +239,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> { ...@@ -189,7 +239,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
_showAddContactSheet(context,provider.accountDetails.id!); _showAddContactSheet(context, provider.accountDetails.id!);
}, },
child: Container( child: Container(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
...@@ -215,14 +265,12 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> { ...@@ -215,14 +265,12 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
), ),
floatingActionButtonLocation: floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat, FloatingActionButtonLocation.centerFloat,
),
),
); );
}, },
); );
} }
Future<void> _showAddContactSheet(BuildContext context,accID) { Future<void> _showAddContactSheet(BuildContext context, accID) {
return showModalBottomSheet( return showModalBottomSheet(
useSafeArea: true, useSafeArea: true,
isDismissible: true, isDismissible: true,
...@@ -330,9 +378,16 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> { ...@@ -330,9 +378,16 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
), ),
errorWidget(context, provider.emailError), errorWidget(context, provider.emailError),
InkWell( InkWell(
onTap: provider.isLoading?null:(){ onTap:
provider.isLoading
? null
: () {
provider.isLoading = true; provider.isLoading = true;
provider.crmProspectDetailsAddContactAPIFunction(context, accID); provider
.crmProspectDetailsAddContactAPIFunction(
context,
accID,
);
}, },
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
...@@ -348,7 +403,14 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> { ...@@ -348,7 +403,14 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
borderRadius: BorderRadius.circular(14.0), borderRadius: BorderRadius.circular(14.0),
), ),
child: Center( child: Center(
child: provider.isLoading?CircularProgressIndicator.adaptive(valueColor: AlwaysStoppedAnimation(AppColors.white),):Text( child:
provider.isLoading
? CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation(
AppColors.white,
),
)
: Text(
"Submit", "Submit",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white),
...@@ -369,7 +431,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> { ...@@ -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( return showModalBottomSheet(
useSafeArea: true, useSafeArea: true,
isDismissible: true, isDismissible: true,
...@@ -479,9 +541,17 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> { ...@@ -479,9 +541,17 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
errorWidget(context, provider.editEmailError), errorWidget(context, provider.editEmailError),
InkWell( InkWell(
onTap: provider.isLoading?null:(){ onTap:
provider.isLoading
? null
: () {
provider.isLoading = true; provider.isLoading = true;
provider.crmProspectDetailsEditContactAPIFunction(context, provider.contactList[index].id,accid); provider
.crmProspectDetailsEditContactAPIFunction(
context,
provider.contactList[index].id,
accid,
);
}, },
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
...@@ -497,7 +567,14 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> { ...@@ -497,7 +567,14 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
borderRadius: BorderRadius.circular(14.0), borderRadius: BorderRadius.circular(14.0),
), ),
child: Center( child: Center(
child: provider.isLoading?CircularProgressIndicator.adaptive(valueColor: AlwaysStoppedAnimation(AppColors.white),):Text( child:
provider.isLoading
? CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation(
AppColors.white,
),
)
: Text(
"Submit", "Submit",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white),
......
import 'dart:io'; import 'dart:io';
import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:generp/Notifiers/crmProvider/crmProspectDetailsProvider.dart'; import 'package:generp/Notifiers/crmProvider/crmProspectDetailsProvider.dart';
import 'package:generp/Utils/commonServices.dart';
import 'package:generp/screens/crm/LeadDetailsByMode.dart'; import 'package:generp/screens/crm/LeadDetailsByMode.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
...@@ -13,17 +15,28 @@ class ProspectLeadDetails extends StatefulWidget { ...@@ -13,17 +15,28 @@ class ProspectLeadDetails extends StatefulWidget {
final leadID; final leadID;
final mode; final mode;
const ProspectLeadDetails({super.key,required this.leadID,required this.mode}); const ProspectLeadDetails({
super.key,
required this.leadID,
required this.mode,
});
@override @override
State<ProspectLeadDetails> createState() => _ProspectLeadDetailsState(); State<ProspectLeadDetails> createState() => _ProspectLeadDetailsState();
} }
class _ProspectLeadDetailsState extends State<ProspectLeadDetails> { class _ProspectLeadDetailsState extends State<ProspectLeadDetails> {
Map _source = {ConnectivityResult.mobile: true};
final MyConnectivity _connectivity = MyConnectivity.instance;
@override @override
void initState() { void initState() {
// TODO: implement initState // TODO: implement initState
super.initState(); super.initState();
_connectivity.initialise();
_connectivity.myStream.listen((source) {
setState(() => _source = source);
});
WidgetsBinding.instance.addPostFrameCallback((timeStamp) { WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
final provider = Provider.of<crmProspectDetailsProvider>( final provider = Provider.of<crmProspectDetailsProvider>(
context, context,
...@@ -32,17 +45,45 @@ class _ProspectLeadDetailsState extends State<ProspectLeadDetails> { ...@@ -32,17 +45,45 @@ class _ProspectLeadDetailsState extends State<ProspectLeadDetails> {
}); });
} }
@override
void dispose() {
// TODO: implement dispose
super.dispose();
_connectivity.disposeStream();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Consumer<crmProspectDetailsProvider>( switch (_source.keys.toList()[0]) {
builder: (context, provider, child) { case ConnectivityResult.mobile:
var customerDetails = provider.leadList; connection = 'Online';
return WillPopScope( break;
case ConnectivityResult.wifi:
connection = 'Online';
break;
case ConnectivityResult.none:
default:
connection = 'Offline';
}
return (connection == "Online")
? Platform.isAndroid
? WillPopScope(
onWillPop: () => onBackPressed(context), onWillPop: () => onBackPressed(context),
child: SafeArea( child: SafeArea(
top: false, top: false,
bottom: Platform.isIOS?false:true, bottom: true,
child: Scaffold( 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, resizeToAvoidBottomInset: true,
appBar: appbar(context, "Lead Details"), appBar: appbar(context, "Lead Details"),
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
...@@ -51,7 +92,6 @@ class _ProspectLeadDetailsState extends State<ProspectLeadDetails> { ...@@ -51,7 +92,6 @@ class _ProspectLeadDetailsState extends State<ProspectLeadDetails> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
TextWidget(context, "Lead Details"),
ListView.builder( ListView.builder(
itemCount: customerDetails.length, itemCount: customerDetails.length,
shrinkWrap: true, shrinkWrap: true,
...@@ -73,7 +113,11 @@ class _ProspectLeadDetailsState extends State<ProspectLeadDetails> { ...@@ -73,7 +113,11 @@ class _ProspectLeadDetailsState extends State<ProspectLeadDetails> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: List.generate(5, (j) { children: List.generate(5, (j) {
final textheads = [ 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 = [ final textSubheads = [
customerDetails[index].id ?? "-", customerDetails[index].id ?? "-",
...@@ -88,8 +132,7 @@ class _ProspectLeadDetailsState extends State<ProspectLeadDetails> { ...@@ -88,8 +132,7 @@ class _ProspectLeadDetailsState extends State<ProspectLeadDetails> {
horizontal: 0, horizontal: 0,
), ),
child: Row( child: Row(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
Expanded( Expanded(
flex: 2, flex: 2,
...@@ -99,33 +142,54 @@ class _ProspectLeadDetailsState extends State<ProspectLeadDetails> { ...@@ -99,33 +142,54 @@ class _ProspectLeadDetailsState extends State<ProspectLeadDetails> {
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
), ),
if(textSubheads[j]=="View")...[ if (textSubheads[j] == "View") ...[
Expanded( Expanded(
flex: 3, flex: 3,
child: InkResponse( child: InkResponse(
onTap:()async{ onTap: () async {
var res = await Navigator.push(context, MaterialPageRoute(builder: (context) => LeadDetailsByMode(mode: "", pageTitleName: "Lead Details", leadId: widget.leadID),)); var res = await Navigator.push(
if(res==true){ context,
provider.crmProspectDetailsAPIFunction(context, widget.leadID); MaterialPageRoute(
builder:
(context) =>
LeadDetailsByMode(
mode: "",
pageTitleName:
"Lead Details",
leadId: widget.leadID,
),
),
);
if (res == true) {
provider
.crmProspectDetailsAPIFunction(
context,
widget.leadID,
);
} }
}, },
child: Text( child: Text(
textSubheads[j]==""?"-":textSubheads[j], textSubheads[j] == ""
? "-"
: textSubheads[j],
maxLines: 2, maxLines: 2,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
color: AppColors.app_blue, color: AppColors.app_blue,
decorationColor: AppColors.app_blue, decorationColor: AppColors.app_blue,
decoration: TextDecoration.underline decoration:
TextDecoration.underline,
), ),
), ),
), ),
), ),
]else...[ ] else ...[
Expanded( Expanded(
flex: 3, flex: 3,
child: Text( child: Text(
textSubheads[j]==""?"-":textSubheads[j], textSubheads[j] == ""
? "-"
: textSubheads[j],
maxLines: 2, maxLines: 2,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
...@@ -133,7 +197,7 @@ class _ProspectLeadDetailsState extends State<ProspectLeadDetails> { ...@@ -133,7 +197,7 @@ class _ProspectLeadDetailsState extends State<ProspectLeadDetails> {
), ),
), ),
), ),
] ],
], ],
), ),
); );
...@@ -156,7 +220,10 @@ class _ProspectLeadDetailsState extends State<ProspectLeadDetails> { ...@@ -156,7 +220,10 @@ class _ProspectLeadDetailsState extends State<ProspectLeadDetails> {
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: builder:
(context) => AddProspectLeads(leadID: widget.leadID,mode: widget.mode,), (context) => AddProspectLeads(
leadID: widget.leadID,
mode: widget.mode,
),
), ),
); );
if (res == true) { if (res == true) {
...@@ -190,8 +257,6 @@ class _ProspectLeadDetailsState extends State<ProspectLeadDetails> { ...@@ -190,8 +257,6 @@ class _ProspectLeadDetailsState extends State<ProspectLeadDetails> {
), ),
floatingActionButtonLocation: floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat, FloatingActionButtonLocation.centerFloat,
),
),
); );
}, },
); );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment