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

19-06-2025 By Sai Srinivas

Finance Module Test cases & Safe Area
parent 4807bee4
...@@ -186,64 +186,82 @@ class Requesitionlidtdetailsprovider extends ChangeNotifier { ...@@ -186,64 +186,82 @@ class Requesitionlidtdetailsprovider extends ChangeNotifier {
_paymentDetails = _paymentDetails =
data.paymentDetails ?? data.paymentDetails ??
PaymentDetails( PaymentDetails(
accountId: "", accountId: "-",
accountName: "", accountName: "-",
amount: "", amount: "-",
attachmentDirFilePath: "", attachmentDirFilePath: "-",
attachmentViewFileName: "", attachmentViewFileName: "-",
bankAccountHolderName: "", bankAccountHolderName: "-",
bankAccountNumber: "", bankAccountNumber: "-",
bankBranchName: "", bankBranchName: "-",
bankIfscCode: "", bankIfscCode: "-",
bankName: "", bankName: "-",
bankUpiId: "", bankUpiId: "-",
createdDatetime: "", createdDatetime: "-",
createdEmployeeId: "", createdEmployeeId: "-",
description: "", description: "-",
id: "", id: "-",
isExists: "", isExists: "-",
mode: "", mode: "-",
paymentAccountId: "", paymentAccountId: "-",
paymentAccountName: "", paymentAccountName: "-",
paymentDate: "", paymentDate: "-",
paymentEmployeeName: "", paymentEmployeeName: "-",
paymentModeId: "", paymentModeId: "-",
paymentReferenceNumber: "", paymentReferenceNumber: "-",
paymentRemarks: "", paymentRemarks: "-",
refId: "", refId: "-",
refType: "", refType: "-",
updatedDatetime: "", updatedDatetime: "-",
); );
_requestDetails = _requestDetails =
data.requestDetails ?? data.requestDetails ??
RequestDetails( RequestDetails(
updatedDatetime: "", updatedDatetime: "-",
id: "", id: "-",
description: "", description: "-",
createdDatetime: "", createdDatetime: "-",
attachmentViewFileName: "", attachmentViewFileName: "-",
attachmentDirFilePath: "", attachmentDirFilePath: "-",
amount: "", amount: "-",
accountName: "", accountName: "-",
accountId: "", accountId: "-",
branch: "", branch: "-",
createdEmployee: "", createdEmployee: "-",
date: "", date: "-",
isProcessedPaymentRequest: "", isProcessedPaymentRequest: "-",
level1ApprovalRemarks: "", level1ApprovalRemarks: "-",
level1Employee: "", level1Employee: "-",
level2ApprovalRemarks: "", level2ApprovalRemarks: "-",
level2Employee: "", level2Employee: "-",
proposedAccount: "", proposedAccount: "-",
proposedAccountId: "", proposedAccountId: "-",
requestedAmount: "", requestedAmount: "-",
requestingPurpose: "", requestingPurpose: "-",
requestMode: "", requestMode: "-",
status: "", status: "-",
transDis: "", transDis: "-",
); );
_subHeadings = [
_requestDetails.accountName ?? "-",
_requestDetails.proposedAccount ?? "-",
_requestDetails.branch ?? "-",
_requestDetails.requestingPurpose ?? "-",
_requestDetails.requestMode ?? "-",
_requestDetails.createdEmployee ?? "-",
_requestDetails.attachmentViewFileName ?? "-",
_requestDetails.date ?? "-",
_requestDetails.description ?? "-",
_requestDetails.level1ApprovalRemarks ?? "-",
_requestDetails.level1Employee ?? "-",
_requestDetails.level2ApprovalRemarks ?? "-",
_requestDetails.level2Employee ?? "-",
_requestDetails.createdDatetime ?? "-",
_requestDetails.updatedDatetime ?? "-",
];
print("here 2121"); print("here 2121");
preValues(); preValues();
notifyListeners(); notifyListeners();
......
...@@ -359,17 +359,8 @@ class Requestionlistprovider extends ChangeNotifier { ...@@ -359,17 +359,8 @@ class Requestionlistprovider extends ChangeNotifier {
_paymentModes = data.paymentModes!; _paymentModes = data.paymentModes!;
_requestingPurposes = data.requestingPurposes!; _requestingPurposes = data.requestingPurposes!;
if (_selectedAccounts != null && checkDropdownselected();
!_accounts.contains(_selectedAccounts)) { notifyListeners();
_selectedAccounts = null;
_accountId = "";
}
if (_selectedPayment != null &&
!_paymentModes.contains(_selectedPayment)) {
_selectedPayment = null;
_paymentModeId = "";
}
} else {} } else {}
} }
} catch (e, s) {} } catch (e, s) {}
...@@ -434,26 +425,8 @@ class Requestionlistprovider extends ChangeNotifier { ...@@ -434,26 +425,8 @@ class Requestionlistprovider extends ChangeNotifier {
_directPaymentAccounts = data.paymentAccounts!; _directPaymentAccounts = data.paymentAccounts!;
_directPaymentModes = data.paymentModes!; _directPaymentModes = data.paymentModes!;
_directAccounts = data.accounts!; _directAccounts = data.accounts!;
checkdirectPaymentDropDownsSlected();
if (_selectedDirectAccounts != null &&
!_directAccounts.contains(_selectedDirectAccounts)) {
_selectedDirectAccounts = null;
_directAccountID = "";
_directAccountValue = "";
}
if (_selectDirectPaymentModes != null &&
!_directPaymentModes.contains(_selectDirectPaymentModes)) {
_selectDirectPaymentModes = null;
_directPaymentModesID = "";
_directPaymentModesValues = "";
}
if (_selectDirectPaymentAccounts != null &&
!_directPaymentAccounts.contains(_selectDirectPaymentAccounts)) {
_selectDirectPaymentAccounts = null;
_directPaymentAccountsID = "";
_directPaymentAccountsValue = "";
}
notifyListeners(); notifyListeners();
} else {} } else {}
} }
...@@ -890,9 +863,48 @@ class Requestionlistprovider extends ChangeNotifier { ...@@ -890,9 +863,48 @@ class Requestionlistprovider extends ChangeNotifier {
UPIError = null; UPIError = null;
FileError = null; FileError = null;
buttonEnabled = false; buttonEnabled = false;
checkDropdownselected();
checkdirectPaymentDropDownsSlected();
notifyListeners(); notifyListeners();
} }
void checkdirectPaymentDropDownsSlected(){
if (_selectedDirectAccounts != null &&
!_directAccounts.contains(_selectedDirectAccounts)) {
_selectedDirectAccounts = null;
_directAccountID = "";
_directAccountValue = "";
}
if (_selectDirectPaymentModes != null &&
!_directPaymentModes.contains(_selectDirectPaymentModes)) {
_selectDirectPaymentModes = null;
_directPaymentModesID = "";
_directPaymentModesValues = "";
}
if (_selectDirectPaymentAccounts != null &&
!_directPaymentAccounts.contains(_selectDirectPaymentAccounts)) {
_selectDirectPaymentAccounts = null;
_directPaymentAccountsID = "";
_directPaymentAccountsValue = "";
}
}
void checkDropdownselected() {
if (_selectedAccounts != null &&
!_accounts.contains(_selectedAccounts)) {
_selectedAccounts = null;
_accountId = "";
}
if (_selectedPayment != null &&
!_paymentModes.contains(_selectedPayment)) {
_selectedPayment = null;
_paymentModeId = "";
}
if (_selectReqPurpose != null &&
!_requestingPurposes.contains(_selectReqPurpose)) {
_selectReqPurpose = null;
}
}
bool validateForm(BuildContext context, String mode) { bool validateForm(BuildContext context, String mode) {
// Reset all errors // Reset all errors
......
...@@ -441,28 +441,8 @@ class Paymentreceiptsprovider extends ChangeNotifier { ...@@ -441,28 +441,8 @@ class Paymentreceiptsprovider extends ChangeNotifier {
_receiptPaymentAccounts = data.receiptAccounts!; _receiptPaymentAccounts = data.receiptAccounts!;
_receiptPaymentModes = data.paymentModes!; _receiptPaymentModes = data.paymentModes!;
_receiptAccounts = data.accounts!; _receiptAccounts = data.accounts!;
checkDropDownSelected();
if (_selectedreceiptAccounts != null &&
!_receiptAccounts.contains(_selectedreceiptAccounts)) {
_selectedreceiptAccounts = null;
_receiptAccountID = "";
_receiptAccountValue = "";
}
if (_selectreceiptPaymentModes != null &&
!_receiptPaymentModes.contains(_selectreceiptPaymentModes)) {
_selectreceiptPaymentModes = null;
_receiptPaymentModesID = "";
_receiptPaymentModesValues = "";
}
if (_selectreceiptPaymentAccounts != null &&
!_receiptPaymentAccounts.contains(
_selectreceiptPaymentAccounts,
)) {
_selectreceiptPaymentAccounts = null;
_receiptPaymentAccountsID = "";
_receiptPaymentAccountsValue = "";
}
notifyListeners(); notifyListeners();
} else {} } else {}
} }
...@@ -751,9 +731,32 @@ class Paymentreceiptsprovider extends ChangeNotifier { ...@@ -751,9 +731,32 @@ class Paymentreceiptsprovider extends ChangeNotifier {
FileError = null; FileError = null;
buttonEnabled = false; buttonEnabled = false;
dateError = null; dateError = null;
checkDropDownSelected();
notifyListeners(); notifyListeners();
} }
void checkDropDownSelected(){
if (_selectedreceiptAccounts != null &&
!_receiptAccounts.contains(_selectedreceiptAccounts)) {
_selectedreceiptAccounts = null;
_receiptAccountID = "";
_receiptAccountValue = "";
}
if (_selectreceiptPaymentModes != null &&
!_receiptPaymentModes.contains(_selectreceiptPaymentModes)) {
_selectreceiptPaymentModes = null;
_receiptPaymentModesID = "";
_receiptPaymentModesValues = "";
}
if (_selectreceiptPaymentAccounts != null &&
!_receiptPaymentAccounts.contains(
_selectreceiptPaymentAccounts,
)) {
_selectreceiptPaymentAccounts = null;
_receiptPaymentAccountsID = "";
_receiptPaymentAccountsValue = "";
}
}
bool validatereceiptForm(BuildContext context) { bool validatereceiptForm(BuildContext context) {
selectAccountError = null; selectAccountError = null;
......
...@@ -58,7 +58,18 @@ class Paymentrequisitionpaymentslistprovider extends ChangeNotifier{ ...@@ -58,7 +58,18 @@ class Paymentrequisitionpaymentslistprovider extends ChangeNotifier{
final data = await ApiCalling.paymentRequisitionPaymentDetailsAPI(prov.empId, prov.session,paymentId); final data = await ApiCalling.paymentRequisitionPaymentDetailsAPI(prov.empId, prov.session,paymentId);
if(data!=null){ if(data!=null){
if(data.error=="0"){ if(data.error=="0"){
_paymentDetails = data.paymentDetails!; _paymentDetails = data.paymentDetails??PaymentDetails(
accountId: "-",
accountName: "-",
amount: "-",
attachmentDirFilePath: "-",
attachmentViewFileName: "-",
createdDatetime: "-",
description: "-",
id: "-",
updatedDatetime: "-",
refType: "-",refId: "-",paymentRemarks: "-",paymentReferenceNumber: "-",paymentModeId: "-",paymentEmployeeName: "-",paymentDate: "-",paymentAccountName: "-",paymentAccountId: "-",mode: "-",isExists: "-",createdEmployeeId: "-",bankUpiId: "-",bankName: "-",bankIfscCode:"-",bankBranchName: "-",bankAccountNumber: "-",bankAccountHolderName:"-" ,
);
_headings = [ _headings = [
"From Account", "From Account",
"Payment Mode", "Payment Mode",
......
...@@ -6,6 +6,7 @@ import 'package:flutter/foundation.dart'; ...@@ -6,6 +6,7 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:flutter_ringtone_player/flutter_ringtone_player.dart'; import 'package:flutter_ringtone_player/flutter_ringtone_player.dart';
import 'package:generp/Utils/app_colors.dart';
import 'screens/notifierExports.dart'; import 'screens/notifierExports.dart';
import 'package:generp/Utils/SharedpreferencesService.dart'; import 'package:generp/Utils/SharedpreferencesService.dart';
import 'package:generp/screens/splash.dart'; import 'package:generp/screens/splash.dart';
...@@ -262,6 +263,13 @@ class MyApp extends StatelessWidget { ...@@ -262,6 +263,13 @@ class MyApp extends StatelessWidget {
colorScheme: const ColorScheme.light( colorScheme: const ColorScheme.light(
background: Colors.white, background: Colors.white,
).copyWith(background: Colors.white), ).copyWith(background: Colors.white),
scrollbarTheme: ScrollbarThemeData(
minThumbLength: 20,
interactive: true,
radius: Radius.circular(6),
thickness: WidgetStatePropertyAll(10),
thumbColor: WidgetStateProperty.all(AppColors.grey_semi.withOpacity(0.6))
)
), ),
home: const Splash(), home: const Splash(),
); );
......
This diff is collapsed.
...@@ -39,190 +39,192 @@ class _CheckInOutScreenState extends State<CheckInOutScreen> { ...@@ -39,190 +39,192 @@ class _CheckInOutScreenState extends State<CheckInOutScreen> {
child: Scaffold( child: Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
appBar: appbar(context, widget.getAttendanceStatus==0? "Check In":"Check Out"), appBar: appbar(context, widget.getAttendanceStatus==0? "Check In":"Check Out"),
body:Container( body:SafeArea(
child: SafeArea( child: Container(
child: Column( child: SafeArea(
children: [ child: Column(
Expanded( children: [
child: Stack( Expanded(
children: [ child: Stack(
GoogleMap( children: [
myLocationEnabled: true, GoogleMap(
zoomGesturesEnabled: true, myLocationEnabled: true,
scrollGesturesEnabled: false, zoomGesturesEnabled: true,
initialCameraPosition: CameraPosition( scrollGesturesEnabled: false,
target: provider.currentLocationLatLng ?? initialCameraPosition: CameraPosition(
provider.startLocation, target: provider.currentLocationLatLng ??
zoom: 20.0, provider.startLocation,
zoom: 20.0,
),
markers: provider.markers.toSet(),
myLocationButtonEnabled: true,
mapType: MapType.normal,
onMapCreated: (controller) {
provider.mapController = controller;
provider.getCurrentLocation();
provider.getLocationPermission(context);
},
onCameraMove: (position) {
provider.onCameraMove(position,context);
},
), ),
markers: provider.markers.toSet(), Positioned(
myLocationButtonEnabled: true, left: 0,
mapType: MapType.normal, right: 0,
onMapCreated: (controller) { bottom: 0,
provider.mapController = controller; child: Container(
provider.getCurrentLocation(); height: size.height * 0.3,
provider.getLocationPermission(context); decoration: BoxDecoration(
}, color: Colors.white,
onCameraMove: (position) { borderRadius: BorderRadius.only(
provider.onCameraMove(position,context); topLeft: Radius.circular(30.0),
}, topRight: Radius.circular(30.0),
), ),
Positioned(
left: 0,
right: 0,
bottom: 0,
child: Container(
height: size.height * 0.3,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(30.0),
topRight: Radius.circular(30.0),
), ),
), child: Column(
child: Column( crossAxisAlignment:
crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start, children: [
children: [ SizedBox(height: 25),
SizedBox(height: 25),
Padding(
Padding( padding: const EdgeInsets.symmetric(
padding: const EdgeInsets.symmetric( horizontal: 20.0),
horizontal: 20.0), child: Column(
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ Text(
Text( "Share Your Details",
"Share Your Details", style: TextStyle(
style: TextStyle( color: AppColors.app_blue,
color: AppColors.app_blue, fontFamily: "JakartaSemiBold"
fontFamily: "JakartaSemiBold" ),
),
),
SizedBox(height: 10,),
Text(
"Location",
style: TextStyle(
fontFamily: "JakartaMedium",
color: AppColors.semi_black,
), ),
), SizedBox(height: 10,),
], Text(
), "Location",
), style: TextStyle(
SizedBox(height: 5), fontFamily: "JakartaMedium",
Padding( color: AppColors.semi_black,
padding: const EdgeInsets.symmetric(
horizontal: 20.0),
child: Container(
height: 50,
alignment: Alignment.center,
decoration: BoxDecoration(
color: AppColors.text_field_color,
borderRadius:
BorderRadius.circular(14),
),
child: Padding(
padding:
const EdgeInsets.fromLTRB(
10.0, 0.0, 10, 0),
child: TextFormField(
controller:
provider.locationController,
keyboardType:
TextInputType.text,
decoration: InputDecoration(
hintText:
"Enter Check ${widget.getAttendanceStatus==0?"In":"Out"} Location",
hintStyle: TextStyle(
fontWeight: FontWeight.w400,
fontSize: 14,
color: Color(0xFF818181)
), ),
enabledBorder:
InputBorder.none,
focusedBorder:
InputBorder.none,
), ),
],
),
), ),
), ),
), SizedBox(height: 5),
if (provider.validateLocation != null)
Padding( Padding(
padding: padding: const EdgeInsets.symmetric(
const EdgeInsets.symmetric(
horizontal: 20.0), horizontal: 20.0),
child: Container( child: Container(
alignment: Alignment.topLeft, height: 50,
margin: EdgeInsets.only(
top: 2.5,
bottom: 2.5,
left: 25),
child: Text(
provider.validateLocation!,
textAlign: TextAlign.start,
style: TextStyle(
color: Colors.red,
),
),
),
)
else
SizedBox(height: 5.0),
SizedBox(height: 20),
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 20.0),
child: InkWell(
onTap: () async {
if (provider
.locationController
.text
.isEmpty) {
provider.validateLocation =
"Please Enter location";
provider.notifyListeners();
} else {
provider.validateLocation = "";
provider.imgFromCamera(
context,widget.getAttendanceStatus);
}
},
child: Container(
alignment: Alignment.center,
height: 45,
width: screenWidth,
alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
color: AppColors.app_blue, color: AppColors.text_field_color,
borderRadius: borderRadius:
BorderRadius.circular(15.0), BorderRadius.circular(14),
), ),
child: Text( child: Padding(
widget.getAttendanceStatus==0? "Check In":"Check Out", padding:
style: TextStyle( const EdgeInsets.fromLTRB(
fontFamily: "JakartaMedium", 10.0, 0.0, 10, 0),
fontSize: 16, child: TextFormField(
color: Colors.white controller:
provider.locationController,
keyboardType:
TextInputType.text,
decoration: InputDecoration(
hintText:
"Enter Check ${widget.getAttendanceStatus==0?"In":"Out"} Location",
hintStyle: TextStyle(
fontWeight: FontWeight.w400,
fontSize: 14,
color: Color(0xFF818181)
),
enabledBorder:
InputBorder.none,
focusedBorder:
InputBorder.none,
),
), ),
), ),
), ),
), ),
), if (provider.validateLocation != null)
], Padding(
padding:
const EdgeInsets.symmetric(
horizontal: 20.0),
child: Container(
alignment: Alignment.topLeft,
margin: EdgeInsets.only(
top: 2.5,
bottom: 2.5,
left: 25),
child: Text(
provider.validateLocation!,
textAlign: TextAlign.start,
style: TextStyle(
color: Colors.red,
),
),
),
)
else
SizedBox(height: 5.0),
SizedBox(height: 20),
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 20.0),
child: InkWell(
onTap: () async {
if (provider
.locationController
.text
.isEmpty) {
provider.validateLocation =
"Please Enter location";
provider.notifyListeners();
} else {
provider.validateLocation = "";
provider.imgFromCamera(
context,widget.getAttendanceStatus);
}
},
child: Container(
alignment: Alignment.center,
height: 45,
width: screenWidth,
decoration: BoxDecoration(
color: AppColors.app_blue,
borderRadius:
BorderRadius.circular(15.0),
),
child: Text(
widget.getAttendanceStatus==0? "Check In":"Check Out",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 16,
color: Colors.white
),
),
),
),
),
],
),
), ),
), ),
), ],
], ),
), ),
), ],
], ),
), ),
), ),
), ),
......
This diff is collapsed.
This diff is collapsed.
...@@ -24,48 +24,50 @@ class _ScannerloginState extends State<Scannerlogin> { ...@@ -24,48 +24,50 @@ class _ScannerloginState extends State<Scannerlogin> {
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar(context, "QR Login"), appBar: appbar(context, "QR Login"),
body: Container( body: SafeArea(
decoration: BoxDecoration(color: Colors.black), child: Container(
child: Column( decoration: BoxDecoration(color: Colors.black),
children: [ child: Column(
Spacer(), children: [
Container( Spacer(),
height: 250, Container(
height: 250,
child: QRView(
child: QRView(
key: provider.scannerKey,
onQRViewCreated: (p0) { key: provider.scannerKey,
provider.onQRViewCreated(p0, context); onQRViewCreated: (p0) {
}, provider.onQRViewCreated(p0, context);
formatsAllowed: [BarcodeFormat.qrcode], },
cameraFacing: CameraFacing.back, formatsAllowed: [BarcodeFormat.qrcode],
cameraFacing: CameraFacing.back,
overlay: QrScannerOverlayShape(
overlay: QrScannerOverlayShape(
borderColor: AppColors.app_blue,
borderRadius: 20, borderColor: AppColors.app_blue,
borderLength: 60, borderRadius: 20,
borderWidth: 10, borderLength: 60,
cutOutSize: 250.0, borderWidth: 10,
cutOutSize: 250.0,
),
), ),
), ),
), SizedBox(height: 25),
SizedBox(height: 25), Text(
Text( "Scan QR",
"Scan QR", textAlign: TextAlign.center,
textAlign: TextAlign.center, style: TextStyle(fontSize: 18, color: Colors.white),
style: TextStyle(fontSize: 18, color: Colors.white), ),
), Text(
Text( "to Login",
"to Login", textAlign: TextAlign.center,
textAlign: TextAlign.center, style: TextStyle(fontSize: 14, color: Colors.white),
style: TextStyle(fontSize: 14, color: Colors.white), ),
), Spacer(),
Spacer(),
SizedBox(height: 50),
SizedBox(height: 50), ],
], ),
), ),
), ),
), ),
......
...@@ -19,124 +19,126 @@ class UpdatePassword extends StatelessWidget { ...@@ -19,124 +19,126 @@ class UpdatePassword extends StatelessWidget {
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
appBar: appbar(context, "Update Password"), appBar: appbar(context, "Update Password"),
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
body: Container( body: SafeArea(
child: Column( child: Container(
children: [ child: Column(
Expanded( children: [
child: Container( Expanded(
width: double.infinity, child: Container(
decoration: BoxDecoration( width: double.infinity,
borderRadius: BorderRadius.vertical( decoration: BoxDecoration(
top: Radius.circular(30.0), borderRadius: BorderRadius.vertical(
top: Radius.circular(30.0),
),
), ),
), padding: EdgeInsets.all(10),
padding: EdgeInsets.all(10), child: Column(
child: Column( children: [
children: [ Container(
Container( height: 280,
height: 280, decoration: BoxDecoration(
decoration: BoxDecoration( color: Colors.white,
color: Colors.white, borderRadius: BorderRadius.circular(20.0),
borderRadius: BorderRadius.circular(20.0), ),
), child: Column(
child: Column( children: [
children: [ SizedBox(height: 10),
SizedBox(height: 10), Container(
Container(
alignment: Alignment.topLeft,
padding: EdgeInsets.symmetric(horizontal: 10),
child: Text("New Password",style: TextStyle(
color: AppColors.semi_black
),)),
SizedBox(height: 5),
_buildTextField(
controller: provider.password,
hintText: "New Password*",
errorText: provider.passwordError,
obscureText: !provider.pwdVisible,
suffixIcon: IconButton(
icon:
provider.pwdVisible
?SvgPicture.asset(
width: 35,
height: 35,
"assets/svg/password_visible.svg",
)
: SvgPicture.asset(
width: 35,
height: 35,
"assets/svg/password_invisible.svg",
),
onPressed: () {
provider.pwdVisibility();
},
),
onChanged: provider.onChangePassword
),
SizedBox(height: 10),
Container(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
padding: EdgeInsets.symmetric(horizontal: 10), padding: EdgeInsets.symmetric(horizontal: 10),
child: Text("Confirm Password",style: TextStyle( child: Text("New Password",style: TextStyle(
color: AppColors.semi_black color: AppColors.semi_black
),)), ),)),
SizedBox(height: 5), SizedBox(height: 5),
_buildTextField( _buildTextField(
controller: provider.confPassword,
hintText: "Confirm New Password*", controller: provider.password,
errorText: provider.confirmPasswordError, hintText: "New Password*",
obscureText: !provider.confPwdVisible, errorText: provider.passwordError,
obscureText: !provider.pwdVisible,
suffixIcon: IconButton( suffixIcon: IconButton(
iconSize: 30, icon:
icon: provider.confPwdVisible?SvgPicture.asset( provider.pwdVisible
width: 35, ?SvgPicture.asset(
height: 35, width: 35,
"assets/svg/password_visible.svg", height: 35,
) "assets/svg/password_visible.svg",
: SvgPicture.asset( )
width: 35, : SvgPicture.asset(
height: 35, width: 35,
"assets/svg/password_invisible.svg", height: 35,
), "assets/svg/password_invisible.svg",
),
onPressed: () { onPressed: () {
provider.confPwdVisibility(); provider.pwdVisibility();
}, },
), ),
onChanged: provider.onChangeConfPassword onChanged: provider.onChangePassword
), ),
Spacer(), SizedBox(height: 10),
InkWell( Container(
onTap: () => provider.updatePassword(context), alignment: Alignment.topLeft,
child: Container( padding: EdgeInsets.symmetric(horizontal: 10),
alignment: Alignment.center, child: Text("Confirm Password",style: TextStyle(
height: 45, color: AppColors.semi_black
margin: EdgeInsets.symmetric(horizontal: 15), ),)),
decoration: BoxDecoration( SizedBox(height: 5),
color: AppColors.app_blue, _buildTextField(
borderRadius: BorderRadius.circular(15.0), controller: provider.confPassword,
), hintText: "Confirm New Password*",
child:provider.isLoading errorText: provider.confirmPasswordError,
? CircularProgressIndicator( obscureText: !provider.confPwdVisible,
color: Colors.white, suffixIcon: IconButton(
padding: EdgeInsets.all(7.5), iconSize: 30,
icon: provider.confPwdVisible?SvgPicture.asset(
width: 35,
height: 35,
"assets/svg/password_visible.svg",
) )
: Text( : SvgPicture.asset(
"Update", width: 35,
style: TextStyle(color: Colors.white), height: 35,
"assets/svg/password_invisible.svg",
),
onPressed: () {
provider.confPwdVisibility();
},
),
onChanged: provider.onChangeConfPassword
),
Spacer(),
InkWell(
onTap: () => provider.updatePassword(context),
child: Container(
alignment: Alignment.center,
height: 45,
margin: EdgeInsets.symmetric(horizontal: 15),
decoration: BoxDecoration(
color: AppColors.app_blue,
borderRadius: BorderRadius.circular(15.0),
),
child:provider.isLoading
? CircularProgressIndicator(
color: Colors.white,
padding: EdgeInsets.all(7.5),
)
: Text(
"Update",
style: TextStyle(color: Colors.white),
),
), ),
), ),
), SizedBox(height: 10),
SizedBox(height: 10), ],
], ),
), ),
), ],
], ),
), ),
), ),
), ],
], ),
), ),
), ),
), ),
......
...@@ -87,190 +87,192 @@ class _WebERPIOSState extends State<WebERPIOS> { ...@@ -87,190 +87,192 @@ class _WebERPIOSState extends State<WebERPIOS> {
}, },
child: Scaffold( child: Scaffold(
appBar: appbar(context, "Web ERP"), appBar: appbar(context, "Web ERP"),
body: Container( body: SafeArea(
child: Column( child: Container(
children: <Widget>[ child: Column(
Expanded( children: <Widget>[
child: Stack( Expanded(
children: [ child: Stack(
InAppWebView( children: [
initialUrlRequest: URLRequest( InAppWebView(
url: WebUri(widget.url.toString()), initialUrlRequest: URLRequest(
), url: WebUri(widget.url.toString()),
androidOnGeolocationPermissionsShowPrompt: ( ),
InAppWebViewController controller, androidOnGeolocationPermissionsShowPrompt: (
String origin, InAppWebViewController controller,
) async { String origin,
return GeolocationPermissionShowPromptResponse( ) async {
origin: origin, return GeolocationPermissionShowPromptResponse(
allow: true, origin: origin,
retain: true, allow: true,
); retain: true,
}, );
initialOptions: InAppWebViewGroupOptions( },
android: AndroidInAppWebViewOptions( initialOptions: InAppWebViewGroupOptions(
useWideViewPort: true, android: AndroidInAppWebViewOptions(
loadWithOverviewMode: true, useWideViewPort: true,
loadWithOverviewMode: true,
allowContentAccess: true,
geolocationEnabled: true,
allowFileAccess: true,
databaseEnabled: true, // Enables the WebView database
domStorageEnabled: true, // Enables DOM storage
builtInZoomControls:
true, // Enables the built-in zoom controls
displayZoomControls:
false, // Disables displaying zoom controls
safeBrowsingEnabled: true, // Enables Safe Browsing
),
ios: IOSInAppWebViewOptions(
allowsInlineMediaPlayback: true,
allowsLinkPreview: true,
allowsBackForwardNavigationGestures: true,
),
),
androidOnPermissionRequest: (
InAppWebViewController controller,
String origin,
List<String> resources,
) async {
return PermissionRequestResponse(
resources: resources,
action: PermissionRequestResponseAction.GRANT,
);
},
initialSettings: InAppWebViewSettings(
javaScriptEnabled: true,
allowFileAccess: true,
allowContentAccess: true, allowContentAccess: true,
clearCache: true,
blockNetworkLoads: false,
networkAvailable: true,
useOnLoadResource: true,
thirdPartyCookiesEnabled: true,
supportZoom: false,
geolocationEnabled: true, geolocationEnabled: true,
allowFileAccess: true, safeBrowsingEnabled: false,
databaseEnabled: true, // Enables the WebView database saveFormData: true,
domStorageEnabled: true, // Enables DOM storage allowFileAccessFromFileURLs: true,
builtInZoomControls: useWideViewPort: true,
true, // Enables the built-in zoom controls databaseEnabled: true,
displayZoomControls: domStorageEnabled: true,
false, // Disables displaying zoom controls
safeBrowsingEnabled: true, // Enables Safe Browsing
),
ios: IOSInAppWebViewOptions(
allowsInlineMediaPlayback: true,
allowsLinkPreview: true,
allowsBackForwardNavigationGestures: true, allowsBackForwardNavigationGestures: true,
allowUniversalAccessFromFileURLs: true,
allowsLinkPreview: true,
), ),
), onPermissionRequest: (controller, request) async {
return PermissionResponse(
androidOnPermissionRequest: ( resources: request.resources,
InAppWebViewController controller, action: PermissionResponseAction.GRANT,
String origin, );
List<String> resources, },
) async { keepAlive: InAppWebViewKeepAlive(),
return PermissionRequestResponse( // initialData:
resources: resources, // InAppWebViewInitialData(baseUrl: WebUri(widget.url),data: ),
action: PermissionRequestResponseAction.GRANT, onWebViewCreated: (controller) {
); webViewController = controller;
}, _controller.complete(controller);
initialSettings: InAppWebViewSettings( },
javaScriptEnabled: true, pullToRefreshController: pullToRefreshController,
allowFileAccess: true, shouldOverrideUrlLoading: (
allowContentAccess: true, controller,
clearCache: true, navigationAction,
blockNetworkLoads: false, ) async {
networkAvailable: true, var uri = navigationAction.request.url!;
useOnLoadResource: true, print("urib scgefes");
thirdPartyCookiesEnabled: true, print(uri);
supportZoom: false, print(uri.scheme);
geolocationEnabled: true, if (uri.scheme == "tel") {
safeBrowsingEnabled: false, // Launch the phone dialer app with the specified phone number
saveFormData: true, if (await canLaunch(uri.toString())) {
allowFileAccessFromFileURLs: true, await launch(uri.toString());
useWideViewPort: true, return NavigationActionPolicy.CANCEL;
databaseEnabled: true, }
domStorageEnabled: true, } else if (uri.scheme == "mailto") {
allowsBackForwardNavigationGestures: true, if (await canLaunch(uri.toString())) {
allowUniversalAccessFromFileURLs: true, await launch(uri.toString());
allowsLinkPreview: true, return NavigationActionPolicy.CANCEL;
), }
onPermissionRequest: (controller, request) async { } else if (uri.scheme == "whatsapp") {
return PermissionResponse( // Launch WhatsApp with the specified chat or phone number
resources: request.resources, if (await canLaunch(uri.toString())) {
action: PermissionResponseAction.GRANT, await launch(uri.toString());
); return NavigationActionPolicy.CANCEL;
}, }
keepAlive: InAppWebViewKeepAlive(),
// initialData:
// InAppWebViewInitialData(baseUrl: WebUri(widget.url),data: ),
onWebViewCreated: (controller) {
webViewController = controller;
_controller.complete(controller);
},
pullToRefreshController: pullToRefreshController,
shouldOverrideUrlLoading: (
controller,
navigationAction,
) async {
var uri = navigationAction.request.url!;
print("urib scgefes");
print(uri);
print(uri.scheme);
if (uri.scheme == "tel") {
// Launch the phone dialer app with the specified phone number
if (await canLaunch(uri.toString())) {
await launch(uri.toString());
return NavigationActionPolicy.CANCEL;
}
} else if (uri.scheme == "mailto") {
if (await canLaunch(uri.toString())) {
await launch(uri.toString());
return NavigationActionPolicy.CANCEL;
}
} else if (uri.scheme == "whatsapp") {
// Launch WhatsApp with the specified chat or phone number
if (await canLaunch(uri.toString())) {
await launch(uri.toString());
return NavigationActionPolicy.CANCEL;
} }
} // // Check if the URL is trying to access the camera for image upload
// // Check if the URL is trying to access the camera for image upload // if (uri.scheme == 'camera' && uri.path.contains('/camera/')) {
// if (uri.scheme == 'camera' && uri.path.contains('/camera/')) { // // Handle camera image upload here
// // Handle camera image upload here // // You might want to display a custom UI for image selection or directly trigger the camera
// // You might want to display a custom UI for image selection or directly trigger the camera // // You can use platform-specific plugins like image_picker for this purpose
// // You can use platform-specific plugins like image_picker for this purpose // // Once the image is selected, you can pass it to the web view using JavaScript injection
// // Once the image is selected, you can pass it to the web view using JavaScript injection // if (await canLaunch(uri.toString())) {
// if (await canLaunch(uri.toString())) { // await launch(uri.toString());
// await launch(uri.toString()); // return NavigationActionPolicy.CANCEL;
// return NavigationActionPolicy.CANCEL; // }
// } // }
// } return NavigationActionPolicy.ALLOW;
return NavigationActionPolicy.ALLOW; },
},
onLoadStart: (controller, url) {
onLoadStart: (controller, url) { return setState(() {
return setState(() { isLoading = true;
isLoading = true; });
}); },
}, onLoadStop: (controller, url) {
onLoadStop: (controller, url) {
pullToRefreshController?.endRefreshing();
return setState(() {
isLoading = false;
});
},
onReceivedError: (controller, request, error) {
pullToRefreshController?.endRefreshing();
},
onProgressChanged: (controller, progress) {
if (progress == 100) {
pullToRefreshController?.endRefreshing(); pullToRefreshController?.endRefreshing();
} return setState(() {
}, isLoading = false;
), });
if (isLoading) ...[ },
Container( onReceivedError: (controller, request, error) {
color: Colors.white.withOpacity(0.7), pullToRefreshController?.endRefreshing();
child: Column( },
crossAxisAlignment: CrossAxisAlignment.center, onProgressChanged: (controller, progress) {
mainAxisAlignment: MainAxisAlignment.center, if (progress == 100) {
children: [ pullToRefreshController?.endRefreshing();
SpinKitRing( }
color: AppColors.app_blue, },
lineWidth: 4, ),
// duration: Duration(seconds: 2), if (isLoading) ...[
size: 50, Container(
), color: Colors.white.withOpacity(0.7),
const SizedBox(height: 15), child: Column(
SizedBox( crossAxisAlignment: CrossAxisAlignment.center,
width: 200, mainAxisAlignment: MainAxisAlignment.center,
child: Text( children: [
"Please wait.......", SpinKitRing(
textAlign: TextAlign.center, color: AppColors.app_blue,
style: TextStyle( lineWidth: 4,
decorationThickness: 0, // duration: Duration(seconds: 2),
fontSize: 15, size: 50,
fontWeight: FontWeight.normal, ),
color: AppColors.app_blue, const SizedBox(height: 15),
SizedBox(
width: 200,
child: Text(
"Please wait.......",
textAlign: TextAlign.center,
style: TextStyle(
decorationThickness: 0,
fontSize: 15,
fontWeight: FontWeight.normal,
color: AppColors.app_blue,
),
), ),
), ),
),
// SvgPicture.asset("/assets/images/NutsLoader.gif")
// SvgPicture.asset("/assets/images/NutsLoader.gif") ],
], ),
), ),
), ],
], ],
], ),
), ),
), ],
], ),
), ),
), ),
), ),
......
This diff is collapsed.
...@@ -80,109 +80,111 @@ class _WebWhizzdomScreenState extends State<WebWhizzdomScreen> { ...@@ -80,109 +80,111 @@ class _WebWhizzdomScreenState extends State<WebWhizzdomScreen> {
child: Scaffold( child: Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
appBar: appbar(context, "Whizzdom"), appBar: appbar(context, "Whizzdom"),
body: Container( body: SafeArea(
child: Column(children: <Widget>[ child: Container(
Expanded( child: Column(children: <Widget>[
child: Stack( Expanded(
children: [ child: Stack(
InAppWebView( children: [
initialUrlRequest: URLRequest( InAppWebView(
url: WebUri(widget.whizzdom_url), initialUrlRequest: URLRequest(
), url: WebUri(widget.whizzdom_url),
androidOnGeolocationPermissionsShowPrompt:
(InAppWebViewController controller, String origin) async {
return GeolocationPermissionShowPromptResponse(
origin: origin, allow: true, retain: true);
},
initialOptions: InAppWebViewGroupOptions(
android: AndroidInAppWebViewOptions(
useWideViewPort: true,
loadWithOverviewMode: true,
allowContentAccess: true,
geolocationEnabled: true,
allowFileAccess: true,
databaseEnabled: true, // Enables the WebView database
domStorageEnabled: true, // Enables DOM storage
builtInZoomControls:
true, // Enables the built-in zoom controls
displayZoomControls:
false, // Disables displaying zoom controls
safeBrowsingEnabled: true, // Enables Safe Browsing
clearSessionCache: true,
),
ios: IOSInAppWebViewOptions(
allowsInlineMediaPlayback: true,
), ),
), androidOnGeolocationPermissionsShowPrompt:
(InAppWebViewController controller, String origin) async {
return GeolocationPermissionShowPromptResponse(
androidOnPermissionRequest: (InAppWebViewController controller, origin: origin, allow: true, retain: true);
String origin, List<String> resources) async { },
return PermissionRequestResponse( initialOptions: InAppWebViewGroupOptions(
resources: resources, android: AndroidInAppWebViewOptions(
action: PermissionRequestResponseAction.GRANT); useWideViewPort: true,
}, loadWithOverviewMode: true,
onWebViewCreated: (controller) { allowContentAccess: true,
webViewController = controller; geolocationEnabled: true,
_controller.complete(controller); allowFileAccess: true,
}, databaseEnabled: true, // Enables the WebView database
pullToRefreshController: pullToRefreshController, domStorageEnabled: true, // Enables DOM storage
onLoadStart: (controller, url) { builtInZoomControls:
return setState(() { true, // Enables the built-in zoom controls
isLoading = true; displayZoomControls:
}); false, // Disables displaying zoom controls
}, safeBrowsingEnabled: true, // Enables Safe Browsing
onLoadStop: (controller, url) { clearSessionCache: true,
pullToRefreshController?.endRefreshing();
return setState(() {
isLoading = false;
});
},
onReceivedError: (controller, request, error) {
pullToRefreshController?.endRefreshing();
},
onProgressChanged: (controller, progress) {
if (progress == 100) {
pullToRefreshController?.endRefreshing();
}
},
),
if (isLoading) ...[Container(
color: Colors.white.withOpacity(0.7),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
SpinKitRing(
color: AppColors.app_blue,
lineWidth: 4,
// duration: Duration(seconds: 2),
size: 50,
), ),
const SizedBox( ios: IOSInAppWebViewOptions(
height: 15, allowsInlineMediaPlayback: true,
),
SizedBox(
width: 200,
child: Text(
"Please wait.......",
textAlign: TextAlign.center,
style: TextStyle(
decorationThickness: 0,
fontSize: 15,
fontWeight: FontWeight.normal,
color: AppColors.app_blue),
),
), ),
),
// SvgPicture.asset("/assets/images/NutsLoader.gif")
],
androidOnPermissionRequest: (InAppWebViewController controller,
String origin, List<String> resources) async {
return PermissionRequestResponse(
resources: resources,
action: PermissionRequestResponseAction.GRANT);
},
onWebViewCreated: (controller) {
webViewController = controller;
_controller.complete(controller);
},
pullToRefreshController: pullToRefreshController,
onLoadStart: (controller, url) {
return setState(() {
isLoading = true;
});
},
onLoadStop: (controller, url) {
pullToRefreshController?.endRefreshing();
return setState(() {
isLoading = false;
});
},
onReceivedError: (controller, request, error) {
pullToRefreshController?.endRefreshing();
},
onProgressChanged: (controller, progress) {
if (progress == 100) {
pullToRefreshController?.endRefreshing();
}
},
), ),
)] if (isLoading) ...[Container(
], color: Colors.white.withOpacity(0.7),
)) child: Column(
])), crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
SpinKitRing(
color: AppColors.app_blue,
lineWidth: 4,
// duration: Duration(seconds: 2),
size: 50,
),
const SizedBox(
height: 15,
),
SizedBox(
width: 200,
child: Text(
"Please wait.......",
textAlign: TextAlign.center,
style: TextStyle(
decorationThickness: 0,
fontSize: 15,
fontWeight: FontWeight.normal,
color: AppColors.app_blue),
),
),
// SvgPicture.asset("/assets/images/NutsLoader.gif")
],
),
)]
],
))
])),
),
), ),
); );
} }
......
...@@ -94,11 +94,11 @@ class _AccountledgerState extends State<Accountledger> { ...@@ -94,11 +94,11 @@ class _AccountledgerState extends State<Accountledger> {
), ),
), ),
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
body: provider.isLoading body: SafeArea(child: provider.isLoading
? Center(child: CircularProgressIndicator.adaptive( ? Center(child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>( valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue) AppColors.app_blue)
)):Container( )):SizedBox(
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
...@@ -427,7 +427,7 @@ class _AccountledgerState extends State<Accountledger> { ...@@ -427,7 +427,7 @@ class _AccountledgerState extends State<Accountledger> {
], ],
), ),
), ),
), )),
), ),
onWillPop: () { onWillPop: () {
return _onBackPressed(context); return _onBackPressed(context);
......
...@@ -53,7 +53,7 @@ class _AccountslistState extends State<Accountslist> { ...@@ -53,7 +53,7 @@ class _AccountslistState extends State<Accountslist> {
), ),
),), ),),
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
body:accountList.isNotEmpty? Container( body:SafeArea(child: accountList.isNotEmpty? SizedBox(
child: SingleChildScrollView( child: SingleChildScrollView(
controller: scrollController, controller: scrollController,
child: Column( child: Column(
...@@ -117,7 +117,7 @@ class _AccountslistState extends State<Accountslist> { ...@@ -117,7 +117,7 @@ class _AccountslistState extends State<Accountslist> {
child: SizedBox( child: SizedBox(
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
Text( Text(
accountList[index].name!, accountList[index].name!,
...@@ -161,7 +161,7 @@ class _AccountslistState extends State<Accountslist> { ...@@ -161,7 +161,7 @@ class _AccountslistState extends State<Accountslist> {
padding: EdgeInsets.symmetric(vertical: 5), padding: EdgeInsets.symmetric(vertical: 5),
child: Row( child: Row(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
...@@ -196,8 +196,8 @@ class _AccountslistState extends State<Accountslist> { ...@@ -196,8 +196,8 @@ class _AccountslistState extends State<Accountslist> {
MaterialPageRoute( MaterialPageRoute(
builder: builder:
(context) => Accountslistdetails( (context) => Accountslistdetails(
accountID: accountList[index].id, accountID: accountList[index].id,
), ),
), ),
); );
}, },
...@@ -205,7 +205,7 @@ class _AccountslistState extends State<Accountslist> { ...@@ -205,7 +205,7 @@ class _AccountslistState extends State<Accountslist> {
padding: EdgeInsets.symmetric(vertical: 5), padding: EdgeInsets.symmetric(vertical: 5),
child: Row( child: Row(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.center, CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Text( Text(
...@@ -232,7 +232,7 @@ class _AccountslistState extends State<Accountslist> { ...@@ -232,7 +232,7 @@ class _AccountslistState extends State<Accountslist> {
], ],
), ),
), ),
):Emptywidget(context), ):Emptywidget(context),)
), ),
onWillPop: () { onWillPop: () {
provider.pageNum = 1; provider.pageNum = 1;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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