"lib/Notifiers/git@183.82.99.133:saisrinivas/gen_erp_2025.git" did not exist on "39774c76bc1d94a3a4574b3e3f3e3575460f88f0"
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 {
_paymentDetails =
data.paymentDetails ??
PaymentDetails(
accountId: "",
accountName: "",
amount: "",
attachmentDirFilePath: "",
attachmentViewFileName: "",
bankAccountHolderName: "",
bankAccountNumber: "",
bankBranchName: "",
bankIfscCode: "",
bankName: "",
bankUpiId: "",
createdDatetime: "",
createdEmployeeId: "",
description: "",
id: "",
isExists: "",
mode: "",
paymentAccountId: "",
paymentAccountName: "",
paymentDate: "",
paymentEmployeeName: "",
paymentModeId: "",
paymentReferenceNumber: "",
paymentRemarks: "",
refId: "",
refType: "",
updatedDatetime: "",
accountId: "-",
accountName: "-",
amount: "-",
attachmentDirFilePath: "-",
attachmentViewFileName: "-",
bankAccountHolderName: "-",
bankAccountNumber: "-",
bankBranchName: "-",
bankIfscCode: "-",
bankName: "-",
bankUpiId: "-",
createdDatetime: "-",
createdEmployeeId: "-",
description: "-",
id: "-",
isExists: "-",
mode: "-",
paymentAccountId: "-",
paymentAccountName: "-",
paymentDate: "-",
paymentEmployeeName: "-",
paymentModeId: "-",
paymentReferenceNumber: "-",
paymentRemarks: "-",
refId: "-",
refType: "-",
updatedDatetime: "-",
);
_requestDetails =
data.requestDetails ??
RequestDetails(
updatedDatetime: "",
id: "",
description: "",
createdDatetime: "",
attachmentViewFileName: "",
attachmentDirFilePath: "",
amount: "",
accountName: "",
accountId: "",
branch: "",
createdEmployee: "",
date: "",
isProcessedPaymentRequest: "",
level1ApprovalRemarks: "",
level1Employee: "",
level2ApprovalRemarks: "",
level2Employee: "",
proposedAccount: "",
proposedAccountId: "",
requestedAmount: "",
requestingPurpose: "",
requestMode: "",
status: "",
transDis: "",
updatedDatetime: "-",
id: "-",
description: "-",
createdDatetime: "-",
attachmentViewFileName: "-",
attachmentDirFilePath: "-",
amount: "-",
accountName: "-",
accountId: "-",
branch: "-",
createdEmployee: "-",
date: "-",
isProcessedPaymentRequest: "-",
level1ApprovalRemarks: "-",
level1Employee: "-",
level2ApprovalRemarks: "-",
level2Employee: "-",
proposedAccount: "-",
proposedAccountId: "-",
requestedAmount: "-",
requestingPurpose: "-",
requestMode: "-",
status: "-",
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");
preValues();
notifyListeners();
......
......@@ -359,17 +359,8 @@ class Requestionlistprovider extends ChangeNotifier {
_paymentModes = data.paymentModes!;
_requestingPurposes = data.requestingPurposes!;
if (_selectedAccounts != null &&
!_accounts.contains(_selectedAccounts)) {
_selectedAccounts = null;
_accountId = "";
}
if (_selectedPayment != null &&
!_paymentModes.contains(_selectedPayment)) {
_selectedPayment = null;
_paymentModeId = "";
}
checkDropdownselected();
notifyListeners();
} else {}
}
} catch (e, s) {}
......@@ -434,26 +425,8 @@ class Requestionlistprovider extends ChangeNotifier {
_directPaymentAccounts = data.paymentAccounts!;
_directPaymentModes = data.paymentModes!;
_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();
} else {}
}
......@@ -890,9 +863,48 @@ class Requestionlistprovider extends ChangeNotifier {
UPIError = null;
FileError = null;
buttonEnabled = false;
checkDropdownselected();
checkdirectPaymentDropDownsSlected();
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) {
// Reset all errors
......
......@@ -441,28 +441,8 @@ class Paymentreceiptsprovider extends ChangeNotifier {
_receiptPaymentAccounts = data.receiptAccounts!;
_receiptPaymentModes = data.paymentModes!;
_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();
} else {}
}
......@@ -751,9 +731,32 @@ class Paymentreceiptsprovider extends ChangeNotifier {
FileError = null;
buttonEnabled = false;
dateError = null;
checkDropDownSelected();
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) {
selectAccountError = null;
......
......@@ -58,7 +58,18 @@ class Paymentrequisitionpaymentslistprovider extends ChangeNotifier{
final data = await ApiCalling.paymentRequisitionPaymentDetailsAPI(prov.empId, prov.session,paymentId);
if(data!=null){
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 = [
"From Account",
"Payment Mode",
......
......@@ -6,6 +6,7 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:flutter_ringtone_player/flutter_ringtone_player.dart';
import 'package:generp/Utils/app_colors.dart';
import 'screens/notifierExports.dart';
import 'package:generp/Utils/SharedpreferencesService.dart';
import 'package:generp/screens/splash.dart';
......@@ -262,6 +263,13 @@ class MyApp extends StatelessWidget {
colorScheme: const ColorScheme.light(
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(),
);
......
This diff is collapsed.
......@@ -39,190 +39,192 @@ class _CheckInOutScreenState extends State<CheckInOutScreen> {
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar(context, widget.getAttendanceStatus==0? "Check In":"Check Out"),
body:Container(
child: SafeArea(
child: Column(
children: [
Expanded(
child: Stack(
children: [
GoogleMap(
myLocationEnabled: true,
zoomGesturesEnabled: true,
scrollGesturesEnabled: false,
initialCameraPosition: CameraPosition(
target: provider.currentLocationLatLng ??
provider.startLocation,
zoom: 20.0,
body:SafeArea(
child: Container(
child: SafeArea(
child: Column(
children: [
Expanded(
child: Stack(
children: [
GoogleMap(
myLocationEnabled: true,
zoomGesturesEnabled: true,
scrollGesturesEnabled: false,
initialCameraPosition: CameraPosition(
target: provider.currentLocationLatLng ??
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(),
myLocationButtonEnabled: true,
mapType: MapType.normal,
onMapCreated: (controller) {
provider.mapController = controller;
provider.getCurrentLocation();
provider.getLocationPermission(context);
},
onCameraMove: (position) {
provider.onCameraMove(position,context);
},
),
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),
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(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
SizedBox(height: 25),
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 20.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Share Your Details",
style: TextStyle(
color: AppColors.app_blue,
fontFamily: "JakartaSemiBold"
),
),
SizedBox(height: 10,),
Text(
"Location",
style: TextStyle(
fontFamily: "JakartaMedium",
color: AppColors.semi_black,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
SizedBox(height: 25),
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 20.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Share Your Details",
style: TextStyle(
color: AppColors.app_blue,
fontFamily: "JakartaSemiBold"
),
),
),
],
),
),
SizedBox(height: 5),
Padding(
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)
SizedBox(height: 10,),
Text(
"Location",
style: TextStyle(
fontFamily: "JakartaMedium",
color: AppColors.semi_black,
),
enabledBorder:
InputBorder.none,
focusedBorder:
InputBorder.none,
),
),
],
),
),
),
if (provider.validateLocation != null)
SizedBox(height: 5),
Padding(
padding:
const EdgeInsets.symmetric(
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,
height: 50,
alignment: Alignment.center,
decoration: BoxDecoration(
color: AppColors.app_blue,
color: AppColors.text_field_color,
borderRadius:
BorderRadius.circular(15.0),
BorderRadius.circular(14),
),
child: Text(
widget.getAttendanceStatus==0? "Check In":"Check Out",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 16,
color: Colors.white
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,
),
),
),
),
),
),
],
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> {
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar(context, "QR Login"),
body: Container(
decoration: BoxDecoration(color: Colors.black),
child: Column(
children: [
Spacer(),
Container(
height: 250,
child: QRView(
key: provider.scannerKey,
onQRViewCreated: (p0) {
provider.onQRViewCreated(p0, context);
},
formatsAllowed: [BarcodeFormat.qrcode],
cameraFacing: CameraFacing.back,
overlay: QrScannerOverlayShape(
borderColor: AppColors.app_blue,
borderRadius: 20,
borderLength: 60,
borderWidth: 10,
cutOutSize: 250.0,
body: SafeArea(
child: Container(
decoration: BoxDecoration(color: Colors.black),
child: Column(
children: [
Spacer(),
Container(
height: 250,
child: QRView(
key: provider.scannerKey,
onQRViewCreated: (p0) {
provider.onQRViewCreated(p0, context);
},
formatsAllowed: [BarcodeFormat.qrcode],
cameraFacing: CameraFacing.back,
overlay: QrScannerOverlayShape(
borderColor: AppColors.app_blue,
borderRadius: 20,
borderLength: 60,
borderWidth: 10,
cutOutSize: 250.0,
),
),
),
),
SizedBox(height: 25),
Text(
"Scan QR",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 18, color: Colors.white),
),
Text(
"to Login",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 14, color: Colors.white),
),
Spacer(),
SizedBox(height: 50),
],
SizedBox(height: 25),
Text(
"Scan QR",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 18, color: Colors.white),
),
Text(
"to Login",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 14, color: Colors.white),
),
Spacer(),
SizedBox(height: 50),
],
),
),
),
),
......
......@@ -19,124 +19,126 @@ class UpdatePassword extends StatelessWidget {
resizeToAvoidBottomInset: true,
appBar: appbar(context, "Update Password"),
backgroundColor: AppColors.scaffold_bg_color,
body: Container(
child: Column(
children: [
Expanded(
child: Container(
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.vertical(
top: Radius.circular(30.0),
body: SafeArea(
child: Container(
child: Column(
children: [
Expanded(
child: Container(
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.vertical(
top: Radius.circular(30.0),
),
),
),
padding: EdgeInsets.all(10),
child: Column(
children: [
Container(
height: 280,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20.0),
),
child: Column(
children: [
SizedBox(height: 10),
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(
padding: EdgeInsets.all(10),
child: Column(
children: [
Container(
height: 280,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20.0),
),
child: Column(
children: [
SizedBox(height: 10),
Container(
alignment: Alignment.topLeft,
padding: EdgeInsets.symmetric(horizontal: 10),
child: Text("Confirm Password",style: TextStyle(
padding: EdgeInsets.symmetric(horizontal: 10),
child: Text("New Password",style: TextStyle(
color: AppColors.semi_black
),)),
SizedBox(height: 5),
_buildTextField(
controller: provider.confPassword,
hintText: "Confirm New Password*",
errorText: provider.confirmPasswordError,
obscureText: !provider.confPwdVisible,
),)),
SizedBox(height: 5),
_buildTextField(
controller: provider.password,
hintText: "New Password*",
errorText: provider.passwordError,
obscureText: !provider.pwdVisible,
suffixIcon: IconButton(
iconSize: 30,
icon: provider.confPwdVisible?SvgPicture.asset(
width: 35,
height: 35,
"assets/svg/password_visible.svg",
)
: SvgPicture.asset(
width: 35,
height: 35,
"assets/svg/password_invisible.svg",
),
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.confPwdVisibility();
provider.pwdVisibility();
},
),
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),
onChanged: provider.onChangePassword
),
SizedBox(height: 10),
Container(
alignment: Alignment.topLeft,
padding: EdgeInsets.symmetric(horizontal: 10),
child: Text("Confirm Password",style: TextStyle(
color: AppColors.semi_black
),)),
SizedBox(height: 5),
_buildTextField(
controller: provider.confPassword,
hintText: "Confirm New Password*",
errorText: provider.confirmPasswordError,
obscureText: !provider.confPwdVisible,
suffixIcon: IconButton(
iconSize: 30,
icon: provider.confPwdVisible?SvgPicture.asset(
width: 35,
height: 35,
"assets/svg/password_visible.svg",
)
: Text(
"Update",
style: TextStyle(color: Colors.white),
: SvgPicture.asset(
width: 35,
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> {
},
child: Scaffold(
appBar: appbar(context, "Web ERP"),
body: Container(
child: Column(
children: <Widget>[
Expanded(
child: Stack(
children: [
InAppWebView(
initialUrlRequest: URLRequest(
url: WebUri(widget.url.toString()),
),
androidOnGeolocationPermissionsShowPrompt: (
InAppWebViewController controller,
String origin,
) async {
return GeolocationPermissionShowPromptResponse(
origin: origin,
allow: true,
retain: true,
);
},
initialOptions: InAppWebViewGroupOptions(
android: AndroidInAppWebViewOptions(
useWideViewPort: true,
loadWithOverviewMode: true,
body: SafeArea(
child: Container(
child: Column(
children: <Widget>[
Expanded(
child: Stack(
children: [
InAppWebView(
initialUrlRequest: URLRequest(
url: WebUri(widget.url.toString()),
),
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
),
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,
clearCache: true,
blockNetworkLoads: false,
networkAvailable: true,
useOnLoadResource: true,
thirdPartyCookiesEnabled: true,
supportZoom: false,
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,
safeBrowsingEnabled: false,
saveFormData: true,
allowFileAccessFromFileURLs: true,
useWideViewPort: true,
databaseEnabled: true,
domStorageEnabled: true,
allowsBackForwardNavigationGestures: true,
allowUniversalAccessFromFileURLs: true,
allowsLinkPreview: 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,
clearCache: true,
blockNetworkLoads: false,
networkAvailable: true,
useOnLoadResource: true,
thirdPartyCookiesEnabled: true,
supportZoom: false,
geolocationEnabled: true,
safeBrowsingEnabled: false,
saveFormData: true,
allowFileAccessFromFileURLs: true,
useWideViewPort: true,
databaseEnabled: true,
domStorageEnabled: true,
allowsBackForwardNavigationGestures: true,
allowUniversalAccessFromFileURLs: true,
allowsLinkPreview: true,
),
onPermissionRequest: (controller, request) async {
return PermissionResponse(
resources: request.resources,
action: PermissionResponseAction.GRANT,
);
},
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;
onPermissionRequest: (controller, request) async {
return PermissionResponse(
resources: request.resources,
action: PermissionResponseAction.GRANT,
);
},
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
// if (uri.scheme == 'camera' && uri.path.contains('/camera/')) {
// // Handle camera image upload here
// // 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
// // Once the image is selected, you can pass it to the web view using JavaScript injection
// if (await canLaunch(uri.toString())) {
// await launch(uri.toString());
// return NavigationActionPolicy.CANCEL;
// }
// }
return NavigationActionPolicy.ALLOW;
},
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) {
// // Check if the URL is trying to access the camera for image upload
// if (uri.scheme == 'camera' && uri.path.contains('/camera/')) {
// // Handle camera image upload here
// // 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
// // Once the image is selected, you can pass it to the web view using JavaScript injection
// if (await canLaunch(uri.toString())) {
// await launch(uri.toString());
// return NavigationActionPolicy.CANCEL;
// }
// }
return NavigationActionPolicy.ALLOW;
},
onLoadStart: (controller, url) {
return setState(() {
isLoading = true;
});
},
onLoadStop: (controller, url) {
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,
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")
],
// SvgPicture.asset("/assets/images/NutsLoader.gif")
],
),
),
),
],
],
],
),
),
),
],
],
),
),
),
),
......
This diff is collapsed.
......@@ -80,109 +80,111 @@ class _WebWhizzdomScreenState extends State<WebWhizzdomScreen> {
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar(context, "Whizzdom"),
body: Container(
child: Column(children: <Widget>[
Expanded(
child: Stack(
children: [
InAppWebView(
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,
body: SafeArea(
child: Container(
child: Column(children: <Widget>[
Expanded(
child: Stack(
children: [
InAppWebView(
initialUrlRequest: URLRequest(
url: WebUri(widget.whizzdom_url),
),
),
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,
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,
),
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),
),
ios: IOSInAppWebViewOptions(
allowsInlineMediaPlayback: true,
),
// 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> {
),
),
backgroundColor: AppColors.scaffold_bg_color,
body: provider.isLoading
body: SafeArea(child: provider.isLoading
? Center(child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue)
)):Container(
)):SizedBox(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
......@@ -427,7 +427,7 @@ class _AccountledgerState extends State<Accountledger> {
],
),
),
),
)),
),
onWillPop: () {
return _onBackPressed(context);
......
......@@ -53,7 +53,7 @@ class _AccountslistState extends State<Accountslist> {
),
),),
backgroundColor: AppColors.scaffold_bg_color,
body:accountList.isNotEmpty? Container(
body:SafeArea(child: accountList.isNotEmpty? SizedBox(
child: SingleChildScrollView(
controller: scrollController,
child: Column(
......@@ -117,7 +117,7 @@ class _AccountslistState extends State<Accountslist> {
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [
Text(
accountList[index].name!,
......@@ -161,7 +161,7 @@ class _AccountslistState extends State<Accountslist> {
padding: EdgeInsets.symmetric(vertical: 5),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
......@@ -196,8 +196,8 @@ class _AccountslistState extends State<Accountslist> {
MaterialPageRoute(
builder:
(context) => Accountslistdetails(
accountID: accountList[index].id,
),
accountID: accountList[index].id,
),
),
);
},
......@@ -205,7 +205,7 @@ class _AccountslistState extends State<Accountslist> {
padding: EdgeInsets.symmetric(vertical: 5),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
......@@ -232,7 +232,7 @@ class _AccountslistState extends State<Accountslist> {
],
),
),
):Emptywidget(context),
):Emptywidget(context),)
),
onWillPop: () {
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