diff --git a/assets/fonts/DoctorApp.ttf b/assets/fonts/DoctorApp.ttf new file mode 100644 index 0000000..4ef2028 Binary files /dev/null and b/assets/fonts/DoctorApp.ttf differ diff --git a/assets/fonts/Poppins/Poppins-Bold.ttf b/assets/fonts/Poppins/Poppins-Bold.ttf new file mode 100644 index 0000000..b94d47f Binary files /dev/null and b/assets/fonts/Poppins/Poppins-Bold.ttf differ diff --git a/assets/fonts/Poppins/Poppins-Medium.ttf b/assets/fonts/Poppins/Poppins-Medium.ttf new file mode 100644 index 0000000..e90e87e Binary files /dev/null and b/assets/fonts/Poppins/Poppins-Medium.ttf differ diff --git a/assets/fonts/Poppins/Poppins-Regular.ttf b/assets/fonts/Poppins/Poppins-Regular.ttf new file mode 100644 index 0000000..be06e7f Binary files /dev/null and b/assets/fonts/Poppins/Poppins-Regular.ttf differ diff --git a/assets/fonts/Poppins/Poppins-SemiBold.ttf b/assets/fonts/Poppins/Poppins-SemiBold.ttf new file mode 100644 index 0000000..8987d80 Binary files /dev/null and b/assets/fonts/Poppins/Poppins-SemiBold.ttf differ diff --git a/assets/fonts/Work_Sans/OFL.txt b/assets/fonts/Work_Sans/OFL.txt new file mode 100644 index 0000000..5c0354e --- /dev/null +++ b/assets/fonts/Work_Sans/OFL.txt @@ -0,0 +1,93 @@ +Copyright (c) 2014-2015 Wei Huang (wweeiihhuuaanngg@gmail.com) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/assets/fonts/Work_Sans/WorkSans-Black.ttf b/assets/fonts/Work_Sans/WorkSans-Black.ttf new file mode 100644 index 0000000..fb74420 Binary files /dev/null and b/assets/fonts/Work_Sans/WorkSans-Black.ttf differ diff --git a/assets/fonts/Work_Sans/WorkSans-Bold.ttf b/assets/fonts/Work_Sans/WorkSans-Bold.ttf new file mode 100644 index 0000000..7caa359 Binary files /dev/null and b/assets/fonts/Work_Sans/WorkSans-Bold.ttf differ diff --git a/assets/fonts/Work_Sans/WorkSans-ExtraBold.ttf b/assets/fonts/Work_Sans/WorkSans-ExtraBold.ttf new file mode 100644 index 0000000..fd4b912 Binary files /dev/null and b/assets/fonts/Work_Sans/WorkSans-ExtraBold.ttf differ diff --git a/assets/fonts/Work_Sans/WorkSans-ExtraLight.ttf b/assets/fonts/Work_Sans/WorkSans-ExtraLight.ttf new file mode 100644 index 0000000..b97cf8c Binary files /dev/null and b/assets/fonts/Work_Sans/WorkSans-ExtraLight.ttf differ diff --git a/assets/fonts/Work_Sans/WorkSans-Light.ttf b/assets/fonts/Work_Sans/WorkSans-Light.ttf new file mode 100644 index 0000000..3e981fb Binary files /dev/null and b/assets/fonts/Work_Sans/WorkSans-Light.ttf differ diff --git a/assets/fonts/Work_Sans/WorkSans-Medium.ttf b/assets/fonts/Work_Sans/WorkSans-Medium.ttf new file mode 100644 index 0000000..7a2645b Binary files /dev/null and b/assets/fonts/Work_Sans/WorkSans-Medium.ttf differ diff --git a/assets/fonts/Work_Sans/WorkSans-Regular.ttf b/assets/fonts/Work_Sans/WorkSans-Regular.ttf new file mode 100644 index 0000000..0ac4520 Binary files /dev/null and b/assets/fonts/Work_Sans/WorkSans-Regular.ttf differ diff --git a/assets/fonts/Work_Sans/WorkSans-SemiBold.ttf b/assets/fonts/Work_Sans/WorkSans-SemiBold.ttf new file mode 100644 index 0000000..589a5f5 Binary files /dev/null and b/assets/fonts/Work_Sans/WorkSans-SemiBold.ttf differ diff --git a/assets/fonts/Work_Sans/WorkSans-Thin.ttf b/assets/fonts/Work_Sans/WorkSans-Thin.ttf new file mode 100644 index 0000000..011fcd3 Binary files /dev/null and b/assets/fonts/Work_Sans/WorkSans-Thin.ttf differ diff --git a/assets/images/login/more_icon.png b/assets/images/login/more_icon.png new file mode 100644 index 0000000..b696d34 Binary files /dev/null and b/assets/images/login/more_icon.png differ diff --git a/assets/images/login/verify_face.svg b/assets/images/login/verify_face.svg new file mode 100644 index 0000000..e50d1a6 --- /dev/null +++ b/assets/images/login/verify_face.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/assets/images/login/verify_sms.svg b/assets/images/login/verify_sms.svg new file mode 100644 index 0000000..ae5fa9f --- /dev/null +++ b/assets/images/login/verify_sms.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/assets/images/login/verify_thumb.svg b/assets/images/login/verify_thumb.svg new file mode 100644 index 0000000..e626baf --- /dev/null +++ b/assets/images/login/verify_thumb.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/assets/images/login/verify_whatsapp.svg b/assets/images/login/verify_whatsapp.svg new file mode 100644 index 0000000..09ac85c --- /dev/null +++ b/assets/images/login/verify_whatsapp.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/assets/images/patient/admission_req.png b/assets/images/patient/admission_req.png new file mode 100644 index 0000000..b233508 Binary files /dev/null and b/assets/images/patient/admission_req.png differ diff --git a/assets/images/patient/ic_ref_arrow_left.png b/assets/images/patient/ic_ref_arrow_left.png new file mode 100644 index 0000000..09e05ab Binary files /dev/null and b/assets/images/patient/ic_ref_arrow_left.png differ diff --git a/assets/images/patient/ic_ref_arrow_up.png b/assets/images/patient/ic_ref_arrow_up.png new file mode 100644 index 0000000..8294cfe Binary files /dev/null and b/assets/images/patient/ic_ref_arrow_up.png differ diff --git a/assets/images/patient/refer_patient.png b/assets/images/patient/refer_patient.png new file mode 100644 index 0000000..ac3aea6 Binary files /dev/null and b/assets/images/patient/refer_patient.png differ diff --git a/assets/images/patient/ucaf.png b/assets/images/patient/ucaf.png new file mode 100644 index 0000000..f729359 Binary files /dev/null and b/assets/images/patient/ucaf.png differ diff --git a/assets/images/patient/vital_signs/Obese_BMI-r.png b/assets/images/patient/vital_signs/Obese_BMI-r.png new file mode 100644 index 0000000..50b3282 Binary files /dev/null and b/assets/images/patient/vital_signs/Obese_BMI-r.png differ diff --git a/assets/images/patient/vital_signs/Obese_BMI.png b/assets/images/patient/vital_signs/Obese_BMI.png new file mode 100644 index 0000000..540d4bc Binary files /dev/null and b/assets/images/patient/vital_signs/Obese_BMI.png differ diff --git a/assets/images/patient/vital_signs/blood_pressure.png b/assets/images/patient/vital_signs/blood_pressure.png new file mode 100644 index 0000000..9670187 Binary files /dev/null and b/assets/images/patient/vital_signs/blood_pressure.png differ diff --git a/assets/images/patient/vital_signs/health_BMI-r.png b/assets/images/patient/vital_signs/health_BMI-r.png new file mode 100644 index 0000000..96189d3 Binary files /dev/null and b/assets/images/patient/vital_signs/health_BMI-r.png differ diff --git a/assets/images/patient/vital_signs/health_BMI.png b/assets/images/patient/vital_signs/health_BMI.png new file mode 100644 index 0000000..c87a042 Binary files /dev/null and b/assets/images/patient/vital_signs/health_BMI.png differ diff --git a/assets/images/patient/vital_signs/heart_rate.png b/assets/images/patient/vital_signs/heart_rate.png new file mode 100644 index 0000000..7601719 Binary files /dev/null and b/assets/images/patient/vital_signs/heart_rate.png differ diff --git a/assets/images/patient/vital_signs/height.png b/assets/images/patient/vital_signs/height.png new file mode 100644 index 0000000..e176c45 Binary files /dev/null and b/assets/images/patient/vital_signs/height.png differ diff --git a/assets/images/patient/vital_signs/ovrweight_BMI-r.png b/assets/images/patient/vital_signs/ovrweight_BMI-r.png new file mode 100644 index 0000000..ff24fc6 Binary files /dev/null and b/assets/images/patient/vital_signs/ovrweight_BMI-r.png differ diff --git a/assets/images/patient/vital_signs/ovrweight_BMI.png b/assets/images/patient/vital_signs/ovrweight_BMI.png new file mode 100644 index 0000000..da8e67b Binary files /dev/null and b/assets/images/patient/vital_signs/ovrweight_BMI.png differ diff --git a/assets/images/patient/vital_signs/oxg.png b/assets/images/patient/vital_signs/oxg.png new file mode 100644 index 0000000..344344e Binary files /dev/null and b/assets/images/patient/vital_signs/oxg.png differ diff --git a/assets/images/patient/vital_signs/painScale.png b/assets/images/patient/vital_signs/painScale.png new file mode 100644 index 0000000..36b6b9f Binary files /dev/null and b/assets/images/patient/vital_signs/painScale.png differ diff --git a/assets/images/patient/vital_signs/respiration_rate.png b/assets/images/patient/vital_signs/respiration_rate.png new file mode 100644 index 0000000..ff695de Binary files /dev/null and b/assets/images/patient/vital_signs/respiration_rate.png differ diff --git a/assets/images/patient/vital_signs/temperature.png b/assets/images/patient/vital_signs/temperature.png new file mode 100644 index 0000000..9953a13 Binary files /dev/null and b/assets/images/patient/vital_signs/temperature.png differ diff --git a/assets/images/patient/vital_signs/underweight_BMI-r.png b/assets/images/patient/vital_signs/underweight_BMI-r.png new file mode 100644 index 0000000..2f633b4 Binary files /dev/null and b/assets/images/patient/vital_signs/underweight_BMI-r.png differ diff --git a/assets/images/patient/vital_signs/underweight_BMI.png b/assets/images/patient/vital_signs/underweight_BMI.png new file mode 100644 index 0000000..83b0260 Binary files /dev/null and b/assets/images/patient/vital_signs/underweight_BMI.png differ diff --git a/assets/images/patient/vital_signs/weight.png b/assets/images/patient/vital_signs/weight.png new file mode 100644 index 0000000..4a3bd2c Binary files /dev/null and b/assets/images/patient/vital_signs/weight.png differ diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index cb952f2..1b04c62 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -2,6 +2,30 @@ "mohemm": "Mohemm", "english": "English", "arabic": "عربي", - "login": "تسجيل الدخول" - + "login": "تسجيل الدخول", + "drSulaiman": "سليمان الحبيب", + "welcomeTo": "مرحبا بك في", + "userID" : "معرف المستخدم", + "password" : "كلمة المرور", + "branch" : "فرع", + "pleaseEnterLoginDetails": "الرجاء إدخال التفاصيل أدناه لتسجيل الدخول", + "username": "اسم المستخدم", + "welcomeBack": "مرحبا بعودتك", + "wouldYouLikeToLoginWithCurrentUsername": "هل ترغب في تسجيل الدخول باسم المستخدم الحالي؟", + "lastLoginDetails": "تفاصيل تسجيل الدخول الأخير:", + "verificationType": "نوع التحقق:", + "pleaseVerify": "ارجوك تحقق", + "pleaseVerifyForBio": "الرجاء التحقق من تسجيل الدخول باستخدام أحد هذه الخيارات", + "verifyThroughFace": "تحقق من خلال الوجه", + "verifyThroughFingerprint": "تحقق من خلال بصمة الإصبع", + "verifyThroughSMS": "تحقق من خلال الرسائل القصيرة", + "verifyThroughWhatsapp": "تحقق من خلال Whatsapp", + "useAnotherAccount": "استخدم حسابا آخر", + "pleaseEnterTheVerificationCodeSentTo": "الرجاء إدخال رمز التحقق المرسل إلى ", + "theVerificationCodeWillExpireIn": "ستنتهي صلاحية رمز التحقق في ", + "goodMorning": "صباح الخير", + "markAttendance": "علامة الحضور", + "timeLeftToday": "الوقت المتبقي اليوم", + "checkIn": "تحقق في", + "workList": "قائمة العمل" } \ No newline at end of file diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index afb883f..ba73640 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -2,6 +2,30 @@ "mohemm": "Mohemm", "english": "English", "arabic": "عربي", - "login": "Login" - + "login": "Login", + "drSulaiman" : "Dr Sulaiman Al Habib", + "welcomeTo": "Welcome to", + "userID" : "User ID", + "password" : "Password", + "branch" : "Branch", + "pleaseEnterLoginDetails": "Please enter the detail below to login", + "username": "Username", + "welcomeBack": "Welcome back", + "wouldYouLikeToLoginWithCurrentUsername": "Would you like to login with current Username?", + "lastLoginDetails": "Last Login Details:", + "verificationType": "Verification Type:", + "pleaseVerify": "Please Verify", + "pleaseVerifyForBio": "Please verify login with one of the following options", + "verifyThroughFace": "Verify Through Face", + "verifyThroughFingerprint": "Verify Through Fingerprint", + "verifyThroughSMS": "Verify Through SMS", + "verifyThroughWhatsapp": "Verify Through Whatsapp", + "useAnotherAccount": "Use Another Account", + "pleaseEnterTheVerificationCodeSentTo": "Please enter the verification code sent to ", + "theVerificationCodeWillExpireIn": "The verification code will expire in ", + "goodMorning": "Good Morning", + "markAttendance": "Mark Attendance", + "timeLeftToday": "Time Left Today", + "checkIn": "Check In", + "workList": "Work List" } \ No newline at end of file diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig index 592ceee..ec97fc6 100644 --- a/ios/Flutter/Debug.xcconfig +++ b/ios/Flutter/Debug.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig index 592ceee..c4855bf 100644 --- a/ios/Flutter/Release.xcconfig +++ b/ios/Flutter/Release.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/lib/config/routes.dart b/lib/config/routes.dart index eca978f..3938565 100644 --- a/lib/config/routes.dart +++ b/lib/config/routes.dart @@ -1,25 +1,17 @@ import 'package:flutter/material.dart'; -import 'package:hmg_nurses/ui/login/splash_page.dart'; - - +import 'package:hmg_nurses/ui/login/login_method_page.dart'; +import 'package:hmg_nurses/ui/login/login_page.dart'; class AppRoutes { - //Login static const String splash = "/splash"; static const String registerSelection = "/registerSelection"; - static const String loginVerifyAccount = "/loginVerifyAccount"; + static const String loginMethodsPage = "/loginMethodsPage"; static const String login = "/login"; - - static final Map routes = { - //Login - splash: (BuildContext context) => SplashPage(), - // login: (BuildContext context) => LoginScreen(), - - - + login: (BuildContext context) => const LoginPage(), + loginMethodsPage: (BuildContext context) => const LoginMethodsPage(), }; } diff --git a/lib/generated/codegen_loader.g.dart b/lib/generated/codegen_loader.g.dart index 113e677..92c9461 100644 --- a/lib/generated/codegen_loader.g.dart +++ b/lib/generated/codegen_loader.g.dart @@ -6,15 +6,75 @@ import 'dart:ui'; import 'package:easy_localization/easy_localization.dart' show AssetLoader; -class CodegenLoader extends AssetLoader { +class CodegenLoader extends AssetLoader{ const CodegenLoader(); @override - Future> load(String fullPath, Locale locale) { + Future> load(String fullPath, Locale locale ) { return Future.value(mapLocales[locale.toString()]); } - static const Map ar_SA = {"mohemm": "Mohemm", "english": "English", "arabic": "عربي", "login": "تسجيل الدخول"}; - static const Map en_US = {"mohemm": "Mohemm", "english": "English", "arabic": "عربي", "login": "Login"}; - static const Map> mapLocales = {"ar_SA": ar_SA, "en_US": en_US}; + static const Map ar_SA = { + "mohemm": "Mohemm", + "english": "English", + "arabic": "عربي", + "login": "تسجيل الدخول", + "drSulaiman": "سليمان الحبيب", + "welcomeTo": "مرحبا بك في", + "userID": "معرف المستخدم", + "password": "كلمة المرور", + "branch": "فرع", + "pleaseEnterLoginDetails": "الرجاء إدخال التفاصيل أدناه لتسجيل الدخول", + "username": "اسم المستخدم", + "welcomeBack": "مرحبا بعودتك", + "wouldYouLikeToLoginWithCurrentUsername": "هل ترغب في تسجيل الدخول باسم المستخدم الحالي؟", + "lastLoginDetails": "تفاصيل تسجيل الدخول الأخير:", + "verificationType": "نوع التحقق:", + "pleaseVerify": "ارجوك تحقق", + "pleaseVerifyForBio": "الرجاء التحقق من تسجيل الدخول باستخدام أحد هذه الخيارات", + "verifyThroughFace": "تحقق من خلال الوجه", + "verifyThroughFingerprint": "تحقق من خلال بصمة الإصبع", + "verifyThroughSMS": "تحقق من خلال الرسائل القصيرة", + "verifyThroughWhatsapp": "تحقق من خلال Whatsapp", + "useAnotherAccount": "استخدم حسابا آخر", + "pleaseEnterTheVerificationCodeSentTo": "الرجاء إدخال رمز التحقق المرسل إلى ", + "theVerificationCodeWillExpireIn": "ستنتهي صلاحية رمز التحقق في ", + "goodMorning": "صباح الخير", + "markAttendance": "علامة الحضور", + "timeLeftToday": "الوقت المتبقي اليوم", + "checkIn": "تحقق في", + "workList": "قائمة العمل" +}; +static const Map en_US = { + "mohemm": "Mohemm", + "english": "English", + "arabic": "عربي", + "login": "Login", + "drSulaiman": "Dr Sulaiman Al Habib", + "welcomeTo": "Welcome to", + "userID": "User ID", + "password": "Password", + "branch": "Branch", + "pleaseEnterLoginDetails": "Please enter the detail below to login", + "username": "Username", + "welcomeBack": "Welcome back", + "wouldYouLikeToLoginWithCurrentUsername": "Would you like to login with current Username?", + "lastLoginDetails": "Last Login Details:", + "verificationType": "Verification Type:", + "pleaseVerify": "Please Verify", + "pleaseVerifyForBio": "Please verify login with one of the following options", + "verifyThroughFace": "Verify Through Face", + "verifyThroughFingerprint": "Verify Through Fingerprint", + "verifyThroughSMS": "Verify Through SMS", + "verifyThroughWhatsapp": "Verify Through Whatsapp", + "useAnotherAccount": "Use Another Account", + "pleaseEnterTheVerificationCodeSentTo": "Please enter the verification code sent to ", + "theVerificationCodeWillExpireIn": "The verification code will expire in ", + "goodMorning": "Good Morning", + "markAttendance": "Mark Attendance", + "timeLeftToday": "Time Left Today", + "checkIn": "Check In", + "workList": "Work List" +}; +static const Map> mapLocales = {"ar_SA": ar_SA, "en_US": en_US}; } diff --git a/lib/main.dart b/lib/main.dart index e7941d0..a563baa 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -78,7 +78,7 @@ class MyApp extends StatelessWidget { localizationsDelegates: delegates, supportedLocales: context.supportedLocales, locale: context.locale, - initialRoute: AppRoutes.splash, + initialRoute: AppRoutes.login, routes: AppRoutes.routes, ); }, diff --git a/lib/ui/a.dart b/lib/ui/a.dart deleted file mode 100644 index e69de29..0000000 diff --git a/lib/ui/login/login_method_page.dart b/lib/ui/login/login_method_page.dart new file mode 100644 index 0000000..f035aa4 --- /dev/null +++ b/lib/ui/login/login_method_page.dart @@ -0,0 +1,187 @@ +import 'package:easy_localization/easy_localization.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; +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/generated/locale_keys.g.dart'; +import 'package:local_auth/local_auth.dart'; +import 'package:sizer/sizer.dart'; + +// WhatsApp 2 +// SMS 1 +// Face ID 3 +// Finger Print 4 + +class LoginMethodsPage extends StatefulWidget { + const LoginMethodsPage({Key? key}) : super(key: key); + + @override + LoginMethodsPageState createState() => LoginMethodsPageState(); +} + +class LoginMethodsPageState extends State { + final LocalAuthentication localAuth = LocalAuthentication(); + List _availableBioMetricType = []; + + int selectedFlag = 0; + bool isNeedVerifyWithFaceIDAndBiometrics = 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), + ], + ) + ], + ), + ); + } + + Future _getAvailableBiometrics() async { + try { + _availableBioMetricType = await localAuth.getAvailableBiometrics(); + } on PlatformException catch (e) { + // AppToast.showErrorToast(message: e.message); + if (kDebugMode) { + print(e); + } + } + if (mounted) setState(() {}); + } + + Future loginWithFaceIDAndBiometrics() async { + bool authenticated = false; + try { + authenticated = await localAuth.authenticate( + localizedReason: 'Scan your fingerprint to authenticate', + ); + } on PlatformException catch (e) { + if (kDebugMode) { + print(e); + } + Utils.hideLoading(context); + Utils.showToast("Please enable your Touch or Face ID"); + } + return authenticated; + } + + Widget _loginOptionButton(String title, String icon, int flag, int? loginIndex) { + bool isDisable = ((flag == 3 && !checkBiometricIsAvailable(BiometricType.face)) || (flag == 4 && !checkBiometricIsAvailable(BiometricType.fingerprint))); + return InkWell( + onTap: isDisable + ? null + : () async { + if (flag == 0) { + setState(() { + // isMoreOption = true; + }); + } else { + if (flag == 3 || flag == 4) { + bool authenticateWithFaceAndTouchID = await loginWithFaceIDAndBiometrics(); + if (!authenticateWithFaceAndTouchID) { + return; + } else { + isNeedVerifyWithFaceIDAndBiometrics = true; + selectedFlag = flag; + setState(() { + return; + }); + } + } else { + if (isNeedVerifyWithFaceIDAndBiometrics) { + // performApiCall(_title, _icon, selectedFlag, _flag); + + } else { + // performApiCall(_title, _icon, _flag, _flag); + + } + } + } + }, + child: Container( + padding: const EdgeInsets.only(left: 20, right: 20, bottom: 15, top: 28), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: isDisable ? Colors.grey.withOpacity(0.3) : Colors.white, + border: Border.all(color: MyColors.lightGreyEFColor, width: 1), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + SvgPicture.asset( + icon, + height: 38, + width: 38, + color: isDisable ? MyColors.darkTextColor.withOpacity(0.7) : null, + ), + Text( + title, + style: const TextStyle(fontWeight: FontWeight.w600), + ) + ], + ), + ), + ); + } + + Widget getButton(int flag) { + switch (flag) { + case 1: + return _loginOptionButton(LocaleKeys.verifyThroughSMS.tr(), 'assets/images/login/verify_sms.svg', flag, null); + case 2: + return _loginOptionButton(LocaleKeys.verifyThroughWhatsapp.tr(), 'assets/images/login/verify_whatsapp.svg', flag, null); + case 3: + return _loginOptionButton(LocaleKeys.verifyThroughFace.tr(), 'assets/images/login/verify_face.svg', flag, BiometricType.face.index); + case 4: + return _loginOptionButton(LocaleKeys.verifyThroughFingerprint.tr(), 'assets/images/login/verify_thumb.svg', flag, BiometricType.fingerprint.index); + default: + return const SizedBox(); + } + } + + bool checkBiometricIsAvailable(BiometricType biometricType) { + bool isAvailable = false; + for (int i = 0; i < _availableBioMetricType.length; i++) { + if (biometricType == _availableBioMetricType[i]) { + isAvailable = true; + break; + } + } + return isAvailable; + } +} diff --git a/lib/ui/login/login_page.dart b/lib/ui/login/login_page.dart new file mode 100644 index 0000000..ed1a756 --- /dev/null +++ b/lib/ui/login/login_page.dart @@ -0,0 +1,113 @@ +import 'package:easy_localization/easy_localization.dart'; +import 'package:flutter/material.dart'; +import 'package:hmg_nurses/classes/colors.dart'; +import 'package:hmg_nurses/config/routes.dart'; +import 'package:hmg_nurses/generated/locale_keys.g.dart'; +import 'package:hmg_nurses/widgets/button/default_button.dart'; +import 'package:hmg_nurses/widgets/cupertino_picker.dart'; +import 'package:hmg_nurses/widgets/input_widget.dart'; +import 'package:sizer/sizer.dart'; + +class LoginPage extends StatefulWidget { + const LoginPage({Key? key}) : super(key: key); + + @override + State createState() => _LoginPageState(); +} + +class _LoginPageState extends State { + final loginFormKey = GlobalKey(); + var projectIdController = TextEditingController(); + var userIdController = TextEditingController(); + var passwordController = TextEditingController(); + + SizedBox buildSpacer20h() => SizedBox(height: 3.h); + + @override + Widget build(BuildContext context) { + return Scaffold( + body: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox(height: 10.h), + Padding( + padding: EdgeInsets.only(left: 8.w), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + LocaleKeys.welcomeTo.tr(), + style: TextStyle(fontSize: 16.sp, fontWeight: FontWeight.w600, fontFamily: 'Poppins'), + ), + Text( + LocaleKeys.drSulaiman.tr(), + style: TextStyle(color: MyColors.blackColor, fontWeight: FontWeight.bold, fontSize: 24.sp, fontFamily: 'Poppins'), + ), + Text( + "Nurses App", + style: TextStyle(fontSize: 16.sp, fontWeight: FontWeight.w600, color: MyColors.redColor), + ), + ], + ), + ), + SizedBox(height: 4.h), + Form( + key: loginFormKey, + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 8.w), + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + buildSpacer20h(), + CustomTextField( + LocaleKeys.userID.tr(), + userIdController, + isEnableBorder: true, + ), + buildSpacer20h(), + CustomTextField( + LocaleKeys.password.tr(), + passwordController, + isTextIsPassword: true, + ), + buildSpacer20h(), + CustomTextField( + LocaleKeys.branch.tr(), + projectIdController, + hasSelection: true, + isEnable: false, + onClick: () { + CustomCupertinoPicker.showCupertinoPicker(context, [], (){}); + }, + ), + buildSpacer20h() + ]), + ), + ) + ], + ), + ), + bottomSheet: Container( + height: 12.h, + color: MyColors.backgroundColor, + width: double.infinity, + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Padding( + padding: EdgeInsets.symmetric(horizontal: 4.w), + child: DefaultButton(LocaleKeys.login.tr(), () { + Navigator.pushNamed(context, AppRoutes.loginMethodsPage); + }, colors: const [MyColors.redColor, MyColors.redColor]), + ), + SizedBox(height: 3.h) + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/widgets/cupertino_picker.dart b/lib/widgets/cupertino_picker.dart new file mode 100644 index 0000000..c45ef8b --- /dev/null +++ b/lib/widgets/cupertino_picker.dart @@ -0,0 +1,71 @@ +import 'package:easy_localization/easy_localization.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hmg_nurses/generated/locale_keys.g.dart'; +import 'package:sizer/sizer.dart'; + +class CustomCupertinoPicker { + static TextStyle textStyle(context) => TextStyle(color: Theme.of(context).primaryColor); + + static int cupertinoPickerIndex = 0; + + static buildPickerItems(context, List items, onSelectFun) { + return CupertinoPicker( + magnification: 1.5, + scrollController: FixedExtentScrollController(initialItem: cupertinoPickerIndex), + itemExtent: 25, + looping: false, + onSelectedItemChanged: (int index) { + cupertinoPickerIndex = index; + }, + children: items.map((item) { + return Text( + '${item.facilityName}', + style: TextStyle(fontSize: 12.sp), + ); + }).toList(), + ); + } + + static showCupertinoPicker(context, List items, onSelectFun) { + showModalBottomSheet( + isDismissible: false, + context: context, + builder: (BuildContext builder) { + return Container( + height: 40.h, + color: const Color(0xfff7f7f7), + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Container( + color: const Color(0xfff7f7f7), + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + CupertinoButton( + child: Text(LocaleKeys.userID.tr(), style: textStyle(context)), + onPressed: () { + Navigator.pop(context); + }, + ), + CupertinoButton( + child: Text( + LocaleKeys.userID.tr(), + style: textStyle(context), + ), + onPressed: () { + Navigator.pop(context); + onSelectFun(cupertinoPickerIndex); + }, + ) + ], + ), + ), + Container(height: 3.h, color: const Color(0xfff7f7f7), child: buildPickerItems(context, items, onSelectFun)) + ], + ), + ); + }); + } +} diff --git a/lib/widgets/input_widget.dart b/lib/widgets/input_widget.dart index 45d1417..a810fd1 100644 --- a/lib/widgets/input_widget.dart +++ b/lib/widgets/input_widget.dart @@ -2,10 +2,11 @@ import 'package:flutter/material.dart'; import 'package:hmg_nurses/classes/colors.dart'; import 'package:hmg_nurses/extensions/int_extensions.dart'; import 'package:hmg_nurses/extensions/widget_extensions.dart'; +import 'package:sizer/sizer.dart'; -class InputWidget extends StatefulWidget { +class CustomTextField extends StatefulWidget { final String labelText; - final String hintText; + final String? hintText; final TextEditingController controller; final VoidCallback? suffixTap; final bool isEnable; @@ -18,19 +19,21 @@ class InputWidget extends StatefulWidget { final double verticalPadding; final double horizontalPadding; final Function(String)? onChange; + final Function? onClick; - InputWidget( + const CustomTextField( this.labelText, - this.hintText, this.controller, { Key? key, this.isTextIsPassword = false, this.suffixTap, + this.hintText, this.isEnable = true, this.hasSelection = false, this.isEnableBorder = true, this.lines = 1, this.onChange, + this.onClick, this.isInputTypeNum = false, this.isBackgroundEnable = false, this.verticalPadding = 15, @@ -38,12 +41,10 @@ class InputWidget extends StatefulWidget { }) : super(key: key); @override - _InputWidgetState createState() { - return _InputWidgetState(); - } + CustomTextFieldState createState() => CustomTextFieldState(); } -class _InputWidgetState extends State { +class CustomTextFieldState extends State { late bool isObscureText; @override @@ -64,27 +65,29 @@ class _InputWidgetState extends State { alignment: Alignment.center, decoration: BoxDecoration( borderRadius: BorderRadius.circular(15), - color: widget.isBackgroundEnable ? Color(0xffF7F7F7) : Colors.white, - border: Border.all( - color: widget.isEnableBorder ? Color(0xffefefef) : Colors.transparent, - width: 1, - ), + color: widget.isBackgroundEnable ? const Color(0xffF7F7F7) : Colors.white, + border: Border.all(color: widget.isEnableBorder ? Colors.grey.shade300 : Colors.transparent, width: 1), ), child: InkWell( - onTap: widget.hasSelection ? () {} : null, + onTap: widget.hasSelection + ? () { + widget.onClick!(); + } + : null, child: Row( children: [ Expanded( child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, children: [ Text( widget.labelText, - style: const TextStyle( - fontSize: 11, + style: TextStyle( + fontSize: 9.sp, fontWeight: FontWeight.w600, - color: Color(0xff2B353E), + color: const Color(0xff2B353E), letterSpacing: -0.44, ), ), @@ -133,7 +136,7 @@ class _InputWidgetState extends State { }); }) ], - if (widget.hasSelection) Icon(Icons.keyboard_arrow_down_outlined), + if (widget.hasSelection) const Icon(Icons.keyboard_arrow_down_outlined), ], ), ), diff --git a/pubspec.lock b/pubspec.lock index 72e9cac..3203415 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -116,6 +116,13 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_plugin_android_lifecycle: + dependency: transitive + description: + name: flutter_plugin_android_lifecycle + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.7" flutter_svg: dependency: "direct main" description: @@ -182,6 +189,41 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.1" + local_auth: + dependency: "direct main" + description: + name: local_auth + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.2" + local_auth_android: + dependency: transitive + description: + name: local_auth_android + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.15" + local_auth_ios: + dependency: transitive + description: + name: local_auth_ios + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.10" + local_auth_platform_interface: + dependency: transitive + description: + name: local_auth_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.5" + local_auth_windows: + dependency: transitive + description: + name: local_auth_windows + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.4" logger: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index c593a83..5aaa270 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -49,6 +49,7 @@ dependencies: auto_size_text: ^3.0.0 shimmer: ^2.0.0 sizer: ^2.0.15 + local_auth: ^2.1.2 dev_dependencies: flutter_test: @@ -74,4 +75,25 @@ flutter: assets: - assets/ - - assets/langs/ \ No newline at end of file + - assets/langs/ + - assets/images/login/ + - assets/images/patient/ + + + + fonts: + + - family: Poppins + fonts: + - asset: assets/fonts/Poppins/Poppins-Regular.ttf + weight: 400 + - asset: assets/fonts/Poppins/Poppins-Medium.ttf + weight: 500 + - asset: assets/fonts/Poppins/Poppins-SemiBold.ttf + weight: 600 + - asset: assets/fonts/Poppins/Poppins-Bold.ttf + weight: 700 + - asset: assets/fonts/Poppins/Poppins-Bold.ttf + weight: 800 + - asset: assets/fonts/Poppins/Poppins-Bold.ttf + weight: 900