Commit 3ad2ea55 authored by Sai Srinivas's avatar Sai Srinivas
Browse files

ios Changes

parent 38d17dba
...@@ -227,7 +227,6 @@ class Paymentdetailsprovider extends ChangeNotifier { ...@@ -227,7 +227,6 @@ class Paymentdetailsprovider extends ChangeNotifier {
if (data.error == 0) { if (data.error == 0) {
print(data.paymentCollectionId); print(data.paymentCollectionId);
_CollectionId = data.paymentCollectionId ?? 0; _CollectionId = data.paymentCollectionId ?? 0;
notifyListeners(); notifyListeners();
} else {} } else {}
} else { } else {
...@@ -427,7 +426,7 @@ class Paymentdetailsprovider extends ChangeNotifier { ...@@ -427,7 +426,7 @@ class Paymentdetailsprovider extends ChangeNotifier {
email, email,
) async { ) async {
if (actName == "Generator") { if (actName == "Generator") {
_saveAgainst = "Generator"; _saveAgainst = "generator";
_genId = generatorID; _genId = generatorID;
} else { } else {
_saveAgainst = "account"; _saveAgainst = "account";
......
import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:connectivity_plus/connectivity_plus.dart';
import 'dart:async';
class Connectivityprovider extends ChangeNotifier {
static final Connectivityprovider _instance = Connectivityprovider._();
static Connectivityprovider get instance => _instance;
final Connectivity _connectivity = Connectivity();
bool _isOnline = false;
Map<ConnectivityResult, bool> _source = {ConnectivityResult.none: false};
Connectivityprovider._() {
initialise();
}
bool get isOnline => _isOnline;
Map<ConnectivityResult, bool> get source => _source;
void initialise() async {
List<ConnectivityResult> result = await _connectivity.checkConnectivity();
_checkStatus(result.first);
_connectivity.onConnectivityChanged.listen((result) {
_checkStatus(result.first);
});
}
void _checkStatus(ConnectivityResult result) async {
bool isOnline = false;
try {
final lookupResult = await InternetAddress.lookup('example.com');
isOnline =
lookupResult.isNotEmpty && lookupResult[0].rawAddress.isNotEmpty;
} on SocketException catch (_) {
isOnline = false;
}
_source = {result: isOnline};
_isOnline = isOnline;
notifyListeners(); // Notify all listeners of the change
}
void dispose() {
// No StreamController to close, as we're using ChangeNotifier
}
}
...@@ -483,12 +483,11 @@ class Requestionlistprovider extends ChangeNotifier { ...@@ -483,12 +483,11 @@ class Requestionlistprovider extends ChangeNotifier {
approvalEmployeeID, approvalEmployeeID,
) async { ) async {
try { try {
_submitClicked = true;
notifyListeners();
if (!validateForm(context, mode)) { if (!validateForm(context, mode)) {
_submitClicked = false;
return; return;
} }
_submitClicked = true;
notifyListeners();
var homeProvider = Provider.of<HomescreenNotifier>( var homeProvider = Provider.of<HomescreenNotifier>(
context, context,
...@@ -511,8 +510,8 @@ class Requestionlistprovider extends ChangeNotifier { ...@@ -511,8 +510,8 @@ class Requestionlistprovider extends ChangeNotifier {
bankIfscController.text, bankIfscController.text,
bankAcHolderController.text, bankAcHolderController.text,
bankUpiController.text, bankUpiController.text,
_image,
approvalEmployeeID, approvalEmployeeID,
_image,
); );
if (data != null) { if (data != null) {
if (data.error == "0") { if (data.error == "0") {
...@@ -550,11 +549,20 @@ class Requestionlistprovider extends ChangeNotifier { ...@@ -550,11 +549,20 @@ class Requestionlistprovider extends ChangeNotifier {
if (data != null) { if (data != null) {
if (data.error == "0") { if (data.error == "0") {
_directPaymentAccounts = data.paymentAccounts!; _directPaymentAccounts = data.paymentAccounts!;
_directPaymentAccounts = [DirectPaymentAccounts(id: "",name: "Select"),...data.paymentAccounts!]; _directPaymentAccounts = [
DirectPaymentAccounts(id: "", name: "Select"),
...data.paymentAccounts!,
];
_directPaymentModes = data.paymentModes!; _directPaymentModes = data.paymentModes!;
_directPaymentModes = [DirectPaymentModes(name: "Select",id: ""),...data.paymentModes!]; _directPaymentModes = [
DirectPaymentModes(name: "Select", id: ""),
...data.paymentModes!,
];
_directAccounts = data.accounts!; _directAccounts = data.accounts!;
_directAccounts = [DirectAccounts(id: "",name: "Select"),...data.accounts!]; _directAccounts = [
DirectAccounts(id: "", name: "Select"),
...data.accounts!,
];
checkdirectPaymentDropDownsSlected(); checkdirectPaymentDropDownsSlected();
notifyListeners(); notifyListeners();
...@@ -1058,6 +1066,14 @@ class Requestionlistprovider extends ChangeNotifier { ...@@ -1058,6 +1066,14 @@ class Requestionlistprovider extends ChangeNotifier {
!_requestingPurposes.contains(_selectReqPurpose)) { !_requestingPurposes.contains(_selectReqPurpose)) {
_selectReqPurpose = null; _selectReqPurpose = null;
} }
if (_selectedApprovalEmployee != null &&
!_approvalEmployee.contains(_selectedApprovalEmployee)) {
_selectedApprovalEmployee = null;
_selectedApprovalEmployeeID = null;
_selectedApprovalEmployeeValue = null;
}
notifyListeners();
} }
bool validateForm(BuildContext context, String mode) { bool validateForm(BuildContext context, String mode) {
...@@ -1156,6 +1172,7 @@ class Requestionlistprovider extends ChangeNotifier { ...@@ -1156,6 +1172,7 @@ class Requestionlistprovider extends ChangeNotifier {
// isValid = false;_submitClicked = false; // isValid = false;_submitClicked = false;
// } // }
buttonEnabled = isValid; buttonEnabled = isValid;
_submitClicked = true;
notifyListeners(); notifyListeners();
return isValid; return isValid;
} }
......
...@@ -42,7 +42,7 @@ class SplashVersionNotifier extends ChangeNotifier { ...@@ -42,7 +42,7 @@ class SplashVersionNotifier extends ChangeNotifier {
if (_packagedetails.isEmpty) { if (_packagedetails.isEmpty) {
await initPackageInfo(); await initPackageInfo();
} }
var loginProvider = Provider.of<Loginnotifier>(context,listen: false); var loginProvider = Provider.of<Loginnotifier>(context, listen: false);
var loginStatus = await SharedpreferencesService().getInt("loginStatus"); var loginStatus = await SharedpreferencesService().getInt("loginStatus");
print("login status: ${loginStatus}"); print("login status: ${loginStatus}");
...@@ -59,7 +59,6 @@ class SplashVersionNotifier extends ChangeNotifier { ...@@ -59,7 +59,6 @@ class SplashVersionNotifier extends ChangeNotifier {
} }
if (Platform.isAndroid && if (Platform.isAndroid &&
currentBuild < (data.latestVersionCode ?? 0)) { currentBuild < (data.latestVersionCode ?? 0)) {
print("Update"); print("Update");
AppUpdateDialouge(context, data.url!, data.releaseNotes!); AppUpdateDialouge(context, data.url!, data.releaseNotes!);
} else if (Platform.isIOS && } else if (Platform.isIOS &&
......
String didPushed = ""; String didPushed = "";
String didPopped = ""; String didPopped = "";
var connection;
import 'dart:async';
import 'dart:io';
import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart'; import 'package:fluttertoast/fluttertoast.dart';
toast(context,text) { toast(context, text) {
// OwnToast(context, text, "0"); // OwnToast(context, text, "0");
Fluttertoast.showToast( Fluttertoast.showToast(
msg: text, msg: text,
...@@ -14,3 +17,35 @@ toast(context,text) { ...@@ -14,3 +17,35 @@ toast(context,text) {
fontSize: 15.0, fontSize: 15.0,
); );
} }
class MyConnectivity {
MyConnectivity._();
static final _instance = MyConnectivity._();
static MyConnectivity get instance => _instance;
final _connectivity = Connectivity();
final _controller = StreamController.broadcast();
Stream get myStream => _controller.stream;
void initialise() async {
ConnectivityResult result =
(await _connectivity.checkConnectivity()) as ConnectivityResult;
_checkStatus(result);
_connectivity.onConnectivityChanged.listen((result) {
_checkStatus(result as ConnectivityResult);
});
}
void _checkStatus(ConnectivityResult result) async {
bool isOnline = false;
try {
final result = await InternetAddress.lookup('example.com');
isOnline = result.isNotEmpty && result[0].rawAddress.isNotEmpty;
} on SocketException catch (_) {
isOnline = false;
}
_controller.sink.add({result: isOnline});
}
void disposeStream() => _controller.close();
}
...@@ -141,7 +141,7 @@ Widget textControllerWidget( ...@@ -141,7 +141,7 @@ Widget textControllerWidget(
height: hintText == "Enter Description" ? 150 : 50, height: hintText == "Enter Description" ? 150 : 50,
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
color:readonly?Color(0xFFD7D7D7): AppColors.text_field_color, color: readonly ? Color(0xFFD7D7D7) : AppColors.text_field_color,
borderRadius: BorderRadius.circular(14), borderRadius: BorderRadius.circular(14),
), ),
child: Padding( child: Padding(
...@@ -175,7 +175,7 @@ Widget textControllerWidget( ...@@ -175,7 +175,7 @@ Widget textControllerWidget(
? [FilteringTextInputFormatter.digitsOnly] ? [FilteringTextInputFormatter.digitsOnly]
: [], : [],
style: TextStyle( style: TextStyle(
color: readonly?Color(0xFF9e9e9e):AppColors.semi_black color: readonly ? Color(0xFF9e9e9e) : AppColors.semi_black,
), ),
decoration: InputDecoration( decoration: InputDecoration(
counterText: "", counterText: "",
...@@ -198,12 +198,13 @@ Widget textControllerWidget( ...@@ -198,12 +198,13 @@ Widget textControllerWidget(
NoNetwork(context) { NoNetwork(context) {
return Container( return Container(
decoration: BoxDecoration(color: AppColors.scaffold_bg_color),
height: MediaQuery.of(context).size.height, height: MediaQuery.of(context).size.height,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
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( child: Text(
......
...@@ -247,8 +247,7 @@ class MyApp extends StatelessWidget { ...@@ -247,8 +247,7 @@ class MyApp extends StatelessWidget {
tabBarTheme: const TabBarThemeData(), tabBarTheme: const TabBarThemeData(),
textSelectionTheme: TextSelectionThemeData( textSelectionTheme: TextSelectionThemeData(
cursorColor: AppColors.app_blue,
cursorColor: AppColors.app_blue
), ),
dialogTheme: const DialogThemeData( dialogTheme: const DialogThemeData(
shadowColor: Colors.white, shadowColor: Colors.white,
...@@ -296,7 +295,7 @@ class MyApp extends StatelessWidget { ...@@ -296,7 +295,7 @@ class MyApp extends StatelessWidget {
AppColors.grey_semi.withOpacity(0.6), AppColors.grey_semi.withOpacity(0.6),
), ),
), ),
useMaterial3: true useMaterial3: true,
// inputDecorationTheme: InputDecorationTheme( // inputDecorationTheme: InputDecorationTheme(
// hintStyle: TextStyle( // hintStyle: TextStyle(
// fontWeight: FontWeight.w400, // fontWeight: FontWeight.w400,
......
This diff is collapsed.
...@@ -77,18 +77,16 @@ class _WebERPIOSState extends State<WebERPIOS> { ...@@ -77,18 +77,16 @@ class _WebERPIOSState extends State<WebERPIOS> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return WillPopScope( return Platform.isAndroid
onWillPop: () async { ? WillPopScope(
if (await webViewController!.canGoBack()) { onWillPop: () => onBackPressed(context),
webViewController!.goBack(); child: SafeArea(top: false, bottom: true, child: _scaffold(context)),
return false; // Prevent default back button behavior )
: _scaffold(context);
} }
return true; // Allow default back button behavior
}, Widget _scaffold(BuildContext context) {
child: SafeArea( return Scaffold(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
appBar: appbar(context, "ERP"), appBar: appbar(context, "ERP"),
body: Container( body: Container(
child: Column( child: Column(
...@@ -276,8 +274,6 @@ class _WebERPIOSState extends State<WebERPIOS> { ...@@ -276,8 +274,6 @@ class _WebERPIOSState extends State<WebERPIOS> {
], ],
), ),
), ),
),
),
); );
} }
} }
...@@ -16,13 +16,14 @@ import 'WebERPScreen.dart'; ...@@ -16,13 +16,14 @@ import 'WebERPScreen.dart';
Future runErpScreenApp2() async { Future runErpScreenApp2() async {
await FlutterDownloader.initialize( await FlutterDownloader.initialize(
debug: true // optional: set false to disable printing logs to console debug: true, // optional: set false to disable printing logs to console
); );
await Permission.storage.request(); await Permission.storage.request();
} }
class WebWhizzdomScreen extends StatefulWidget { class WebWhizzdomScreen extends StatefulWidget {
final String whizzdom_url; final String whizzdom_url;
const WebWhizzdomScreen({super.key,required this.whizzdom_url}); const WebWhizzdomScreen({super.key, required this.whizzdom_url});
@override @override
State<WebWhizzdomScreen> createState() => _WebWhizzdomScreenState(); State<WebWhizzdomScreen> createState() => _WebWhizzdomScreenState();
...@@ -46,7 +47,8 @@ class _WebWhizzdomScreenState extends State<WebWhizzdomScreen> { ...@@ -46,7 +47,8 @@ class _WebWhizzdomScreenState extends State<WebWhizzdomScreen> {
@override @override
void initState() { void initState() {
// loadData(); // loadData();
pullToRefreshController = kIsWeb pullToRefreshController =
kIsWeb
? null ? null
: PullToRefreshController( : PullToRefreshController(
settings: pullToRefreshSettings, settings: pullToRefreshSettings,
...@@ -55,8 +57,10 @@ class _WebWhizzdomScreenState extends State<WebWhizzdomScreen> { ...@@ -55,8 +57,10 @@ class _WebWhizzdomScreenState extends State<WebWhizzdomScreen> {
webViewController?.reload(); webViewController?.reload();
} else if (defaultTargetPlatform == TargetPlatform.iOS) { } else if (defaultTargetPlatform == TargetPlatform.iOS) {
webViewController?.loadUrl( webViewController?.loadUrl(
urlRequest: urlRequest: URLRequest(
URLRequest(url: await webViewController?.getUrl())); url: await webViewController?.getUrl(),
),
);
} }
}, },
); );
...@@ -68,24 +72,24 @@ class _WebWhizzdomScreenState extends State<WebWhizzdomScreen> { ...@@ -68,24 +72,24 @@ class _WebWhizzdomScreenState extends State<WebWhizzdomScreen> {
void dispose() { void dispose() {
super.dispose(); super.dispose();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return WillPopScope( return Platform.isAndroid
onWillPop: () async { ? WillPopScope(
if (await webViewController!.canGoBack()) { onWillPop: () => onBackPressed(context),
webViewController!.goBack(); child: SafeArea(top: false, bottom: true, child: _scaffold(context)),
return false; // Prevent default back button behavior )
: _scaffold(context);
} }
return true; // Allow default back button behavior
}, Widget _scaffold(BuildContext context) {
child: SafeArea( return Scaffold(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
appBar: appbar(context, "Whizzdom"), appBar: appbar(context, "Whizzdom"),
body: Container( body: Container(
child: Column(children: <Widget>[ child: Column(
children: <Widget>[
Expanded( Expanded(
child: Stack( child: Stack(
children: [ children: [
...@@ -93,10 +97,15 @@ class _WebWhizzdomScreenState extends State<WebWhizzdomScreen> { ...@@ -93,10 +97,15 @@ class _WebWhizzdomScreenState extends State<WebWhizzdomScreen> {
initialUrlRequest: URLRequest( initialUrlRequest: URLRequest(
url: WebUri(widget.whizzdom_url), url: WebUri(widget.whizzdom_url),
), ),
androidOnGeolocationPermissionsShowPrompt: androidOnGeolocationPermissionsShowPrompt: (
(InAppWebViewController controller, String origin) async { InAppWebViewController controller,
String origin,
) async {
return GeolocationPermissionShowPromptResponse( return GeolocationPermissionShowPromptResponse(
origin: origin, allow: true, retain: true); origin: origin,
allow: true,
retain: true,
);
}, },
initialOptions: InAppWebViewGroupOptions( initialOptions: InAppWebViewGroupOptions(
android: AndroidInAppWebViewOptions( android: AndroidInAppWebViewOptions(
...@@ -119,12 +128,15 @@ class _WebWhizzdomScreenState extends State<WebWhizzdomScreen> { ...@@ -119,12 +128,15 @@ class _WebWhizzdomScreenState extends State<WebWhizzdomScreen> {
), ),
), ),
androidOnPermissionRequest: (
androidOnPermissionRequest: (InAppWebViewController controller, InAppWebViewController controller,
String origin, List<String> resources) async { String origin,
List<String> resources,
) async {
return PermissionRequestResponse( return PermissionRequestResponse(
resources: resources, resources: resources,
action: PermissionRequestResponseAction.GRANT); action: PermissionRequestResponseAction.GRANT,
);
}, },
onWebViewCreated: (controller) { onWebViewCreated: (controller) {
webViewController = controller; webViewController = controller;
...@@ -150,9 +162,9 @@ class _WebWhizzdomScreenState extends State<WebWhizzdomScreen> { ...@@ -150,9 +162,9 @@ class _WebWhizzdomScreenState extends State<WebWhizzdomScreen> {
pullToRefreshController?.endRefreshing(); pullToRefreshController?.endRefreshing();
} }
}, },
), ),
if (isLoading) ...[Container( if (isLoading) ...[
Container(
color: Colors.white.withOpacity(0.7), color: Colors.white.withOpacity(0.7),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
...@@ -164,9 +176,7 @@ class _WebWhizzdomScreenState extends State<WebWhizzdomScreen> { ...@@ -164,9 +176,7 @@ class _WebWhizzdomScreenState extends State<WebWhizzdomScreen> {
// duration: Duration(seconds: 2), // duration: Duration(seconds: 2),
size: 50, size: 50,
), ),
const SizedBox( const SizedBox(height: 15),
height: 15,
),
SizedBox( SizedBox(
width: 200, width: 200,
child: Text( child: Text(
...@@ -176,17 +186,20 @@ class _WebWhizzdomScreenState extends State<WebWhizzdomScreen> { ...@@ -176,17 +186,20 @@ class _WebWhizzdomScreenState extends State<WebWhizzdomScreen> {
decorationThickness: 0, decorationThickness: 0,
fontSize: 15, fontSize: 15,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
color: AppColors.app_blue), color: AppColors.app_blue,
),
), ),
), ),
// SvgPicture.asset("/assets/images/NutsLoader.gif") // SvgPicture.asset("/assets/images/NutsLoader.gif")
], ],
), ),
)] ),
],
],
),
),
], ],
))
])),
), ),
), ),
); );
......
...@@ -34,6 +34,15 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -34,6 +34,15 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Platform.isAndroid
? WillPopScope(
onWillPop: () => onBackPressed(context),
child: SafeArea(top: false, bottom: true, child: _scaffold(context)),
)
: _scaffold(context);
}
Widget _scaffold(BuildContext context) {
return Consumer<Crmdashboardprovider>( return Consumer<Crmdashboardprovider>(
builder: (context, provider, child) { builder: (context, provider, child) {
final gridPages = final gridPages =
...@@ -41,12 +50,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -41,12 +50,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
.where((page) => ![8, 9, 23, 24, 51, 50].contains(page.id)) .where((page) => ![8, 9, 23, 24, 51, 50].contains(page.id))
.toList(); .toList();
return WillPopScope( return Scaffold(
onWillPop: () => onBackPressed(context),
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
appBar: AppBar( appBar: AppBar(
...@@ -155,26 +159,17 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -155,26 +159,17 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
physics: AlwaysScrollableScrollPhysics(), physics: AlwaysScrollableScrollPhysics(),
child: Column( child: Column(
children: [ children: [
if(provider.allLeads.length>0)...[ if (provider.allLeads.length > 0) ...[
Container( Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
horizontal: 10, margin: EdgeInsets.symmetric(horizontal: 10, vertical: 10),
vertical: 5,
),
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),
), ),
height: MediaQuery.of(context).size.height * 0.28, height: MediaQuery.of(context).size.height * 0.28,
child: GridView.builder( child: GridView.builder(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(horizontal: 0, vertical: 5),
horizontal: 0,
vertical: 5,
),
itemCount: provider.allLeads.length, itemCount: provider.allLeads.length,
shrinkWrap: true, shrinkWrap: true,
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
...@@ -238,9 +233,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -238,9 +233,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
.filter! .filter!
.mode, .mode,
filter: filter:
provider provider.allLeads[jndex].filter!,
.allLeads[jndex]
.filter!,
), ),
), ),
); );
...@@ -280,10 +273,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -280,10 +273,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
ListView.builder( ListView.builder(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
shrinkWrap: true, shrinkWrap: true,
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
vertical: 10,
horizontal: 10,
),
itemCount: gridPages.length, itemCount: gridPages.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
// final icons = ["comm_ic_1", "comm_ic_2"]; // final icons = ["comm_ic_1", "comm_ic_2"];
...@@ -291,8 +281,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -291,8 +281,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
if (gridPages[index].pageName!.contains("Lead List")) { if (gridPages[index].pageName!.contains("Lead List")) {
SvgIcon = SvgPicture.asset("assets/svg/fin_lv1.svg"); SvgIcon = SvgPicture.asset("assets/svg/fin_lv1.svg");
} else if (gridPages[index].pageName == } else if (gridPages[index].pageName == "Nearby Leads") {
"Nearby Leads") {
SvgIcon = SvgPicture.asset( SvgIcon = SvgPicture.asset(
"assets/svg/home_icons_5.svg", "assets/svg/home_icons_5.svg",
height: 18, height: 18,
...@@ -304,17 +293,14 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -304,17 +293,14 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
return InkResponse( return InkResponse(
onTap: () { onTap: () {
print(gridPages[index].pageName!); print(gridPages[index].pageName!);
if (gridPages[index].pageName!.contains( if (gridPages[index].pageName!.contains("Lead List")) {
"Lead List",
)) {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: builder:
(context) => Leadlistbymode( (context) => Leadlistbymode(
mode: gridPages[index].mode, mode: gridPages[index].mode,
pageTitleName: pageTitleName: gridPages[index].pageName,
gridPages[index].pageName,
), ),
), ),
); );
...@@ -327,8 +313,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -327,8 +313,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
builder: builder:
(context) => ProspectListByMode( (context) => ProspectListByMode(
mode: gridPages[index].mode, mode: gridPages[index].mode,
pageTitleName: pageTitleName: gridPages[index].pageName,
gridPages[index].pageName,
), ),
), ),
); );
...@@ -412,11 +397,9 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -412,11 +397,9 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
), ),
), ),
Container( Container(
width: double.infinity, width: double.infinity,
height: MediaQuery.of(context).size.height*0.34, height: MediaQuery.of(context).size.height * 0.34,
child: ListView.builder( child: ListView.builder(
physics: AlwaysScrollableScrollPhysics(), physics: AlwaysScrollableScrollPhysics(),
shrinkWrap: true, shrinkWrap: true,
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
...@@ -435,16 +418,16 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -435,16 +418,16 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
"Status", "Status",
]; ];
final subHeadings = [ final subHeadings = [
provider.pendingTasksLists[index].aname??"-", provider.pendingTasksLists[index].aname ?? "-",
provider.pendingTasksLists[index].conmob??"-", provider.pendingTasksLists[index].conmob ?? "-",
provider.pendingTasksLists[index].appdate??"-", provider.pendingTasksLists[index].appdate ?? "-",
provider.pendingTasksLists[index].atype??"-", provider.pendingTasksLists[index].atype ?? "-",
provider.pendingTasksLists[index].anote??"-", provider.pendingTasksLists[index].anote ?? "-",
provider.pendingTasksLists[index].lstatus??"-", provider.pendingTasksLists[index].lstatus ?? "-",
]; ];
return Container( return Container(
height: MediaQuery.of(context).size.height*0.3, height: MediaQuery.of(context).size.height * 0.3,
width: MediaQuery.of(context).size.width*0.6, width: MediaQuery.of(context).size.width * 0.6,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(14), borderRadius: BorderRadius.circular(14),
...@@ -467,7 +450,8 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -467,7 +450,8 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
horizontal: 0, horizontal: 0,
), ),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
...@@ -487,7 +471,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -487,7 +471,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
], ],
), ),
); );
},) }),
], ],
), ),
); );
...@@ -495,7 +479,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -495,7 +479,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
), ),
), ),
], ],
SizedBox(height: 150,), SizedBox(height: 150),
], ],
), ),
), ),
...@@ -524,8 +508,6 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -524,8 +508,6 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
), ),
), ),
), ),
),
),
); );
}, },
); );
......
...@@ -29,16 +29,20 @@ class _FinancedashboardState extends State<Financedashboard> { ...@@ -29,16 +29,20 @@ class _FinancedashboardState extends State<Financedashboard> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Platform.isAndroid
? WillPopScope(
onWillPop: () => onBackPressed(context),
child: SafeArea(top: false, bottom: true, child: _scaffold(context)),
)
: _scaffold(context);
}
Widget _scaffold(BuildContext context) {
return Consumer<Dashboardprovider>( return Consumer<Dashboardprovider>(
builder: (context, provider, child) { builder: (context, provider, child) {
final pages = provider.accessiblePagesList; final pages = provider.accessiblePagesList;
return WillPopScope( return Scaffold(
onWillPop: () => onBackPressed(context),
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar(context, "Finance"), appBar: appbar(context, "Finance"),
...@@ -54,20 +58,14 @@ class _FinancedashboardState extends State<Financedashboard> { ...@@ -54,20 +58,14 @@ class _FinancedashboardState extends State<Financedashboard> {
Widget? SvgIcon; Widget? SvgIcon;
switch (pages[index].mode) { switch (pages[index].mode) {
case "apr_lvl1": case "apr_lvl1":
SvgIcon = SvgPicture.asset( SvgIcon = SvgPicture.asset("assets/svg/fin_lv1.svg");
"assets/svg/fin_lv1.svg",
);
break; break;
case "apr_lvl2": case "apr_lvl2":
SvgIcon = SvgPicture.asset( SvgIcon = SvgPicture.asset("assets/svg/fin_lv2.svg");
"assets/svg/fin_lv2.svg",
);
break; break;
final icons = ["comm_ic_1", "comm_ic_2"]; final icons = ["comm_ic_1", "comm_ic_2"];
default: default:
SvgIcon = SvgPicture.asset( SvgIcon = SvgPicture.asset("assets/svg/fin_ic.svg");
"assets/svg/fin_ic.svg",
);
break; break;
} }
return InkResponse( return InkResponse(
...@@ -76,9 +74,7 @@ class _FinancedashboardState extends State<Financedashboard> { ...@@ -76,9 +74,7 @@ class _FinancedashboardState extends State<Financedashboard> {
if (pages[index].pageName == "Payments List") { if (pages[index].pageName == "Payments List") {
navigate = Paymentlistpaymentrequisition( navigate = Paymentlistpaymentrequisition(
pageTitleName: pageTitleName:
provider provider.accessiblePagesList[index].pageName!,
.accessiblePagesList[index]
.pageName!,
); );
} else if (provider } else if (provider
.accessiblePagesList[index] .accessiblePagesList[index]
...@@ -86,9 +82,7 @@ class _FinancedashboardState extends State<Financedashboard> { ...@@ -86,9 +82,7 @@ class _FinancedashboardState extends State<Financedashboard> {
"Payment Receipts List") { "Payment Receipts List") {
navigate = Paymentreceiptlist( navigate = Paymentreceiptlist(
pageTitleName: pageTitleName:
provider provider.accessiblePagesList[index].pageName!,
.accessiblePagesList[index]
.pageName!,
); );
} else if (provider } else if (provider
.accessiblePagesList[index] .accessiblePagesList[index]
...@@ -106,16 +100,12 @@ class _FinancedashboardState extends State<Financedashboard> { ...@@ -106,16 +100,12 @@ class _FinancedashboardState extends State<Financedashboard> {
navigate = Allpaymentrequesitionlistsbymodes( navigate = Allpaymentrequesitionlistsbymodes(
mode: pages[index].mode!, mode: pages[index].mode!,
pageTitleName: pageTitleName:
provider provider.accessiblePagesList[index].pageName!,
.accessiblePagesList[index]
.pageName!,
); );
} }
await Navigator.push( await Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(builder: (context) => navigate),
builder: (context) => navigate,
),
); );
}, },
child: Container( child: Container(
...@@ -133,25 +123,29 @@ class _FinancedashboardState extends State<Financedashboard> { ...@@ -133,25 +123,29 @@ class _FinancedashboardState extends State<Financedashboard> {
), ),
child: Row( child: Row(
children: [ children: [
if(provider if (provider
.accessiblePagesList[index] .accessiblePagesList[index]
.pageName == .pageName ==
"Account List")...[ "Account List") ...[
Expanded(flex: 1, Expanded(
flex: 1,
child: SvgPicture.asset( child: SvgPicture.asset(
"assets/svg/comm_ic_1.svg",width: 25, "assets/svg/comm_ic_1.svg",
width: 25,
), ),
) ),
]else if(provider ] else if (provider
.accessiblePagesList[index] .accessiblePagesList[index]
.pageName == .pageName ==
"Account Ledger")...[ "Account Ledger") ...[
Expanded(flex: 1, Expanded(
flex: 1,
child: SvgPicture.asset( child: SvgPicture.asset(
"assets/svg/comm_ic_2.svg",width: 25, "assets/svg/comm_ic_2.svg",
width: 25,
), ),
) ),
]else...[ ] else ...[
Expanded(flex: 1, child: SvgIcon), Expanded(flex: 1, child: SvgIcon),
], ],
Expanded( Expanded(
...@@ -170,7 +164,7 @@ class _FinancedashboardState extends State<Financedashboard> { ...@@ -170,7 +164,7 @@ class _FinancedashboardState extends State<Financedashboard> {
); );
}, },
), ),
SizedBox(height: 150,) SizedBox(height: 150),
], ],
), ),
), ),
...@@ -200,8 +194,6 @@ class _FinancedashboardState extends State<Financedashboard> { ...@@ -200,8 +194,6 @@ class _FinancedashboardState extends State<Financedashboard> {
), ),
), ),
), ),
),
),
); );
}, },
); );
...@@ -296,11 +288,13 @@ class _FinancedashboardState extends State<Financedashboard> { ...@@ -296,11 +288,13 @@ class _FinancedashboardState extends State<Financedashboard> {
); );
} else if (provider } else if (provider
.accessiblePagesList2[index] .accessiblePagesList2[index]
.pageName!.contains("Add Account")) { .pageName!
.contains("Add Account")) {
res = await Navigator.push( res = await Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => Addcommonpayment( builder:
(context) => Addcommonpayment(
from: "Dashboard", from: "Dashboard",
), ),
), ),
......
...@@ -22,7 +22,8 @@ class Submitpaymentrequestionlistsbymode extends StatefulWidget { ...@@ -22,7 +22,8 @@ class Submitpaymentrequestionlistsbymode extends StatefulWidget {
const Submitpaymentrequestionlistsbymode({ const Submitpaymentrequestionlistsbymode({
super.key, super.key,
required this.mode, required this.mode,
required this.pageTitleName, this.accountId, required this.pageTitleName,
this.accountId,
}); });
@override @override
...@@ -34,7 +35,8 @@ class _SubmitpaymentrequestionlistsbymodeState ...@@ -34,7 +35,8 @@ class _SubmitpaymentrequestionlistsbymodeState
extends State<Submitpaymentrequestionlistsbymode> { extends State<Submitpaymentrequestionlistsbymode> {
Dropdowntheme ddtheme = Dropdowntheme(); Dropdowntheme ddtheme = Dropdowntheme();
List<FocusNode> focusNodes = List.generate(11, (index) => FocusNode()); List<FocusNode> focusNodes = List.generate(11, (index) => FocusNode());
GlobalKey _globalKey = GlobalKey();
ScrollController scrollcontroller = ScrollController();
@override @override
void initState() { void initState() {
// TODO: implement initState // TODO: implement initState
...@@ -46,69 +48,49 @@ class _SubmitpaymentrequestionlistsbymodeState ...@@ -46,69 +48,49 @@ class _SubmitpaymentrequestionlistsbymodeState
); );
print("widget.accountId ${widget.accountId}"); print("widget.accountId ${widget.accountId}");
provider.addPaymentRequestionViewAPI(context, widget.mode); provider.addPaymentRequestionViewAPI(context, widget.mode);
Future.delayed(Duration(milliseconds: 500),() { Future.delayed(Duration(milliseconds: 500), () {
if (widget.mode == "self" && provider.accounts.length == 1) { if (widget.mode == "self" && provider.accounts.length == 1) {
provider.selectedAccount = provider.accounts.first; provider.selectedAccount = provider.accounts.first;
provider.accountId = provider.accounts.first.id!; provider.accountId = provider.accounts.first.id!;
} } else if (widget.mode == "other" && provider.accounts != null) {
else if(widget.mode=="other" && provider.accounts != null) {
if (widget.accountId != null) { if (widget.accountId != null) {
provider.selectedAccount = provider.accounts.firstWhereOrNull(
provider.selectedAccount = (element) => element.id == widget.accountId,
provider.accounts.firstWhereOrNull(
(element) => element.id ==
widget.accountId,
); );
print("sdsd,al;,al${provider.selectedAccount!.id}"); print("sdsd,al;,al${provider.selectedAccount!.id}");
print("sdsd,al;,al${provider.selectedAccount!.name}"); print("sdsd,al;,al${provider.selectedAccount!.name}");
provider.accountId = provider.accountId =
provider.accounts provider.accounts
.firstWhere( .firstWhere((e) => e.id == widget.accountId)!
(e) => e.id == widget.accountId,
)!
.id!; .id!;
provider.accountValue = provider.accountValue =
provider.accounts provider.accounts
.firstWhere( .firstWhere((e) => e.id == widget.accountId)!
(e) => e.id == widget.accountId,
)!
.name!; .name!;
} }
} }
},); });
}); });
} }
@override @override
void dispose() { void dispose() {
scrollcontroller.dispose();
focusNodes.map((e) => e.dispose()); focusNodes.map((e) => e.dispose());
super.dispose(); super.dispose();
} }
autofill(res){ autofill(res) {
print("auto"); print("auto");
var provider = Provider.of<Requestionlistprovider>( var provider = Provider.of<Requestionlistprovider>(context, listen: false);
context,
listen: false,
);
if (provider.accounts != null) { if (provider.accounts != null) {
provider.selectedAccount = provider.accounts.firstWhereOrNull(
provider.selectedAccount = provider.accounts.firstWhereOrNull((element) => element.id==res,); (element) => element.id == res,
);
print("sdsd,al;,al${provider.selectedAccount}"); print("sdsd,al;,al${provider.selectedAccount}");
provider.accountId = provider.accountId = provider.accounts.firstWhere((e) => e.id == res).id!;
provider.accounts
.firstWhere(
(e) => e.id == res,
)
.id!;
provider.accountValue = provider.accountValue =
provider.accounts provider.accounts.firstWhere((e) => e.id == res).name!;
.firstWhere(
(e) => e.id == res,
)
.name!;
} }
} }
...@@ -121,12 +103,10 @@ class _SubmitpaymentrequestionlistsbymodeState ...@@ -121,12 +103,10 @@ class _SubmitpaymentrequestionlistsbymodeState
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Consumer<Requestionlistprovider>( return Consumer<Requestionlistprovider>(
builder: (context, provider, child) { builder: (context, provider, child) {
return WillPopScope( return WillPopScope(
child: SafeArea( child: SafeArea(
top: false, top: false,
bottom: Platform.isIOS?false:true, bottom: Platform.isIOS ? false : true,
child: Scaffold( child: Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
backgroundColor: AppColors.white, backgroundColor: AppColors.white,
...@@ -143,6 +123,7 @@ class _SubmitpaymentrequestionlistsbymodeState ...@@ -143,6 +123,7 @@ class _SubmitpaymentrequestionlistsbymodeState
borderRadius: BorderRadius.circular(20), borderRadius: BorderRadius.circular(20),
), ),
child: SingleChildScrollView( child: SingleChildScrollView(
controller: scrollcontroller,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
...@@ -257,7 +238,9 @@ class _SubmitpaymentrequestionlistsbymodeState ...@@ -257,7 +238,9 @@ class _SubmitpaymentrequestionlistsbymodeState
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: builder:
(context) => Addcommonpayment(from: "Requesition",), (context) => Addcommonpayment(
from: "Requesition",
),
), ),
); );
print("return Response: ${res}"); print("return Response: ${res}");
...@@ -441,6 +424,27 @@ class _SubmitpaymentrequestionlistsbymodeState ...@@ -441,6 +424,27 @@ class _SubmitpaymentrequestionlistsbymodeState
"hfjkshfg" + "hfjkshfg" +
provider.paymentModeId.toString(), provider.paymentModeId.toString(),
); );
if ([
"Cheque",
"RTGS",
"IMPS",
"NEFT",
].contains(provider.paymentModeValue)) {
WidgetsBinding.instance
.addPostFrameCallback((_) {
final context =
_globalKey.currentContext;
if (context != null) {
Scrollable.ensureVisible(
context,
duration: Duration(
milliseconds: 300,
),
curve: Curves.easeInOut,
);
}
});
}
} }
} }
}, },
...@@ -455,7 +459,7 @@ class _SubmitpaymentrequestionlistsbymodeState ...@@ -455,7 +459,7 @@ class _SubmitpaymentrequestionlistsbymodeState
), ),
errorWidget(context, provider.selectPaymentError), errorWidget(context, provider.selectPaymentError),
if(widget.mode=="other")...[ if (widget.mode == "other") ...[
TextWidget(context, "Select Approval Employee"), TextWidget(context, "Select Approval Employee"),
DropdownButtonHideUnderline( DropdownButtonHideUnderline(
child: Row( child: Row(
...@@ -488,13 +492,18 @@ class _SubmitpaymentrequestionlistsbymodeState ...@@ -488,13 +492,18 @@ class _SubmitpaymentrequestionlistsbymodeState
value: provider.selectedApprovalEmployee, value: provider.selectedApprovalEmployee,
onChanged: (Employees? value) { onChanged: (Employees? value) {
if (value != null) { if (value != null) {
if (provider.approvalEmployee.isNotEmpty) { if (provider
provider.selectedApprovalEmployee = value; .approvalEmployee
.isNotEmpty) {
provider.selectedApprovalEmployee =
value;
print( print(
"Selected Complaint Type: ${value.name}, ID: ${value.id}", "Selected Complaint Type: ${value.name}, ID: ${value.id}",
); );
provider.selectedApprovalEmployeeID = value.id!; provider.selectedApprovalEmployeeID =
provider.selectedApprovalEmployeeValue = value.name!; value.id!;
provider.selectedApprovalEmployeeValue =
value.name!;
print( print(
"hfjkshfg" + "hfjkshfg" +
provider.paymentModeId.toString(), provider.paymentModeId.toString(),
...@@ -548,7 +557,9 @@ class _SubmitpaymentrequestionlistsbymodeState ...@@ -548,7 +557,9 @@ class _SubmitpaymentrequestionlistsbymodeState
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text( Expanded(
flex: 4,
child: Text(
"${provider.imagePath}", "${provider.imagePath}",
style: TextStyle( style: TextStyle(
color: AppColors.semi_black, color: AppColors.semi_black,
...@@ -556,7 +567,10 @@ class _SubmitpaymentrequestionlistsbymodeState ...@@ -556,7 +567,10 @@ class _SubmitpaymentrequestionlistsbymodeState
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
InkResponse( ),
Expanded(
flex: 1,
child: InkResponse(
onTap: () { onTap: () {
provider.imagePicked = 0; provider.imagePicked = 0;
provider.imagePath = null; provider.imagePath = null;
...@@ -568,6 +582,7 @@ class _SubmitpaymentrequestionlistsbymodeState ...@@ -568,6 +582,7 @@ class _SubmitpaymentrequestionlistsbymodeState
height: 15, height: 15,
), ),
), ),
),
], ],
), ),
), ),
...@@ -580,6 +595,7 @@ class _SubmitpaymentrequestionlistsbymodeState ...@@ -580,6 +595,7 @@ class _SubmitpaymentrequestionlistsbymodeState
"IMPS", "IMPS",
"NEFT", "NEFT",
].contains(provider.paymentModeValue)) ...[ ].contains(provider.paymentModeValue)) ...[
SizedBox(height: 3, key: _globalKey),
textControllerWidget( textControllerWidget(
context, context,
provider.bankNameController, provider.bankNameController,
...@@ -645,7 +661,7 @@ class _SubmitpaymentrequestionlistsbymodeState ...@@ -645,7 +661,7 @@ class _SubmitpaymentrequestionlistsbymodeState
"RTGS", "RTGS",
"IMPS", "IMPS",
"NEFT", "NEFT",
"UPI" "UPI",
].contains(provider.paymentModeValue)) ...[ ].contains(provider.paymentModeValue)) ...[
textControllerWidget( textControllerWidget(
context, context,
...@@ -688,18 +704,18 @@ class _SubmitpaymentrequestionlistsbymodeState ...@@ -688,18 +704,18 @@ class _SubmitpaymentrequestionlistsbymodeState
provider.submitClicked provider.submitClicked
? null ? null
: () { : () {
provider.submitClicked = false; provider.submitClicked = true;
provider.addPaymentRequestionSubmitAPI( provider.addPaymentRequestionSubmitAPI(
context, context,
widget.mode, widget.mode,
provider.selectedApprovalEmployeeID provider.selectedApprovalEmployeeID,
); );
}, },
child: Container( child: Container(
height: 45, height: 45,
alignment: Alignment.center, alignment: Alignment.center,
margin: EdgeInsets.symmetric(horizontal: 10,vertical: 10), margin: EdgeInsets.symmetric(horizontal: 10, vertical: 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,
......
...@@ -17,6 +17,15 @@ class Gentrackerdashboard extends StatefulWidget { ...@@ -17,6 +17,15 @@ class Gentrackerdashboard extends StatefulWidget {
class _GentrackerdashboardState extends State<Gentrackerdashboard> { class _GentrackerdashboardState extends State<Gentrackerdashboard> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Platform.isAndroid
? WillPopScope(
onWillPop: () => onBackPressed(context),
child: SafeArea(top: false, bottom: true, child: _scaffold(context)),
)
: _scaffold(context);
}
Widget _scaffold(BuildContext context) {
final names = [ final names = [
"Generator Details", "Generator Details",
// "Register Complaint", // "Register Complaint",
...@@ -29,12 +38,7 @@ class _GentrackerdashboardState extends State<Gentrackerdashboard> { ...@@ -29,12 +38,7 @@ class _GentrackerdashboardState extends State<Gentrackerdashboard> {
// "gent_tag_loc", // "gent_tag_loc",
"gent_tag_den", "gent_tag_den",
]; ];
return WillPopScope( return Scaffold(
onWillPop: () => onBackPressed(context),
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar(context, "Gen Tracker"), appBar: appbar(context, "Gen Tracker"),
...@@ -131,16 +135,13 @@ class _GentrackerdashboardState extends State<Gentrackerdashboard> { ...@@ -131,16 +135,13 @@ class _GentrackerdashboardState extends State<Gentrackerdashboard> {
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Text( child: Text(
"Note: 'Tag Location' and 'Register Complaint' are moved to 'Generator Details'.", "Note: 'Tag Location' and 'Register Complaint' are moved to 'Generator Details'.",
style: TextStyle(color: AppColors.grey_thick, style: TextStyle(color: AppColors.grey_thick, fontSize: 14),
fontSize: 14),
), ),
), ),
), ),
SizedBox(height: 10), SizedBox(height: 10),
], ],
), ),
),
),
); );
} }
} }
...@@ -35,14 +35,18 @@ class _InventoryScreenState extends State<InventoryScreen> { ...@@ -35,14 +35,18 @@ class _InventoryScreenState extends State<InventoryScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Platform.isAndroid
? WillPopScope(
onWillPop: () => onBackPressed(context),
child: SafeArea(top: false, bottom: true, child: _scaffold(context)),
)
: _scaffold(context);
}
Widget _scaffold(BuildContext context) {
return Consumer<InventoryProvider>( return Consumer<InventoryProvider>(
builder: (context, provider, child) { builder: (context, provider, child) {
return WillPopScope( return Scaffold(
onWillPop: () => onBackPressed(context),
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar(context, "Gen Inventory"), appBar: appbar(context, "Gen Inventory"),
...@@ -55,7 +59,6 @@ class _InventoryScreenState extends State<InventoryScreen> { ...@@ -55,7 +59,6 @@ class _InventoryScreenState extends State<InventoryScreen> {
height: 250, height: 250,
child: QRView( child: QRView(
key: provider.scannerKey, key: provider.scannerKey,
onQRViewCreated: (p0) { onQRViewCreated: (p0) {
provider.onQRViewCreated(p0, "inventory", context); provider.onQRViewCreated(p0, "inventory", context);
...@@ -64,7 +67,6 @@ class _InventoryScreenState extends State<InventoryScreen> { ...@@ -64,7 +67,6 @@ class _InventoryScreenState extends State<InventoryScreen> {
cameraFacing: CameraFacing.back, cameraFacing: CameraFacing.back,
overlay: QrScannerOverlayShape( overlay: QrScannerOverlayShape(
borderColor: AppColors.app_blue, borderColor: AppColors.app_blue,
borderRadius: 20, borderRadius: 20,
borderLength: 60, borderLength: 60,
...@@ -77,7 +79,11 @@ class _InventoryScreenState extends State<InventoryScreen> { ...@@ -77,7 +79,11 @@ class _InventoryScreenState extends State<InventoryScreen> {
Text( Text(
"Scan QR", "Scan QR",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle(fontSize: 18,fontFamily: "JakartaMedium", color: Colors.white), style: TextStyle(
fontSize: 18,
fontFamily: "JakartaMedium",
color: Colors.white,
),
), ),
Text( Text(
"to open Inventory", "to open Inventory",
...@@ -88,8 +94,11 @@ class _InventoryScreenState extends State<InventoryScreen> { ...@@ -88,8 +94,11 @@ class _InventoryScreenState extends State<InventoryScreen> {
Text( Text(
"or", "or",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle(fontSize: 18, style: TextStyle(
fontFamily: "JakartaMedium",color: Colors.white), fontSize: 18,
fontFamily: "JakartaMedium",
color: Colors.white,
),
), ),
InkResponse( InkResponse(
onTap: () async { onTap: () async {
...@@ -98,17 +107,17 @@ class _InventoryScreenState extends State<InventoryScreen> { ...@@ -98,17 +107,17 @@ class _InventoryScreenState extends State<InventoryScreen> {
child: Text( child: Text(
"Tap To Enter Part ID", "Tap To Enter Part ID",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle(fontSize: 17, style: TextStyle(
fontSize: 17,
fontFamily: "JakartaMedium", fontFamily: "JakartaMedium",
color: AppColors.app_blue), color: AppColors.app_blue,
),
), ),
), ),
SizedBox(height: 50), SizedBox(height: 50),
], ],
), ),
), ),
),
),
); );
}, },
); );
...@@ -160,7 +169,7 @@ class _InventoryScreenState extends State<InventoryScreen> { ...@@ -160,7 +169,7 @@ class _InventoryScreenState extends State<InventoryScreen> {
), ),
), ),
), ),
SizedBox(height: 5,), SizedBox(height: 5),
Container( Container(
height: 48, height: 48,
alignment: Alignment.center, alignment: Alignment.center,
...@@ -188,7 +197,8 @@ class _InventoryScreenState extends State<InventoryScreen> { ...@@ -188,7 +197,8 @@ class _InventoryScreenState extends State<InventoryScreen> {
controller: partIDcontroller, controller: partIDcontroller,
keyboardType: TextInputType.text, keyboardType: TextInputType.text,
focusNode: partIDfocusNode, focusNode: partIDfocusNode,
textCapitalization: TextCapitalization.characters, textCapitalization:
TextCapitalization.characters,
style: TextStyle(fontSize: 14), style: TextStyle(fontSize: 14),
onChanged: (value) {}, onChanged: (value) {},
...@@ -210,7 +220,7 @@ class _InventoryScreenState extends State<InventoryScreen> { ...@@ -210,7 +220,7 @@ class _InventoryScreenState extends State<InventoryScreen> {
), ),
), ),
), ),
SizedBox(height: 15,), SizedBox(height: 15),
InkWell( InkWell(
onTap: () { onTap: () {
provider.LoadPartDetailsApifunction( provider.LoadPartDetailsApifunction(
...@@ -238,9 +248,11 @@ class _InventoryScreenState extends State<InventoryScreen> { ...@@ -238,9 +248,11 @@ class _InventoryScreenState extends State<InventoryScreen> {
child: Text( child: Text(
"Submit", "Submit",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle(color: Colors.white, style: TextStyle(
color: Colors.white,
fontFamily: "JakartaMedium", fontFamily: "JakartaMedium",
fontSize: 15), fontSize: 15,
),
), ),
), ),
), ),
......
...@@ -23,22 +23,30 @@ class _OrdermoduledashboardState extends State<Ordermoduledashboard> { ...@@ -23,22 +23,30 @@ class _OrdermoduledashboardState extends State<Ordermoduledashboard> {
// TODO: implement initState // TODO: implement initState
super.initState(); super.initState();
WidgetsBinding.instance.addPostFrameCallback((timeStamp) { WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
var provider = Provider.of<Pagesdashboardprovider>(context, listen: false); var provider = Provider.of<Pagesdashboardprovider>(
context,
listen: false,
);
provider.orderDashboardAPIFunction(context, "executive", "", "", ""); provider.orderDashboardAPIFunction(context, "executive", "", "", "");
provider.ordersAccessiblePagesAPIFunction(context); provider.ordersAccessiblePagesAPIFunction(context);
}); });
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Platform.isAndroid
? WillPopScope(
onWillPop: () => onBackPressed(context),
child: SafeArea(top: false, bottom: true, child: _scaffold(context)),
)
: _scaffold(context);
}
Widget _scaffold(BuildContext context) {
return Consumer<Pagesdashboardprovider>( return Consumer<Pagesdashboardprovider>(
builder: (context, provider, child) { builder: (context, provider, child) {
final pages = provider.ordersAccessiblePagesList; final pages = provider.ordersAccessiblePagesList;
return WillPopScope( return Scaffold(
onWillPop: () => onBackPressed(context),
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar(context, "Orders"), appBar: appbar(context, "Orders"),
...@@ -47,15 +55,15 @@ class _OrdermoduledashboardState extends State<Ordermoduledashboard> { ...@@ -47,15 +55,15 @@ class _OrdermoduledashboardState extends State<Ordermoduledashboard> {
child: Column( child: Column(
children: [ children: [
Container( Container(
padding: EdgeInsets.symmetric(horizontal: 10,vertical: 5), padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
margin: EdgeInsets.symmetric(horizontal: 0,vertical: 10), margin: EdgeInsets.symmetric(horizontal: 0, vertical: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(16) borderRadius: BorderRadius.circular(16),
), ),
height: MediaQuery.of(context).size.height * 0.28, height: MediaQuery.of(context).size.height * 0.28,
child: GridView.builder( child: GridView.builder(
padding: EdgeInsets.symmetric(horizontal: 0,vertical: 5), padding: EdgeInsets.symmetric(horizontal: 0, vertical: 5),
itemCount: provider.ordersgain.length, itemCount: provider.ordersgain.length,
shrinkWrap: true, shrinkWrap: true,
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
...@@ -64,7 +72,7 @@ class _OrdermoduledashboardState extends State<Ordermoduledashboard> { ...@@ -64,7 +72,7 @@ class _OrdermoduledashboardState extends State<Ordermoduledashboard> {
crossAxisCount: 2, crossAxisCount: 2,
crossAxisSpacing: 10, crossAxisSpacing: 10,
mainAxisSpacing: 10, mainAxisSpacing: 10,
childAspectRatio: 0.65 childAspectRatio: 0.65,
), ),
itemBuilder: (context, jndex) { itemBuilder: (context, jndex) {
final icons = ["comm_ic_1", "comm_ic_2"]; final icons = ["comm_ic_1", "comm_ic_2"];
...@@ -149,79 +157,69 @@ class _OrdermoduledashboardState extends State<Ordermoduledashboard> { ...@@ -149,79 +157,69 @@ class _OrdermoduledashboardState extends State<Ordermoduledashboard> {
Widget? SvgIcon; Widget? SvgIcon;
switch (pages[index].mode) { switch (pages[index].mode) {
case "level_one_approval": case "level_one_approval":
SvgIcon = SvgPicture.asset( SvgIcon = SvgPicture.asset("assets/svg/fin_lv1.svg");
"assets/svg/fin_lv1.svg",
);
break; break;
case "level_two_approval": case "level_two_approval":
case "level_two_rejected": case "level_two_rejected":
SvgIcon = SvgPicture.asset( SvgIcon = SvgPicture.asset("assets/svg/fin_lv2.svg");
"assets/svg/fin_lv2.svg",
);
break; break;
default: default:
SvgIcon = SvgPicture.asset("assets/svg/fin_ic.svg"); SvgIcon = SvgPicture.asset("assets/svg/fin_ic.svg");
break; break;
}; }
;
return InkResponse( return InkResponse(
onTap: () async { onTap: () async {
var navigate; var navigate;
if (pages[index].pageName!.contains("Add Order") ) { if (pages[index].pageName!.contains("Add Order")) {
navigate = AddorderScreen( navigate = AddorderScreen(
mode: pages[index].mode!, mode: pages[index].mode!,
pageTitleName: pageTitleName: pages[index].pageName!,
pages[index]
.pageName!,
); );
}if (pages[index].pageName!.contains("Add Payment") ) { }
if (pages[index].pageName!.contains("Add Payment")) {
("navigate to Add Payment"); ("navigate to Add Payment");
navigate = AddpaymentScreen( navigate = AddpaymentScreen(
mode: pages[index].mode!, mode: pages[index].mode!,
pageTitleName: pageTitleName: pages[index].pageName!,
pages[index]
.pageName!,
); );
} } else if (pages[index].pageName!.contains(
else if (pages[index].pageName!.contains("Payments List")) { "Payments List",
)) {
navigate = Paymentlistsbymode( navigate = Paymentlistsbymode(
mode: pages[index].mode!, mode: pages[index].mode!,
pageTitleName: pageTitleName: pages[index].pageName!,
pages[index]
.pageName!,
); );
} else if (pages[index].pageName!.contains("Order List")){ } else if (pages[index].pageName!.contains(
"Order List",
)) {
navigate = OrderslistbyModes( navigate = OrderslistbyModes(
mode: pages[index].mode!, mode: pages[index].mode!,
pageTitleName: pageTitleName: pages[index].pageName!,
pages[index]
.pageName!,
); );
}else if(pages[index].pageName=="Add TPC Agent"){ } else if (pages[index].pageName == "Add TPC Agent") {
navigate = AddtpcagentScreen(); navigate = AddtpcagentScreen();
}else if(pages[index].pageName=="TPC Agent List (Admin)"){ } else if (pages[index].pageName ==
"TPC Agent List (Admin)") {
navigate = Tpcagentlistbymode( navigate = Tpcagentlistbymode(
mode: pages[index].mode!, mode: pages[index].mode!,
pageTitleName: pageTitleName: pages[index].pageName!,
pages[index]
.pageName!,
); );
}else if(pages[index].pageName=="Pending TPC Issue List"){ } else if (pages[index].pageName ==
"Pending TPC Issue List") {
navigate = Tpcagentissuelist( navigate = Tpcagentissuelist(
mode: pages[index].mode!, mode: pages[index].mode!,
pageTitleName: pageTitleName: pages[index].pageName!,
pages[index]
.pageName!,
); );
} }
if(navigate!=null){ if (navigate != null) {
await Navigator.push( await Navigator.push(
context, context,
MaterialPageRoute(builder: (context) => navigate), MaterialPageRoute(builder: (context) => navigate),
); );
} }
}, },
child: Container( child: Container(
margin: EdgeInsets.symmetric( margin: EdgeInsets.symmetric(
...@@ -241,9 +239,7 @@ class _OrdermoduledashboardState extends State<Ordermoduledashboard> { ...@@ -241,9 +239,7 @@ class _OrdermoduledashboardState extends State<Ordermoduledashboard> {
Expanded(flex: 1, child: SvgIcon), Expanded(flex: 1, child: SvgIcon),
Expanded( Expanded(
flex: 5, flex: 5,
child: Text( child: Text("${pages[index].pageName}"),
"${pages[index].pageName}",
),
), ),
Expanded( Expanded(
flex: 1, flex: 1,
...@@ -261,8 +257,6 @@ class _OrdermoduledashboardState extends State<Ordermoduledashboard> { ...@@ -261,8 +257,6 @@ class _OrdermoduledashboardState extends State<Ordermoduledashboard> {
), ),
), ),
), ),
),
),
); );
}, },
); );
......
...@@ -27,7 +27,7 @@ class _AccountsuggestionsState extends State<Accountsuggestions> { ...@@ -27,7 +27,7 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
onWillPop: () => onBackPressed(context), onWillPop: () => onBackPressed(context),
child: SafeArea( child: SafeArea(
top: false, top: false,
bottom: Platform.isIOS?false:true, bottom: Platform.isIOS ? false : true,
child: Scaffold( child: Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
appBar: appbar(context, "Accounts"), appBar: appbar(context, "Accounts"),
...@@ -54,7 +54,10 @@ class _AccountsuggestionsState extends State<Accountsuggestions> { ...@@ -54,7 +54,10 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
borderRadius: BorderRadius.circular(14), borderRadius: BorderRadius.circular(14),
border: border:
searchFocusNode.hasFocus searchFocusNode.hasFocus
? Border.all(color: AppColors.app_blue, width: 0.5) ? Border.all(
color: AppColors.app_blue,
width: 0.5,
)
: null, : null,
), ),
// alignment: Alignment.center, // alignment: Alignment.center,
...@@ -123,7 +126,9 @@ class _AccountsuggestionsState extends State<Accountsuggestions> { ...@@ -123,7 +126,9 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
builder: builder:
(context) => Paymentdetails( (context) => Paymentdetails(
accountName: "Account", accountName: "Account",
name: accountList![index].accountName, name:
accountList![index]
.accountName,
genId: "", genId: "",
referenceID: referenceID:
accountList![index].accountId, accountList![index].accountId,
...@@ -135,7 +140,8 @@ class _AccountsuggestionsState extends State<Accountsuggestions> { ...@@ -135,7 +140,8 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
child: SizedBox( child: SizedBox(
child: Container( child: Container(
width: width:
MediaQuery.of(context).size.width * 0.9, MediaQuery.of(context).size.width *
0.9,
padding: EdgeInsets.fromLTRB(0, 5, 0, 10), padding: EdgeInsets.fromLTRB(0, 5, 0, 10),
child: Row( child: Row(
children: [ children: [
...@@ -148,9 +154,8 @@ class _AccountsuggestionsState extends State<Accountsuggestions> { ...@@ -148,9 +154,8 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFFE6F6FF), color: Color(0xFFE6F6FF),
borderRadius: BorderRadius.circular( borderRadius:
8, BorderRadius.circular(8),
),
), ),
child: SvgPicture.asset( child: SvgPicture.asset(
width: 30, width: 30,
...@@ -159,7 +164,7 @@ class _AccountsuggestionsState extends State<Accountsuggestions> { ...@@ -159,7 +164,7 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
), ),
), ),
), ),
SizedBox(width: 10,), SizedBox(width: 10),
Expanded( Expanded(
flex: 5, flex: 5,
child: Text( child: Text(
...@@ -168,7 +173,7 @@ class _AccountsuggestionsState extends State<Accountsuggestions> { ...@@ -168,7 +173,7 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
maxLines: 3, maxLines: 3,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
color: AppColors.semi_black color: AppColors.semi_black,
), ),
), ),
), ),
...@@ -189,7 +194,8 @@ class _AccountsuggestionsState extends State<Accountsuggestions> { ...@@ -189,7 +194,8 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
physics: AlwaysScrollableScrollPhysics(), physics: AlwaysScrollableScrollPhysics(),
child: Container( child: Container(
width: double.infinity, width: double.infinity,
height: MediaQuery.of(context).size.height, height:
MediaQuery.of(context).size.height,
// Set width to fill parent width // Set width to fill parent width
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
...@@ -197,7 +203,12 @@ class _AccountsuggestionsState extends State<Accountsuggestions> { ...@@ -197,7 +203,12 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
topRight: Radius.circular(30.0), topRight: Radius.circular(30.0),
), ),
), ),
padding: EdgeInsets.fromLTRB(10, 10, 10, 10), padding: EdgeInsets.fromLTRB(
10,
10,
10,
10,
),
child: Container( child: Container(
child: Align( child: Align(
alignment: Alignment.center, alignment: Alignment.center,
......
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