improvements

faiz_marathon_signalR_critical
Sikander Saleem 2 years ago
parent ea2a9c541c
commit a45b6aece2

@ -1,3 +1,5 @@
import 'dart:io';
import 'package:easy_localization/easy_localization.dart';
import 'package:mohem_flutter_app/models/itg_forms_models/request_detail_model.dart';
import 'package:mohem_flutter_app/models/member_information_list_model.dart';
@ -30,17 +32,27 @@ class AppState {
String? get getForgetPasswordTokenID => forgetPasswordTokenID;
//Wifi info
String? mohemmWifiSSID;
String? _mohemmWifiSSID;
set setMohemmWifiSSID(v) => _mohemmWifiSSID = v;
set setMohemmWifiSSID(v) => mohemmWifiSSID = mohemmWifiSSID;
String? get getMohemmWifiSSID => _mohemmWifiSSID;
String? get getMohemmWifiSSID => mohemmWifiSSID;
String? _mohemmWifiPassword;
String? mohemmWifiPassword;
set setMohemmWifiPassword(v) => _mohemmWifiPassword = v;
set setMohemmWifiPassword(v) => mohemmWifiPassword = v;
String? get getMohemmWifiPassword => _mohemmWifiPassword;
String? get getMohemmWifiPassword => mohemmWifiPassword;
final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 31, versionID: 5.0, mobileType: Platform.isAndroid ? "android" : "ios");
void setPostParamsInitConfig() {
isAuthenticated = false;
isLogged = false;
_memberLoginList = null;
_memberInformationList = null;
_postParams = _postParamsInitConfig;
}
PostParamsModel? _postParams;

@ -129,9 +129,10 @@ class Utils {
static Widget getNoDataWidget(BuildContext context) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SvgPicture.asset('assets/images/not_found.svg', width: 110.0, height: 110.0),
Container(margin: const EdgeInsets.only(top: 15.0), child: LocaleKeys.noDataAvailable.tr().toText16().center),
LocaleKeys.noDataAvailable.tr().toText16().paddingOnly(top: 15),
],
).center;
}

@ -6,7 +6,6 @@ import 'package:logger/logger.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/generated/codegen_loader.g.dart';
import 'package:mohem_flutter_app/models/post_params_model.dart';
import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart';
import 'package:mohem_flutter_app/provider/eit_provider_model.dart';
import 'package:mohem_flutter_app/theme/app_theme.dart';
@ -30,9 +29,7 @@ class MyHttpOverrides extends HttpOverrides {
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await EasyLocalization.ensureInitialized();
AppState().setPostParamsModel(
PostParamsModel(channel: 31, versionID: 5.0, mobileType: Platform.isAndroid ? "android" : "ios"),
);
AppState().setPostParamsInitConfig();
HttpOverrides.global = MyHttpOverrides();
runApp(
EasyLocalization(

@ -88,86 +88,86 @@ class MemberInformationListModel {
MemberInformationListModel(
{this.aCTUALTERMINATIONDATE,
this.aSSIGNMENTENDDATE,
this.aSSIGNMENTID,
this.aSSIGNMENTNUMBER,
this.aSSIGNMENTSTARTDATE,
this.aSSIGNMENTSTATUSTYPEID,
this.aSSIGNMENTTYPE,
this.bUSINESSGROUPID,
this.bUSINESSGROUPNAME,
this.businessCardQR,
this.cURRENTEMPLOYEEFLAG,
this.eMPLOYEEDISPLAYNAME,
this.eMPLOYEEDISPLAYNAMEAr,
this.eMPLOYEEDISPLAYNAMEEn,
this.eMPLOYEEEMAILADDRESS,
this.eMPLOYEEIMAGE,
this.eMPLOYEEMOBILENUMBER,
this.eMPLOYEENAME,
this.eMPLOYEENAMEAr,
this.eMPLOYEENAMEEn,
this.eMPLOYEENUMBER,
this.eMPLOYEEWORKNUMBER,
this.eMPLOYMENTCATEGORY,
this.eMPLOYMENTCATEGORYMEANING,
this.employeeQR,
this.fREQUENCY,
this.fREQUENCYMEANING,
this.fROMROWNUM,
this.gRADEID,
this.gRADENAME,
this.hIREDATE,
this.jOBID,
this.jOBNAME,
this.jOBNAMEAr,
this.jOBNAMEEn,
this.lEDGERID,
this.lOCATIONID,
this.lOCATIONNAME,
this.mANUALTIMECARDFLAG,
this.mANUALTIMECARDMEANING,
this.mobileNumberWithZipCode,
this.nATIONALITYCODE,
this.nATIONALITYMEANING,
this.nATIONALIDENTIFIER,
this.nORMALHOURS,
this.nOOFROWS,
this.oRGANIZATIONID,
this.oRGANIZATIONNAME,
this.pAYROLLCODE,
this.pAYROLLID,
this.pAYROLLNAME,
this.pERSONID,
this.pERSONTYPE,
this.pERSONTYPEID,
this.pERINFORMATIONCATEGORY,
this.pOSITIONID,
this.pOSITIONNAME,
this.pRIMARYFLAG,
this.rOWNUM,
this.sERVICEDAYS,
this.sERVICEMONTHS,
this.sERVICEYEARS,
this.sUPERVISORASSIGNMENTID,
this.sUPERVISORDISPLAYNAME,
this.sUPERVISOREMAILADDRESS,
this.sUPERVISORID,
this.sUPERVISORMOBILENUMBER,
this.sUPERVISORNAME,
this.sUPERVISORNUMBER,
this.sUPERVISORWORKNUMBER,
this.sWIPESEXEMPTEDFLAG,
this.sWIPESEXEMPTEDMEANING,
this.sYSTEMPERSONTYPE,
this.tKEMAILADDRESS,
this.tKEMPLOYEEDISPLAYNAME,
this.tKEMPLOYEENAME,
this.tKEMPLOYEENUMBER,
this.tKPERSONID,
this.tOROWNUM,
this.uNITNUMBER,
this.uSERSTATUS});
this.aSSIGNMENTENDDATE,
this.aSSIGNMENTID,
this.aSSIGNMENTNUMBER,
this.aSSIGNMENTSTARTDATE,
this.aSSIGNMENTSTATUSTYPEID,
this.aSSIGNMENTTYPE,
this.bUSINESSGROUPID,
this.bUSINESSGROUPNAME,
this.businessCardQR,
this.cURRENTEMPLOYEEFLAG,
this.eMPLOYEEDISPLAYNAME,
this.eMPLOYEEDISPLAYNAMEAr,
this.eMPLOYEEDISPLAYNAMEEn,
this.eMPLOYEEEMAILADDRESS,
this.eMPLOYEEIMAGE,
this.eMPLOYEEMOBILENUMBER,
this.eMPLOYEENAME,
this.eMPLOYEENAMEAr,
this.eMPLOYEENAMEEn,
this.eMPLOYEENUMBER,
this.eMPLOYEEWORKNUMBER,
this.eMPLOYMENTCATEGORY,
this.eMPLOYMENTCATEGORYMEANING,
this.employeeQR,
this.fREQUENCY,
this.fREQUENCYMEANING,
this.fROMROWNUM,
this.gRADEID,
this.gRADENAME,
this.hIREDATE,
this.jOBID,
this.jOBNAME,
this.jOBNAMEAr,
this.jOBNAMEEn,
this.lEDGERID,
this.lOCATIONID,
this.lOCATIONNAME,
this.mANUALTIMECARDFLAG,
this.mANUALTIMECARDMEANING,
this.mobileNumberWithZipCode,
this.nATIONALITYCODE,
this.nATIONALITYMEANING,
this.nATIONALIDENTIFIER,
this.nORMALHOURS,
this.nOOFROWS,
this.oRGANIZATIONID,
this.oRGANIZATIONNAME,
this.pAYROLLCODE,
this.pAYROLLID,
this.pAYROLLNAME,
this.pERSONID,
this.pERSONTYPE,
this.pERSONTYPEID,
this.pERINFORMATIONCATEGORY,
this.pOSITIONID,
this.pOSITIONNAME,
this.pRIMARYFLAG,
this.rOWNUM,
this.sERVICEDAYS,
this.sERVICEMONTHS,
this.sERVICEYEARS,
this.sUPERVISORASSIGNMENTID,
this.sUPERVISORDISPLAYNAME,
this.sUPERVISOREMAILADDRESS,
this.sUPERVISORID,
this.sUPERVISORMOBILENUMBER,
this.sUPERVISORNAME,
this.sUPERVISORNUMBER,
this.sUPERVISORWORKNUMBER,
this.sWIPESEXEMPTEDFLAG,
this.sWIPESEXEMPTEDMEANING,
this.sYSTEMPERSONTYPE,
this.tKEMAILADDRESS,
this.tKEMPLOYEEDISPLAYNAME,
this.tKEMPLOYEENAME,
this.tKEMPLOYEENUMBER,
this.tKPERSONID,
this.tOROWNUM,
this.uNITNUMBER,
this.uSERSTATUS});
MemberInformationListModel.fromJson(Map<String, dynamic> json) {
aCTUALTERMINATIONDATE = json['ACTUAL_TERMINATION_DATE'];
@ -339,6 +339,19 @@ class MemberInformationListModel {
return data;
}
String getPositionName() {
String positionName = "";
List<String> list = pOSITIONNAME?.split(".") ?? [];
if (list.isNotEmpty) {
if (list.length > 1) {
positionName = list[0] + " " + list[1];
} else {
positionName = list.first;
}
}
return positionName;
}
static Future<List<MemberInformationListModel>> getFromPrefs() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
List encodedList = prefs.getStringList(SharedPrefsConsts.memberInformation) ?? [];
@ -350,4 +363,4 @@ class MemberInformationListModel {
List<String> encodedList = list.map((e) => jsonEncode(e.toJson())).toList();
await prefs.setStringList(SharedPrefsConsts.memberInformation, encodedList);
}
}
}

@ -56,17 +56,13 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
Future<bool> fetchAttendanceTracking(context) async {
try {
attendanceTracking = await DashboardApiClient().getAttendanceTracking();
print("attendanceTracking:" + (attendanceTracking!.pRemainingHours).toString());
isAttendanceTrackingLoading = false;
// isTimeRemainingInSeconds = calculateSeconds( "00:00:00");
if (attendanceTracking?.pSwipeIn != null) {
isTimeRemainingInSeconds = calculateSeconds(attendanceTracking!.pRemainingHours ?? "00:00:00");
int totalShiftTimeInSeconds = calculateSeconds(attendanceTracking!.pScheduledHours ?? "00:00:00");
print("totalShiftTimeInSeconds: " + totalShiftTimeInSeconds.toString());
print("isTimeRemainingInSeconds: " + isTimeRemainingInSeconds.toString());
progress = (isTimeRemainingInSeconds / totalShiftTimeInSeconds);
endTime = DateTime.now().millisecondsSinceEpoch + Duration(seconds: isTimeRemainingInSeconds).inMilliseconds;
print("endTime " + endTime.toString());
}
notifyListeners();
@ -161,11 +157,11 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
void fetchListMenu() async {
try {
List<ListMenu> menuList = await DashboardApiClient().getListMenu();
List findMyRequest = menuList.where((element) => element.menuName == "My Requests").toList();
List findMyRequest = menuList.where((element) => element.menuType == "E").toList();
if (findMyRequest.isNotEmpty) {
drawerMenuItemList.insert(3, DrawerMenuItem("assets/images/drawer/my_requests.svg", LocaleKeys.myRequest.tr(), AppRoutes.myRequests));
}
List findMyTeam = menuList.where((element) => element.menuName == "My Team").toList();
List findMyTeam = menuList.where((element) => element.menuType == "M").toList();
if (findMyTeam.isNotEmpty) {
drawerMenuItemList.insert(2, DrawerMenuItem("assets/images/drawer/my_team.svg", LocaleKeys.myTeamMembers.tr(), AppRoutes.myTeam));
}

@ -1,65 +1,67 @@
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
class BusinessCardDialog extends StatelessWidget {
@override
Widget build(BuildContext context) {
return RotatedBox(
quarterTurns: 1,
child: Container(
width: MediaQuery.of(context).size.height / 2,
color: Colors.white,
margin: EdgeInsets.all(20),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Image.asset(
"assets/images/logos/bn_cloud_soloution.jpg",
width: 80,
height: 80,
),
12.height,
(AppState().memberInformationList!.eMPLOYEENAME ?? "").toText20(),
],
child: AspectRatio(
aspectRatio: 3.5 / 2,
child: Container(
// width: MediaQuery.of(context).size.height / 2,
color: Colors.white,
margin: EdgeInsets.all(21),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Image.asset(
"assets/images/logos/bn_cloud_soloution.jpg",
width: 80,
height: 80,
),
12.height,
(AppState().memberInformationList!.eMPLOYEENAME ?? "").toText20(isBold: true),
],
),
),
Image.memory(
Utils.getPostBytes(AppState().memberInformationList!.businessCardQR ?? ""),
width: 100,
height: 100,
),
),
Image.memory(
Utils.getPostBytes(AppState().memberInformationList!.businessCardQR ?? ""),
width: 100,
height: 100,
),
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
1.height,
(AppState().memberInformationList!.pOSITIONNAME ?? "").toText12(isBold: false),
12.height,
(AppState().memberInformationList!.eMPLOYEENUMBER ?? "").toText12(isBold: false),
1.height,
(AppState().memberInformationList!.eMPLOYEEEMAILADDRESS ?? "").toText12(isBold: false),
1.height,
(AppState().memberInformationList!.jOBNAME ?? "").toText12(isBold: false),
],
),
],
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
1.height,
(AppState().memberInformationList!.getPositionName() ?? "").toText13(),
12.height,
(AppState().memberInformationList!.eMPLOYEENUMBER ?? "").toText13(),
1.height,
(AppState().memberInformationList!.eMPLOYEEEMAILADDRESS ?? "").toText13(),
1.height,
(AppState().memberInformationList!.jOBNAME ?? "").toText13(),
],
),
],
),
),
),
);

@ -5,6 +5,7 @@ import 'package:flutter_svg/flutter_svg.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
@ -15,6 +16,7 @@ import 'package:mohem_flutter_app/ui/dialogs/id/business_card_dialog.dart';
import 'package:mohem_flutter_app/ui/dialogs/id/employee_digital_id_dialog.dart';
import 'package:mohem_flutter_app/widgets/dialogs/dialogs.dart';
import 'package:provider/provider.dart';
import 'package:shared_preferences/shared_preferences.dart';
class AppDrawer extends StatefulWidget {
@override
@ -43,22 +45,23 @@ class _AppDrawerState extends State<AppDrawer> {
).paddingOnly(left: 4, right: 14),
Row(
children: [
AppState().memberInformationList!.eMPLOYEEIMAGE == null
? SvgPicture.asset(
"assets/images/user.svg",
height: 52,
width: 52,)
: CircleAvatar(
radius: 52 / 2,
backgroundImage: MemoryImage(Utils.getPostBytes(AppState().memberInformationList!.eMPLOYEEIMAGE)),
backgroundColor: Colors.black,
),
AppState().memberInformationList!.eMPLOYEEIMAGE == null
? SvgPicture.asset(
"assets/images/user.svg",
height: 52,
width: 52,
)
: CircleAvatar(
radius: 52 / 2,
backgroundImage: MemoryImage(Utils.getPostBytes(AppState().memberInformationList!.eMPLOYEEIMAGE)),
backgroundColor: Colors.black,
),
12.width,
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppState().memberInformationList!.eMPLOYEENAME!.toText18(isBold: true),
AppState().memberInformationList!.jOBNAME!.toText14(weight: FontWeight.w500),
AppState().memberInformationList!.getPositionName().toText14(weight: FontWeight.w500),
],
).expanded
],
@ -83,7 +86,7 @@ class _AppDrawerState extends State<AppDrawer> {
}),
menuItem("assets/images/drawer/employee_id.svg", LocaleKeys.employeeDigitalID.tr(), "", closeDrawer: false, onPress: () => showMDialog(context, child: EmployeeDigitialIdDialog())),
menuItem("assets/images/drawer/view_business_card.svg", LocaleKeys.viewBusinessCard.tr(), "", closeDrawer: false, onPress: () => showMDialog(context, child: BusinessCardDialog())),
menuItem("assets/images/drawer/logout.svg", LocaleKeys.logout.tr(), "", color: MyColors.redA3Color, closeDrawer: false, onPress: () {}),
menuItem("assets/images/drawer/logout.svg", LocaleKeys.logout.tr(), "", color: MyColors.redA3Color, closeDrawer: false, onPress: performLogout),
],
).expanded,
const Divider(
@ -128,7 +131,12 @@ class _AppDrawerState extends State<AppDrawer> {
: onPress!);
}
void drawerNavigator(context, routeName) {
Navigator.of(context).pushNamed(routeName);
void performLogout() async {
AppState().isAuthenticated = false;
AppState().isLogged = false;
AppState().setPostParamsInitConfig();
SharedPreferences prefs = await SharedPreferences.getInstance();
await prefs.clear();
Navigator.pushNamedAndRemoveUntil(context, AppRoutes.login, (Route<dynamic> route) => false, arguments: false);
}
}

@ -39,13 +39,7 @@ class ServicesWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
data.homeMenus![parentIndex].menuEntry.prompt!.toSectionHeading().expanded,
LocaleKeys.viewAllServices.tr().toText12(isUnderLine: true),
],
).paddingOnly(left: 21, right: 21),
data.homeMenus![parentIndex].menuEntry.prompt!.toSectionHeading().paddingOnly(left: 21, right: 21),
SizedBox(
height: 105 + 26,
child: ListView.separated(

@ -45,11 +45,12 @@ class _LoginScreenState extends State<LoginScreen> {
bool _autoLogin = false;
bool? isAppOpenBySystem;
@override
void initState() {
super.initState();
checkFirebaseToken();
//checkPrefs();
// checkFirebaseToken();
}
@override
@ -57,18 +58,6 @@ class _LoginScreenState extends State<LoginScreen> {
super.dispose();
}
Future<void> checkPrefs() async {
String username = await Utils.getStringFromPrefs(SharedPrefsConsts.username);
if (username.isNotEmpty) {
String password = await Utils.getStringFromPrefs(SharedPrefsConsts.password);
// String firebaseToken = await Utils.getStringFromPrefs(SharedPrefsConsts.firebaseToken);
// print("firebaseToken:$firebaseToken");
this.username.text = username;
this.password.text = password;
_autoLogin = true;
}
}
String? firebaseToken;
GetMobileLoginInfoListModel? loginInfo;
@ -90,16 +79,21 @@ class _LoginScreenState extends State<LoginScreen> {
}
} catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, (errorMsg){});
Utils.handleException(ex, context, (errorMsg) {});
}
}
// Future<void> getFirebaseToken() async {
// String? firebaseToken = await _firebaseMessaging.getToken();
// if (firebaseToken != null) {
// await Utils.saveStringFromPrefs(SharedPrefsConsts.firebaseToken, firebaseToken);
// }
// }
Future<void> checkPrefs() async {
String username = await Utils.getStringFromPrefs(SharedPrefsConsts.username);
if (username.isNotEmpty) {
String password = await Utils.getStringFromPrefs(SharedPrefsConsts.password);
// String firebaseToken = await Utils.getStringFromPrefs(SharedPrefsConsts.firebaseToken);
// print("firebaseToken:$firebaseToken");
this.username.text = username;
this.password.text = password;
_autoLogin = true;
}
}
void performLogin() async {
Utils.showLoading(context);
@ -114,8 +108,8 @@ class _LoginScreenState extends State<LoginScreen> {
AppState().setPrivilegeListModel = await PrivilegeListModel.getFromPrefs();
String mohemmWifiSSID = await Utils.getStringFromPrefs(SharedPrefsConsts.mohemmWifiSSID);
String mohemmWifiPassword = await Utils.getStringFromPrefs(SharedPrefsConsts.mohemmWifiPassword);
AppState().mohemmWifiSSID = mohemmWifiSSID;
AppState().mohemmWifiPassword = mohemmWifiPassword;
AppState().setMohemmWifiSSID = mohemmWifiSSID;
AppState().setMohemmWifiPassword = mohemmWifiPassword;
}
Utils.hideLoading(context);
if (_autoLogin) {
@ -124,7 +118,6 @@ class _LoginScreenState extends State<LoginScreen> {
Navigator.pushNamed(context, AppRoutes.verifyLogin, arguments: "$firebaseToken");
}
} catch (ex) {
print(ex);
Utils.hideLoading(context);
Utils.handleException(ex, context, (msg) {
Utils.confirmDialog(context, msg);
@ -134,8 +127,14 @@ class _LoginScreenState extends State<LoginScreen> {
@override
Widget build(BuildContext context) {
username.text = "15153";
password.text = "Abcd@12345";
if (isAppOpenBySystem == null) {
isAppOpenBySystem = (ModalRoute.of(context)!.settings.arguments ?? true) as bool;
print('isAppOpenBySystem:$isAppOpenBySystem');
username.text = "15153";
password.text = "Abcd@12345";
if (isAppOpenBySystem!) checkFirebaseToken();
}
// username.text = "15444";
return Scaffold(

@ -58,116 +58,113 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
),
body: Column(
children: [
Expanded(
child: ListView(
padding: const EdgeInsets.all(21),
physics: const BouncingScrollPhysics(),
children: [
//12.height,
if (true)
Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.welcomeBack.tr().toText12(),
mobileLoginInfoListModel!.employeeName!.toText24(isBold: true),
10.height,
LocaleKeys.wouldYouLikeToLoginWithCurrentUsername.tr().toText16(),
Container(
height: 72,
margin: const EdgeInsets.only(top: 23, bottom: 23),
alignment: Alignment.center,
padding: const EdgeInsets.only(left: 17, right: 12),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Colors.white,
border: Border.all(
color: const Color(0xffefefef),
width: 1,
),
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
LocaleKeys.lastLoginDetails.tr().toText16(),
DateUtil.formatDateToDate(DateUtil.convertStringToDate(mobileLoginInfoListModel!.editedOn!), false).toText12(),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
LocaleKeys.verificationType.tr().toText10(color: MyColors.grey57Color),
getVerificationType(mobileLoginInfoListModel!.loginType!).toText12(),
Expanded(child: SizedBox()),
DateUtil.formatDateToTime(DateUtil.convertStringToDate(mobileLoginInfoListModel!.editedOn!)).toText12(),
],
)
],
ListView(
padding: const EdgeInsets.all(21),
physics: const BouncingScrollPhysics(),
children: [
//12.height,
if (true)
Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.welcomeBack.tr().toText12(),
mobileLoginInfoListModel!.employeeName!.toText24(isBold: true),
10.height,
LocaleKeys.wouldYouLikeToLoginWithCurrentUsername.tr().toText16(),
Container(
height: 72,
margin: const EdgeInsets.only(top: 23, bottom: 23),
alignment: Alignment.center,
padding: const EdgeInsets.only(left: 17, right: 12),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Colors.white,
border: Border.all(
color: const Color(0xffefefef),
width: 1,
),
),
LocaleKeys.pleaseVerify.tr().toText16(),
GridView(
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 13, mainAxisSpacing: 9),
physics: const NeverScrollableScrollPhysics(),
padding: const EdgeInsets.only(top: 9),
shrinkWrap: true,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
getButton(3),
getButton(4),
getButton(2),
getButton(1),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
LocaleKeys.lastLoginDetails.tr().toText16(),
DateUtil.formatDateToDate(DateUtil.convertStringToDate(mobileLoginInfoListModel!.editedOn!), false).toText12(),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
LocaleKeys.verificationType.tr().toText10(color: MyColors.grey57Color),
getVerificationType(mobileLoginInfoListModel!.loginType!).toText12(),
Expanded(child: SizedBox()),
DateUtil.formatDateToTime(DateUtil.convertStringToDate(mobileLoginInfoListModel!.editedOn!)).toText12(),
],
)
],
)
],
)
// else
// Column(mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
// Image.asset(
// 'assets/images/habib-logo.png',
// height: 90,
// width: 90,
// ),
// SizedBox(height: 23),
// this.onlySMSBox == false
// ? Text(
// TranslationBase.of(context).verifyLoginWith,
// style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 25 / 16),
// )
// : Text(
// TranslationBase.of(context).verifyFingerprint2,
// style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 25 / 16),
// ),
// SizedBox(height: 23),
// Text(
// TranslationBase.of(context).pleaseVerify,
// style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64),
// ),
// GridView(
// gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 13, mainAxisSpacing: 9),
// physics: NeverScrollableScrollPhysics(),
// padding: EdgeInsets.only(top: 9),
// shrinkWrap: true,
// children: [
// if (onlySMSBox == false) getButton(3),
// if (onlySMSBox == false) getButton(2),
// getButton(1),
// getButton(4),
// ],
// ),
// ]),
],
),
),
12.height,
),
),
LocaleKeys.pleaseVerify.tr().toText16(),
GridView(
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 13, mainAxisSpacing: 9),
physics: const NeverScrollableScrollPhysics(),
padding: const EdgeInsets.only(top: 9),
shrinkWrap: true,
children: [
getButton(3),
getButton(4),
getButton(2),
getButton(1),
],
)
],
)
// else
// Column(mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
// Image.asset(
// 'assets/images/habib-logo.png',
// height: 90,
// width: 90,
// ),
// SizedBox(height: 23),
// this.onlySMSBox == false
// ? Text(
// TranslationBase.of(context).verifyLoginWith,
// style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 25 / 16),
// )
// : Text(
// TranslationBase.of(context).verifyFingerprint2,
// style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 25 / 16),
// ),
// SizedBox(height: 23),
// Text(
// TranslationBase.of(context).pleaseVerify,
// style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64),
// ),
// GridView(
// gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 13, mainAxisSpacing: 9),
// physics: NeverScrollableScrollPhysics(),
// padding: EdgeInsets.only(top: 9),
// shrinkWrap: true,
// children: [
// if (onlySMSBox == false) getButton(3),
// if (onlySMSBox == false) getButton(2),
// getButton(1),
// getButton(4),
// ],
// ),
// ]),
],
).expanded,
DefaultButton(
LocaleKeys.useAnotherAccount.tr(),
() => {
//Navigator.of(context).pushNamed(LOGIN_TYPE)
() {
Navigator.pushNamedAndRemoveUntil(context, AppRoutes.login, (Route<dynamic> route) => false,arguments: false);
},
).insideContainer,
],

@ -13,14 +13,12 @@ import 'package:mohem_flutter_app/classes/consts.dart';
import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/dialogs/otp_dialog.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/models/basic_member_information_model.dart';
import 'package:mohem_flutter_app/models/generic_response_model.dart';
import 'package:mohem_flutter_app/models/member_information_list_model.dart';
import 'package:mohem_flutter_app/models/privilege_list_model.dart';
import 'package:mohem_flutter_app/widgets/button/default_button.dart';
class VerifyLoginScreen extends StatefulWidget {
VerifyLoginScreen({Key? key}) : super(key: key);
@ -56,142 +54,23 @@ class _VerifyLoginScreenState extends State<VerifyLoginScreen> {
),
// actions: [Center(child: "Employee Digital ID".toText12(color: MyColors.textMixColor, isUnderLine: true).onPress(() {})), 21.width],
),
body: Column(
body: ListView(
padding: const EdgeInsets.all(21),
physics: const BouncingScrollPhysics(),
children: [
Expanded(
child: ListView(
padding: const EdgeInsets.all(21),
physics: const BouncingScrollPhysics(),
children: [
//12.height,
if (true)
Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// LocaleKeys.welcomeBack.tr().toText12(),
// "Mohammad Hussain".toText24(isBold: true),
// 10.height,
// LocaleKeys.wouldYouLikeToLoginWithCurrentUsername.tr().toText16(),
// Container(
// height: 72,
// margin: const EdgeInsets.only(top: 23, bottom: 23),
// alignment: Alignment.center,
// padding: EdgeInsets.only(left: 17, right: 12),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(10),
// color: Colors.white,
// border: Border.all(
// color: Color(0xffefefef),
// width: 1,
// ),
// ),
// child: Column(
// mainAxisSize: MainAxisSize.min,
// children: [
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// LocaleKeys.lastLoginDetails.tr().toText16(),
// // Text(
// // user.editedOn != null
// // ? DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(user.editedOn))
// // : user.createdOn != null
// // ? DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(user.createdOn))
// // : '--',
// // style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48),
// // ),
// ],
// ),
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// LocaleKeys.verificationType.tr().toText10(color: MyColors.grey57Color),
// Text(
// "SMS",
// // " " + getType(user.logInType, context),
// style: TextStyle(
// fontSize: 12,
// fontWeight: FontWeight.w600,
// color: Color(0xff2B353E),
// ),
// ),
// Expanded(child: SizedBox()),
// // Text(
// // user.editedOn != null
// // ? DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(user.editedOn), false)
// // : user.createdOn != null
// // ? DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(user.createdOn), false)
// // : '--',
// // style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.48),
// // ),
// ],
// )
// ],
// ),
// ),
LocaleKeys.pleaseVerify.tr().toText16(),
GridView(
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 13, mainAxisSpacing: 9),
physics: const NeverScrollableScrollPhysics(),
padding: const EdgeInsets.only(top: 9),
shrinkWrap: true,
children: [
getButton(3),
getButton(4),
getButton(2),
getButton(1),
],
)
],
)
// else
// Column(mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
// Image.asset(
// 'assets/images/habib-logo.png',
// height: 90,
// width: 90,
// ),
// SizedBox(height: 23),
// this.onlySMSBox == false
// ? Text(
// TranslationBase.of(context).verifyLoginWith,
// style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 25 / 16),
// )
// : Text(
// TranslationBase.of(context).verifyFingerprint2,
// style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 25 / 16),
// ),
// SizedBox(height: 23),
// Text(
// TranslationBase.of(context).pleaseVerify,
// style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64),
// ),
// GridView(
// gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 13, mainAxisSpacing: 9),
// physics: NeverScrollableScrollPhysics(),
// padding: EdgeInsets.only(top: 9),
// shrinkWrap: true,
// children: [
// if (onlySMSBox == false) getButton(3),
// if (onlySMSBox == false) getButton(2),
// getButton(1),
// getButton(4),
// ],
// ),
// ]),
],
),
),
12.height,
DefaultButton(
LocaleKeys.useAnotherAccount.tr(),
() => {
//Navigator.of(context).pushNamed(LOGIN_TYPE)
},
).insideContainer,
LocaleKeys.pleaseVerify.tr().toText16(),
GridView(
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 13, mainAxisSpacing: 9),
physics: const NeverScrollableScrollPhysics(),
padding: const EdgeInsets.only(top: 9),
shrinkWrap: true,
children: [
getButton(3),
getButton(4),
getButton(2),
getButton(1),
],
)
],
),
);
@ -686,8 +565,8 @@ class _VerifyLoginScreenState extends State<VerifyLoginScreen> {
print(element.serviceName.toString() + " " + element.previlege.toString()); // Check availability
});
PrivilegeListModel.saveToPrefs(genericResponseModel.privilegeList ?? []);
AppState().mohemmWifiSSID = genericResponseModel.mohemmWifiSSID;
AppState().mohemmWifiPassword = genericResponseModel.mohemmWifiPassword;
AppState().setMohemmWifiSSID = genericResponseModel.mohemmWifiSSID;
AppState().setMohemmWifiPassword = genericResponseModel.mohemmWifiPassword;
Utils.saveStringFromPrefs(SharedPrefsConsts.username, AppState().getUserName!);
Utils.saveStringFromPrefs(SharedPrefsConsts.password, AppState().password!);
Utils.saveStringFromPrefs(SharedPrefsConsts.mohemmWifiSSID, genericResponseModel.mohemmWifiSSID!);
@ -707,7 +586,6 @@ class _VerifyLoginScreenState extends State<VerifyLoginScreen> {
},
).displayDialog(context);
} catch (ex) {
print(ex);
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
}

@ -44,8 +44,16 @@ class _BasicDetailsState extends State<BasicDetails> {
super.initState();
memberInformationList = AppState().memberInformationList!;
List<GetMenuEntriesList> menuData = Provider.of<DashboardProviderModel>(context, listen: false).getMenuEntriesList!;
for( int i=0;i<menuData.length;i++) {
menuData[i].icon == "";
print(menuData[i].requestType);
}
var filterList = menuData.where((e) => e.requestType == 'BASIC_DETAILS').toList();
if(filterList.isNotEmpty) {
menuEntries = filterList.first;
}
menuEntries = menuData.where((e) => e.requestType == 'BASIC_DETAILS').toList()[0];
getEmployeeBasicDetails();
}

@ -44,8 +44,16 @@ class _ContactDetailsState extends State<ContactDetails> {
super.initState();
List<GetMenuEntriesList> menuData = Provider.of<DashboardProviderModel>(context, listen: false).getMenuEntriesList!;
menuEntriesPhone = menuData.where((GetMenuEntriesList e) => e.requestType == 'PHONE_NUMBERS').toList()[0];
menuEntriesAddress = menuData.where((GetMenuEntriesList e) => e.requestType == 'ADDRESS').toList()[0];
var filterList = menuData.where((GetMenuEntriesList e) => e.requestType == 'PHONE_NUMBERS').toList();
if (filterList.isNotEmpty) {
menuEntriesPhone = filterList.first;
}
filterList = menuData.where((GetMenuEntriesList e) => e.requestType == 'ADDRESS').toList();
if (filterList.isNotEmpty) {
menuEntriesAddress = filterList.first;
}
getEmployeePhones();
}

@ -30,7 +30,7 @@ class ProfileInFo extends StatelessWidget {
children: [
16.height,
memberInfo.eMPLOYEENAME!.toText22(),
("${memberInfo.eMPLOYEENUMBER!} | ${memberInfo.jOBNAME!}").toText13(color: MyColors.grey80Color),
("${memberInfo.eMPLOYEENUMBER!} | ${memberInfo.getPositionName()}").toText13(color: MyColors.grey80Color),
memberInfo.eMPLOYEEEMAILADDRESS!.toText13(),
12.height,
const Divider(height: 8, thickness: 8, color: MyColors.lightGreyEFColor),

@ -50,56 +50,54 @@ class _MowadhafhiHomeState extends State<MowadhafhiHome> {
context,
title: LocaleKeys.mowadhafhiRequest.tr(),
),
body: getTicketsByEmployeeList == null
? const SizedBox()
: (getTicketsByEmployeeList!.isEmpty)
body: Column(
children: [
(getTicketsByEmployeeList == null
? const SizedBox()
: (getTicketsByEmployeeList!.isEmpty)
? Utils.getNoDataWidget(context)
: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
ListView.separated(
physics: const BouncingScrollPhysics(),
padding: const EdgeInsets.all(21),
itemBuilder: (BuildContext context, int index) {
return InkWell(
onTap: () {
Navigator.pushNamed(context, AppRoutes.mowadhafhiDetails, arguments: getTicketsByEmployeeList![index].ticketId);
},
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
getTicketsByEmployeeList![index].ticketTypeName!.toText14(color: MyColors.darkTextColor).expanded,
getTicketsByEmployeeList![index].created!.split(" ")[0].toText12(color: MyColors.grey70Color),
],
),
getTicketsByEmployeeList![index].description!.toText12(color: MyColors.grey57Color),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
getTicketsByEmployeeList![index].ticketStatusInternalName!.toText14(color: MyColors.textMixColor),
SvgPicture.asset(
"assets/images/arrow_next.svg",
color: MyColors.darkIconColor,
)
],
),
],
).objectContainerView(),
);
},
separatorBuilder: (BuildContext context, int index) => 12.height,
itemCount: getTicketsByEmployeeList!.length)
.expanded,
DefaultButton(LocaleKeys.createRequest.tr(), () async {
await Navigator.pushNamed(context, AppRoutes.mowadhafhiHRRequest);
getOpenTickets();
}).insideContainer
],
),
: ListView.separated(
physics: const BouncingScrollPhysics(),
padding: const EdgeInsets.all(21),
itemBuilder: (BuildContext context, int index) {
return InkWell(
onTap: () {
Navigator.pushNamed(context, AppRoutes.mowadhafhiDetails, arguments: getTicketsByEmployeeList![index].ticketId);
},
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
getTicketsByEmployeeList![index].ticketTypeName!.toText14(color: MyColors.darkTextColor).expanded,
getTicketsByEmployeeList![index].created!.split(" ")[0].toText12(color: MyColors.grey70Color),
],
),
getTicketsByEmployeeList![index].description!.toText12(color: MyColors.grey57Color),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
getTicketsByEmployeeList![index].ticketStatusInternalName!.toText14(color: MyColors.textMixColor),
SvgPicture.asset(
"assets/images/arrow_next.svg",
color: MyColors.darkIconColor,
)
],
),
],
).objectContainerView(),
);
},
separatorBuilder: (BuildContext context, int index) => 12.height,
itemCount: getTicketsByEmployeeList!.length))
.expanded,
DefaultButton(LocaleKeys.createRequest.tr(), () async {
await Navigator.pushNamed(context, AppRoutes.mowadhafhiHRRequest);
getOpenTickets();
}).insideContainer
],
),
);
}
}

@ -5,7 +5,7 @@ import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
AppBar AppBarWidget(BuildContext context, {required String title, bool showHomeButton = false, bool showNotificationButton = false, bool showMemberButton = false}) {
AppBar AppBarWidget(BuildContext context, {required String title, bool showHomeButton = true, bool showNotificationButton = false, bool showMemberButton = false}) {
return AppBar(
leadingWidth: 0,
// leading: GestureDetector(
@ -32,11 +32,7 @@ AppBar AppBarWidget(BuildContext context, {required String title, bool showHomeB
if (showHomeButton)
IconButton(
onPressed: () {
// Navigator.pushAndRemoveUntil(
// context,
// MaterialPageRoute(builder: (context) => LandingPage()),
// (Route<dynamic> route) => false,
// );
Navigator.popUntil(context, ModalRoute.withName(AppRoutes.dashboard));
},
icon: const Icon(Icons.home, color: MyColors.darkIconColor),
),
@ -47,7 +43,7 @@ AppBar AppBarWidget(BuildContext context, {required String title, bool showHomeB
},
icon: const Icon(Icons.notifications, color: MyColors.textMixColor),
),
if(showMemberButton)
if (showMemberButton)
IconButton(
onPressed: () {
Navigator.pushNamed(context, AppRoutes.subordinateLeave);

@ -1,9 +1,6 @@
import 'package:flutter/material.dart';
void showMDialog(
context, {
Widget? child,
}) async {
void showMDialog(context, {Widget? child}) async {
return showDialog(
context: context,
barrierDismissible: true,

@ -155,10 +155,11 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
print("wifi not location enabled");
}
bool v = await WiFiForIoTPlugin.connect(AppState().mohemmWifiSSID ?? "", password: AppState().mohemmWifiPassword ?? "", joinOnce: true, security: NetworkSecurity.WPA, withInternet: false);
if (v) {
bool isConnected =
await WiFiForIoTPlugin.connect(AppState().getMohemmWifiSSID ?? "", password: AppState().getMohemmWifiPassword ?? "", joinOnce: true, security: NetworkSecurity.WPA, withInternet: false);
if (isConnected) {
await WiFiForIoTPlugin.forceWifiUsage(true);
print("connected");
Utils.showLoading(context);
try {
GenericResponseModel? g = await DashboardApiClient().markAttendance(pointType: 3, nfcValue: "", isGpsRequired: isWifiLocationEnabled, lat: lat, long: lng);
@ -166,7 +167,6 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
Utils.hideLoading(context);
await closeWifiRequest();
} catch (ex) {
print(ex);
await closeWifiRequest();
Utils.hideLoading(context);
Utils.handleException(ex, context, (msg) {

Loading…
Cancel
Save