Added last login UI

merge-requests/3/head
Zohaib Iqbal Kambrani 3 years ago
parent 925a993843
commit 771a0204dc

@ -27,5 +27,20 @@
"markAttendance": "علامة الحضور",
"timeLeftToday": "الوقت المتبقي اليوم",
"checkIn": "تحقق في",
"workList": "قائمة العمل"
"workList": "قائمة العمل",
"doNotUseRecentPassword": "لا تستخدم كلمة مرور حديثة",
"atLeastOneLowercase": "حرف صغير واحد على الأقل",
"atLeastOneUppercase": "حرف كبير واحد على الأقل",
"atLeastOneNumeric": "رقم واحد على الأقل",
"minimum8Characters": "8 أحرف على الأقل",
"doNotAddRepeatingLetters": "لا تقم بإضافة أحرف متكررة",
"itShouldContainSpecialCharacter": "يجب أن يحتوي على طابع خاص",
"confirmPasswordMustMatch": "يجب أن يتطابق تأكيد كلمة المرور",
"sms": "رسالة قصيرة",
"fingerPrint": "بصمة",
"face": "التعرف على الوجه",
"whatsapp": "واتس اب",
"reject": "يرفض",
"approve": "يوافق",
"cancel": "إلغاء"
}

@ -27,5 +27,20 @@
"markAttendance": "Mark Attendance",
"timeLeftToday": "Time Left Today",
"checkIn": "Check In",
"workList": "Work List"
"workList": "Work List",
"doNotUseRecentPassword": "Do not use recent password",
"atLeastOneLowercase": "At least one lowercase",
"atLeastOneUppercase": "At least one uppercase",
"atLeastOneNumeric": "At least one numeric",
"minimum8Characters": "Minimum 8 characters",
"doNotAddRepeatingLetters": "Do not add repeating letters",
"itShouldContainSpecialCharacter": "It should contain special character",
"confirmPasswordMustMatch": "Confirm password must match",
"sms": "SMS",
"fingerPrint": "Fingerprint",
"face": "Face",
"whatsapp": "Whatsapp",
"reject": "Reject",
"approve": "Approve",
"cancel": "Cancel"
}

@ -43,7 +43,22 @@ class CodegenLoader extends AssetLoader{
"markAttendance": "علامة الحضور",
"timeLeftToday": "الوقت المتبقي اليوم",
"checkIn": "تحقق في",
"workList": "قائمة العمل"
"workList": "قائمة العمل",
"doNotUseRecentPassword": "لا تستخدم كلمة مرور حديثة",
"atLeastOneLowercase": "حرف صغير واحد على الأقل",
"atLeastOneUppercase": "حرف كبير واحد على الأقل",
"atLeastOneNumeric": "رقم واحد على الأقل",
"minimum8Characters": "8 أحرف على الأقل",
"doNotAddRepeatingLetters": "لا تقم بإضافة أحرف متكررة",
"itShouldContainSpecialCharacter": "يجب أن يحتوي على طابع خاص",
"confirmPasswordMustMatch": "يجب أن يتطابق تأكيد كلمة المرور",
"sms": "رسالة قصيرة",
"fingerPrint": "بصمة",
"face": "التعرف على الوجه",
"whatsapp": "واتس اب",
"reject": "يرفض",
"approve": "يوافق",
"cancel": "إلغاء"
};
static const Map<String,dynamic> en_US = {
"mohemm": "Mohemm",
@ -74,7 +89,22 @@ static const Map<String,dynamic> en_US = {
"markAttendance": "Mark Attendance",
"timeLeftToday": "Time Left Today",
"checkIn": "Check In",
"workList": "Work List"
"workList": "Work List",
"doNotUseRecentPassword": "Do not use recent password",
"atLeastOneLowercase": "At least one lowercase",
"atLeastOneUppercase": "At least one uppercase",
"atLeastOneNumeric": "At least one numeric",
"minimum8Characters": "Minimum 8 characters",
"doNotAddRepeatingLetters": "Do not add repeating letters",
"itShouldContainSpecialCharacter": "It should contain special character",
"confirmPasswordMustMatch": "Confirm password must match",
"sms": "SMS",
"fingerPrint": "Fingerprint",
"face": "Face",
"whatsapp": "Whatsapp",
"reject": "Reject",
"approve": "Approve",
"cancel": "Cancel"
};
static const Map<String, Map<String,dynamic>> mapLocales = {"ar_SA": ar_SA, "en_US": en_US};
}

@ -0,0 +1,64 @@
class GetMobileLoginInfoListModel {
int? iD;
int? employeeID;
int? channelID;
int? companyID;
String? deviceType;
String? deviceToken;
int? language;
int? gender;
int? loginType;
String? createdOn;
String? editedOn;
String? employeeName;
bool? businessCardPrivilege;
GetMobileLoginInfoListModel(
{this.iD,
this.employeeID,
this.channelID,
this.companyID,
this.deviceType,
this.deviceToken,
this.language,
this.gender,
this.loginType,
this.createdOn,
this.editedOn,
this.employeeName,
this.businessCardPrivilege});
GetMobileLoginInfoListModel.fromJson(Map<String, dynamic> json) {
iD = json['ID'];
employeeID = json['EmployeeID'];
channelID = json['ChannelID'];
companyID = json['CompanyID'];
deviceType = json['DeviceType'];
deviceToken = json['DeviceToken'];
language = json['Language'];
gender = json['Gender'];
loginType = json['LoginType'];
createdOn = json['CreatedOn'];
editedOn = json['EditedOn'];
employeeName = json['EmployeeName'];
businessCardPrivilege = json['BusinessCardPrivilege'];
}
Map<String, dynamic> toJson() {
Map<String, dynamic> data = Map<String, dynamic>();
data['ID'] = iD;
data['EmployeeID'] = employeeID;
data['ChannelID'] = channelID;
data['CompanyID'] = companyID;
data['DeviceType'] = deviceType;
data['DeviceToken'] = deviceToken;
data['Language'] = language;
data['Gender'] = gender;
data['LoginType'] = loginType;
data['CreatedOn'] = createdOn;
data['EditedOn'] = editedOn;
data['EmployeeName'] = employeeName;
data['BusinessCardPrivilege'] = businessCardPrivilege;
return data;
}
}

@ -5,7 +5,10 @@ import 'package:flutter/services.dart';
import 'package:flutter_svg/svg.dart';
import 'package:hmg_nurses/classes/colors.dart';
import 'package:hmg_nurses/classes/utils.dart';
import 'package:hmg_nurses/extensions/int_extensions.dart';
import 'package:hmg_nurses/extensions/string_extensions.dart';
import 'package:hmg_nurses/generated/locale_keys.g.dart';
import 'package:hmg_nurses/widgets/button/default_button.dart';
import 'package:local_auth/local_auth.dart';
import 'package:sizer/sizer.dart';
@ -28,47 +31,25 @@ class LoginMethodsPageState extends State<LoginMethodsPage> {
int selectedFlag = 0;
bool isNeedVerifyWithFaceIDAndBiometrics = false;
bool lastLoginCheck = false;
@override
void initState() {
_getAvailableBiometrics();
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.transparent,
leading: IconButton(
icon: const Icon(Icons.arrow_back_ios, color: MyColors.darkIconColor),
onPressed: () => Navigator.pop(context),
),
// actions: [Center(child: "Employee Digital ID".toText12(color: MyColors.textMixColor, isUnderLine: true).onPress(() {})), 21.width],
),
body: ListView(
padding: const EdgeInsets.all(21),
physics: const BouncingScrollPhysics(),
children: [
Text(
LocaleKeys.pleaseVerifyForBio.tr(),
style: TextStyle(fontSize: 14.sp, fontWeight: FontWeight.w600),
),
if (isNeedVerifyWithFaceIDAndBiometrics) Text(LocaleKeys.pleaseVerifyForBio.tr()),
GridView(
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 13, mainAxisSpacing: 9),
physics: const NeverScrollableScrollPhysics(),
padding: const EdgeInsets.only(top: 9),
shrinkWrap: true,
children: [
if (!isNeedVerifyWithFaceIDAndBiometrics) getButton(3),
if (!isNeedVerifyWithFaceIDAndBiometrics) getButton(4),
getButton(2),
getButton(1),
],
)
],
),
);
String getVerificationType(int type) {
if (type == 1) {
return LocaleKeys.sms.tr();
} else if (type == 2) {
return LocaleKeys.whatsapp.tr();
} else if (type == 3) {
return LocaleKeys.face.tr();
} else if (type == 4) {
return LocaleKeys.fingerPrint.tr();
}
return "";
}
Future<void> _getAvailableBiometrics() async {
@ -149,10 +130,7 @@ class LoginMethodsPageState extends State<LoginMethodsPage> {
width: 38,
color: isDisable ? MyColors.darkTextColor.withOpacity(0.7) : null,
),
Text(
title,
style: const TextStyle(fontWeight: FontWeight.w600),
)
title.toText14()
],
),
),
@ -184,4 +162,117 @@ class LoginMethodsPageState extends State<LoginMethodsPage> {
}
return isAvailable;
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.transparent,
leading: IconButton(
icon: const Icon(Icons.arrow_back_ios, color: MyColors.darkIconColor),
onPressed: () => Navigator.pop(context),
),
// actions: [Center(child: "Employee Digital ID".toText12(color: MyColors.textMixColor, isUnderLine: true).onPress(() {})), 21.width],
),
body: ListView(
padding: const EdgeInsets.all(21),
physics: const BouncingScrollPhysics(),
children: [
if (lastLoginCheck)
Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.welcomeBack.tr().toText12(),
"Faiz Hashmi".toText24(isBold: true),
10.height,
LocaleKeys.wouldYouLikeToLoginWithCurrentUsername.tr().toText18(),
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(),
//TODO: DATE
// DateUtil.formatDateToDate(DateUtil.convertStringToDate(mobileLoginInfoListModel!.editedOn!), false).toText12(),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
LocaleKeys.verificationType.tr().toText10(color: MyColors.grey57Color),
//TODO: VERIFICATION TYPE
// getVerificationType(mobileLoginInfoListModel!.loginType!).toText12(),
const Expanded(child: SizedBox()),
//TODO: DATE
// DateUtil.formatDateToTime(DateUtil.convertStringToDate(mobileLoginInfoListModel!.editedOn!)).toText12(),
],
)
],
),
),
],
),
if (!lastLoginCheck)
Text(
LocaleKeys.pleaseVerifyForBio.tr(),
style: TextStyle(fontSize: 14.sp, fontWeight: FontWeight.w600),
),
if (isNeedVerifyWithFaceIDAndBiometrics) Text(LocaleKeys.pleaseVerifyForBio.tr()),
GridView(
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 13, mainAxisSpacing: 9),
physics: const NeverScrollableScrollPhysics(),
padding: const EdgeInsets.only(top: 9),
shrinkWrap: true,
children: [
if (!isNeedVerifyWithFaceIDAndBiometrics) getButton(3),
if (!isNeedVerifyWithFaceIDAndBiometrics) getButton(4),
getButton(2),
getButton(1),
],
),
SizedBox(height: 10.h),
],
),
bottomSheet: !lastLoginCheck
? null
: Container(
height: 10.h,
color: MyColors.backgroundColor,
width: double.infinity,
child: Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Padding(
padding: EdgeInsets.symmetric(horizontal: 4.w),
child: DefaultButton(LocaleKeys.useAnotherAccount.tr(), () {}, colors: const [MyColors.redColor, MyColors.redColor]),
),
SizedBox(height: 3.h)
],
),
),
),
),
);
}
}

@ -58,26 +58,16 @@ class _LoginPageState extends State<LoginPage> {
padding: EdgeInsets.symmetric(horizontal: 8.w),
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
buildSpacer20h(),
CustomTextField(
LocaleKeys.userID.tr(),
userIdController,
isEnableBorder: true,
),
CustomTextField(LocaleKeys.userID.tr(), userIdController, isEnableBorder: true, ),
buildSpacer20h(),
CustomTextField(
LocaleKeys.password.tr(),
passwordController,
isTextIsPassword: true,
),
CustomTextField(LocaleKeys.password.tr(), passwordController, isTextIsPassword: true),
buildSpacer20h(),
CustomTextField(
LocaleKeys.branch.tr(),
projectIdController,
hasSelection: true,
isEnable: false,
onClick: () {
CustomCupertinoPicker.showCupertinoPicker(context, [], (){});
},
onClick: () => CustomCupertinoPicker.showCupertinoPicker(context, [], () {}),
),
buildSpacer20h()
]),

@ -92,6 +92,7 @@ class CustomTextFieldState extends State<CustomTextField> {
),
),
TextField(
autofocus: false,
enabled: widget.isEnable,
scrollPadding: EdgeInsets.zero,
keyboardType: widget.isInputTypeNum ? TextInputType.number : TextInputType.text,

Loading…
Cancel
Save