From 76aeeffad7246b97fefd8bb79e7744578c7f046d Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Thu, 23 Jul 2020 17:50:41 +0300 Subject: [PATCH] login page changes --- .vscode/launch.json | 13 + android/app/src/main/AndroidManifest.xml | 1 + .../diplomaticquarterapp/MainActivity.kt | 13 +- assets/images/login/101.png | Bin 0 -> 3484 bytes assets/images/login/102.png | Bin 0 -> 3991 bytes assets/images/login/103.png | Bin 0 -> 2377 bytes assets/images/login/104.png | Bin 0 -> 4981 bytes assets/images/login/fileNum.png | Bin 0 -> 1515 bytes assets/images/login/forget.png | Bin 0 -> 1980 bytes assets/images/login/id.png | Bin 0 -> 1308 bytes assets/images/login/nationalID.png | Bin 0 -> 2834 bytes lib/config/localized_values.dart | 26 +- lib/config/shared_pref_kay.dart | 1 + .../check_paitent_authentication_req.dart | 0 .../get_mobile_info_request.dart | 96 +++++ .../get_mobile_info_response.dart | 292 ++++++++++++++ .../select_device_imei_res.dart | 0 .../send_activation_request.dart | 100 +++++ lib/pages/landing/landing_page.dart | 5 +- lib/pages/login/confirm-login.dart | 372 +++++++++++++++--- lib/pages/login/login-type.dart | 12 +- lib/pages/login/login.dart | 133 ++++--- lib/pages/login/register.dart | 17 +- lib/pages/login/welcome.dart | 29 +- .../authentication}/auth_provider.dart | 30 +- lib/uitl/translations_delegate_base.dart | 36 +- lib/widgets/buttons/defaultButton.dart | 26 ++ lib/widgets/drawer/app_drawer_widget.dart | 3 +- pubspec.yaml | 1 + 29 files changed, 1046 insertions(+), 160 deletions(-) create mode 100644 .vscode/launch.json create mode 100644 assets/images/login/101.png create mode 100644 assets/images/login/102.png create mode 100644 assets/images/login/103.png create mode 100644 assets/images/login/104.png create mode 100644 assets/images/login/fileNum.png create mode 100644 assets/images/login/forget.png create mode 100644 assets/images/login/id.png create mode 100644 assets/images/login/nationalID.png rename lib/{core/model/auth => models/Authentication}/check_paitent_authentication_req.dart (100%) create mode 100644 lib/models/Authentication/get_mobile_info_request.dart create mode 100644 lib/models/Authentication/get_mobile_info_response.dart rename lib/{core/model/auth => models/Authentication}/select_device_imei_res.dart (100%) create mode 100644 lib/models/Authentication/send_activation_request.dart rename lib/{providers => services/authentication}/auth_provider.dart (75%) create mode 100644 lib/widgets/buttons/defaultButton.dart diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..3287bb67 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,13 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Flutter", + "request": "launch", + "type": "dart" + } + ] +} \ No newline at end of file diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 02c26fa6..540276ba 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -51,4 +51,5 @@ + diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/MainActivity.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/MainActivity.kt index 7ae40d3f..b8a87c8c 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/MainActivity.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/MainActivity.kt @@ -1,6 +1,11 @@ package com.cloud.diplomaticquarterapp +import androidx.annotation.NonNull; + import io.flutter.embedding.android.FlutterFragmentActivity + import io.flutter.embedding.engine.FlutterEngine + import io.flutter.plugins.GeneratedPluginRegistrant -import io.flutter.embedding.android.FlutterActivity - -class MainActivity: FlutterActivity() { -} +class MainActivity: FlutterFragmentActivity() { + override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) { + GeneratedPluginRegistrant.registerWith(flutterEngine); + } +} \ No newline at end of file diff --git a/assets/images/login/101.png b/assets/images/login/101.png new file mode 100644 index 0000000000000000000000000000000000000000..90c1c575a19e47ad913fbe1e2be3f9182be3f826 GIT binary patch literal 3484 zc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oq@ms}%C zmQH91Qk*T^yr2j})lCisb@N`eZbKS9Lcb^{{tOZU51=bxuQ5&_~ zm@dpD44DI`=By?PTvrr$Jd``49mE|AZ@rNvGv4U-(*_x14c+p^(j_J3VeWwaS|i3J zZfcJDyA?3dk(AgGU8t0DFc#VoYLqzhBx<;EJ6q|7L8=#py7J{Z!`AY8T8pCA>MFkF zOX64L&@|fIe)?3QY ZIgsNVRcpaEn4PP#nej=?ebiaz{{cCP0nY#c literal 0 HcmV?d00001 diff --git a/assets/images/login/103.png b/assets/images/login/103.png new file mode 100644 index 0000000000000000000000000000000000000000..3326814bc80e6682a73f4a36f62f4cbd5b15f36d GIT binary patch literal 2377 zcmaJ@cT`hZ9)1bvMh9FeHrhNAR9qlU2qYMRkkBNE5Rj2(Ade72ib;?FYQV7(P{9$g zuF4=55QgT`22>Df!wf3oAO{uO*Fr4%_8{fU!T52S?aRlY}z1+)gOP zEHcm`X|#kVmhnVFP|L`U5+%r}XjtjzEeOP4Xob>+GQkDI$=PBY0gKmeX)%z={Qsc> z!Ix;MECBkC-v3D~WhIFrTmU2$B}k&-gNwmvQ;8|=5{NAmNmwFL{9+aTV?{ENG*%=A z-QBfSa{{e*@`M~wqIAuLZBuw( z*Fyg)-vXBNRV@U@SFt!)3{HEv|8>}lOR$5q!!Oo_Ctu7D31P=eU~8LCIi3N4CDq<^ zH=N^s8Ds4cK8b(m$_7)nbmh>oA#W>;fzd&iOpEumRzFtDe;bj%JDq;W%+NRF zqy??ahrXRQbH#!s)`eE-nk%pt#ybtH@{Z`|{eGisT|*v!_t@={k2SYy9g`yEzeC9d zwR0&o^~JY}Cxn?E7(};cAPSM{3LwFisQ^kBeAQ48UjHQ4-q&>!oU{^QB7H12&HD&B z<{D3RgxWKG_5)gN88jnRDbN=GbjcoA-{ALg*DT}CpBvXa>lneRe>DQ4Qn*pzw}{A zf~LsA<424Y7c(mP+dr5jtmt~J-xN`}UcIKHtX;X{QdoTJg{;W<0wr=?)E3*(kU`YF zrdXUV2p|!tg=#IKsr;rr47mH{mW+fS?Ceiru!?a!VK>PA(e;9M&= zVzu#(u)Z$Zt#bw2dOP*1w+XW^jFvn}Y`dKOsylKV0fo%!$C+PT-A$^@aoLfS5p?P9 zyn9%;(ZqDbypi+ezud3pKHK|P{hT$de$bt0l`gb8;^OtXZn4eSK*I8-nV5P8e>#+>C+m+g63uCHYj=eYN z-5b(Vv^4AXkr~@z7!jnC&($#7_k^1tt+-amsCT8c*Tw}rtx{h0cYeO7<7Z7mg#%(z zb^f--)ayB7lTAfkrS2nx1Brbzdd`J9j~rAf;WcFln5dVOvcLE3iyuqJQTaDDc0Kz9 zWUZoJq=9d8Y4tEb?uFY^RT+f4QHGfRtR>3bD->I%>zv;7hKWBB)~Vk4xd z1j7NX`;NDTYJT&6e2VMb(JE^#Jz{^Zuh=;`JkF~~{gedhpB8L%3H>%zCvRJ*4zotG z#IO*SMZEBhZ_kS+mp4EZ#o*WEPuUT?(DRuuO0TYexZ>P0ul6YpA8A-ySE)mMf&b~% zv@vM3@?K`39mUM*W?N`&@R>UHM^ZNR*jUBGNlwPg{?zeboDT%&s)Li$;`Y50_yvxy z>E==!gQ&SCk0c|eRWt5UryZRp&Z_*g@vZC}lxwFB$Y;#F^>4v-N?vj?q^$4JDR-Z( zOOVvAF1<5~P&=vy7^K5Dj0$rSTp#;rd=62m6SS_Ff=LOt>%^eZLB-mh6|f8Wz8w+R zUc%{{Je~4*ouN);%EiKV%^@KNTHkG_;IXY&Z`DWfd;CczyXsPGc zyVD%+N}8Xgptkwvkq?%pLFGI9d-f00J*_Kd>w`Z~eGgbp8Q5INFHw$dD&%4+%bL^X z0y)!3Co{&FH~t(=)pbm<)Wag-JM!~Q2_P9y6i7Xw3VFkY99pw DG{ouR literal 0 HcmV?d00001 diff --git a/assets/images/login/104.png b/assets/images/login/104.png new file mode 100644 index 0000000000000000000000000000000000000000..ad55ff74ccab0ca8b0e74beefb641f0d55274f09 GIT binary patch literal 4981 zcmaJ_XH-*L)23JHN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@ylq-> zl$BvhrkzCfGhv~UE3fQxL*T?`%~q=9!zb^)-h{*&e^aiy+7t{=Na8ENH%=p7yd|k| zEllh6Fw<=1!#AZ%K1@bM9Nrpvb)PuN5s7XHaARt2EeMywGw7CehV$7!!ZJC*DZZK| zyp6rO`*JX}qQLHq^Ym0hFUfsFB+{{de}L%>w(T>0!Y6#bEfQJ3V36YhYstSIoVOhn zw)yo5GJL$;dYK(>--?X@pE68iYudxQioD$~tCti6X@KSsQ5mguEPg;Q6ex7i=a~sW zdU|Qb4$?w57GxnoXnC}EmIUzvk7)&1`l*Z*BdxBVLaXgnWtvG{#!(={5KQWy)!+Y= ggC1nd;Ut%c4vU;dXpup4zkY;iYZ$24syf{L4`*Tdl>h($ literal 0 HcmV?d00001 diff --git a/assets/images/login/fileNum.png b/assets/images/login/fileNum.png new file mode 100644 index 0000000000000000000000000000000000000000..386299b71c8891a99fa03ee33616a4045bb7e1a7 GIT binary patch literal 1515 zcmeAS@N?(olHy`uVBq!ia0vp^k|4~%1|*NXY)uAnN?apKg7ec#$`gxH85~pclTsBt za}(23gHjVyDhp4h+AuIMt7V2nltlRYSS9D@>Lr5I=vCwv0Ch7k*w|MTBqnF4mMA2p zrf25aD!t#mUr8Y|#a1cY)Yrhbz&SM|)1#^=HMq(zB)KX(*)m1R-cG@$!U||WZfZ%Q zLPc&)Ua?h$trFN=Dz9|8 z>y;bpKhp88yV>WRp=I1=9MH?=;jqG!%T2VElw`VEGWs$&r<-In3$Ab zT4JjNbScCOxdm`z^NOLt1Pn0!io^naLp=kKmtYEgeeo;J&4sHjE(uCSxEHIz#UYgi zsro^w#rdU0$-sz9QwCX8VC7ttnpl!w6q28x0}I7~jQo=P;*9(P1!reas97jzglFcZ z|Z5PA)9>IEf-+ybD@E~!PCWvMA{Mftf3U~gMx;&h9l zD^ByEdQ)(^#n26>UVWfr^g)q}6xlE#UXa%Gads*vRAZsrY^%^n9k zcf{5=9M^iR@z7VtELDWFc}ms!)#sf3Q^LMiCHPP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aK*IjNs zef`q!TefXmc3t@S^XDtBgeD{=HeS1aJu@NUz}4S(_wgGZVSl{q@ynMlV|gA)-N z+xd4)*s9bsx4R$`m^&sE9N1n}>8@;liX}T-_f6W9WY65>4=2->UhlhlHT3@Nw$qyw zCwko2XJ=;CCb3AUzrSBVh2sqC!kLQ~E3b)*t;^jX&3dhO0Os)=Qv18 z1m!&tt4451Ut&O;y^e?6;{`nJHO*c2NmK0aKGi;^eB-8~j+`N%RJ{INlX=XQAGRmR gbDjS5c|Q{mgUjL{4U(<*w}a|aPgg&ebxsLQ02Xi>SO5S3 literal 0 HcmV?d00001 diff --git a/assets/images/login/id.png b/assets/images/login/id.png new file mode 100644 index 0000000000000000000000000000000000000000..9260cf11180d8e60b98b933e0fc6841698ddac67 GIT binary patch literal 1308 zcmeAS@N?(olHy`uVBq!ia0vp^k|4~%1|*NXY)uAnN?apKg7ec#$`gxH85~pclTsBt za}(23gHjVyDhp4h+AuIMt7V2nltlRYSS9D@>Lr5I=vCwv0Ch7k*w|MTBqnF4mMA2p zrf25aD!t#mUr8Y|#a1cY)Yrhbz&SM|)1#^=HMq(zB)KX(*)m1R-cG@$!U||WZfZ%Q zLPc&)Ua?h$trFN=Dz9|8 z>y;bpKhp88yV>WRp=I1=9MH?=;jqG!%T2VElw`VEGWs$&r<-In3$Ab zT4JjNbScCOxdm`z^NOLt1Pn0!io^naLp=kKmtYEgeeo;J&4sHjE(uCSxEHIz#UYgi zsro^w#rdU0$-sz9QwCX8VC7ttnpl!w6q28x0}I7~jQo=P;*9(P1!reas97jzglFcZ z12bv3duGcJdP9C8bQHoK%2WtOF;xE1B+DuBIhm5JLe z&N$73>P^Az78jg)^?{Dj2SqMYWW$7jDG0=bCtV;1p7>MqfGNHRn6zK^f9z&pVC?a9 zaSW-rmGtNTe|zS&jKa*a46!O=R0koXr7Mcj2q1a^w}S&Whkv=Oj0#rwr5&dwIEf#U`A^ar%?vmqXdoJf*s$P zK2~c;OIz?A(JuHYHeGd6MvdeOM+I+@3r`%Tydo{-?$a-u^su}u!CQO zH{uF6b91k>M2ddL*`6kcJN-wdGdxmK5MzDh?ocDoUdOjZqc_6as4;@ocMVrZWy6e_ z0ngOTc3j!ev60bmh04@pf-wpoxFurFdvprtG)T^Bxms|do}DdR`NAUUDG^Lwp-Wk= zG(1`}N5cCX!$!HNn!U|xi2*AW+LtHH@zU5)vEYl4#xb^E9hzYi&NM|A$wnP(=$h#1 z@TYysCT$KJp00i_>zopr04ad7(EtDd literal 0 HcmV?d00001 diff --git a/assets/images/login/nationalID.png b/assets/images/login/nationalID.png new file mode 100644 index 0000000000000000000000000000000000000000..5779d562ab78bf6196fe63e7ab2f96de3e420700 GIT binary patch literal 2834 zcmaJ@c{r47AC@eG6J~VCa(IoC4q;}DZRVJ4V;LE{&r+%}Gxk}`3z z+3Ta69Q#Sf35i3rp2?CZBeJyU8=dNWe|&xKb-nNJd7kUO@85b|&&%_4citwiAuk~z zu?^>f^%h&w<_nS$f9b*kU$IeVIR>zNXrZil0)s4JN1}z00UU)8M)oEXNC`2&ldUBr zw(3Xt2CxF~ZfGKnVnW!&n6N2yF)Z2$w_#*(cH6mzWquM3JC2djM-TS}Z^zvj_m25=~{I*%;_2U9@<;c?^RBpCGI# z4D|1y0`Q)I1C2oj%uOtei3l@Oz!GJGuz;gX&5Qt3IKmPJw}c^(#&850Zh=OkfX@$9 z?2SPRMSEkNKKl~yFwk%oi;jlD;^X5@;*lmaMi>l%LZM)AQ<$l#u^3^@OrWv|Y-1`@ z?~4MK%p@`*=&T4D71&fHgwSGH7^pbXzf+*lzsgdXpUWgJ7>rGz!w@F$&6K_X@%aA_ zrBJ@2nJjPeKk@!gVWw{aoec9PGik95qPTIPdYi83Xa@$Fz@jmHX|(7sRrCy}v1rV2 z8Xa(O*sPir@RNT8l|+kY8hqm5@n{^C$s$mRWE>U)6|0y;M3B%3E4ZT-!pYpx6oo_} z98q=%q=f_442!aIw1*?@;9s~{8Znkarn0_pN&j#yzRBGj2MS&68B1nF#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RKkz0KK^U53#o0FRpLItt~lW;r~7XTzcZ*&e+$C3<5$>KfI9>-2p`Qokb~2bHf@Ul zL8*J`#@ds4km`bhX7AKg!)Ei&W;13@-L$N+W**y%c;gNiled+RD+?Y^_+c=-@67W+ zwR{n2}wKl zhOSsUsi%6egVXWw(UTQkx6B6-G%UXuRdk0dsP&5tiVp6N8j89bxNYU98`=p49( zG(DZ1>fqWucpcvT`2o@Qno1)DC;`$!mXkD zhvgO+5aQ$m!s9OK!~L>VE|VFRTzH;B`Wd8efQcSr> localizedValues = { 'clinicName': {'en': 'Clinic Name', 'ar': 'اسم العيادة'}, 'doctorName': {'en': 'Doctor Name', 'ar': 'إسم الطبيب'}, 'nearestAppo': {'en': 'Nearest appointment', 'ar': 'أقرب موعد'}, - 'searchByDocText': {'en': 'Type the name of the doctor to help you find him', 'ar': 'اكتب اسم الطبيب لمساعدتك في العثور عليه'}, + 'searchByDocText': { + 'en': 'Type the name of the doctor to help you find him', + 'ar': 'اكتب اسم الطبيب لمساعدتك في العثور عليه' + }, 'enterDocName': {'en': 'Enter Doctor name', 'ar': 'أدخل إسم الطبيب'}, 'search': {'en': 'Search', 'ar': 'بحث'}, 'bookNow': {'en': 'BOOK NOW', 'ar': 'احجز الآن'}, @@ -29,19 +32,23 @@ const Map> localizedValues = { 'gender': {'en': 'Gender', 'ar': 'الجنس'}, 'nationality': {'en': 'nationality', 'ar': 'الجنسية'}, 'docQualifications': {'en': 'Doctor Qualifications', 'ar': 'مؤهلات الطبيب'}, - 'confirmAppoHeading': {'en': 'Kindly confirm your Appointment', 'ar': 'يرجى تأكيد موعدك'}, + 'confirmAppoHeading': { + 'en': 'Kindly confirm your Appointment', + 'ar': 'يرجى تأكيد موعدك' + }, 'patientInfo': {'en': 'Patient Information', 'ar': 'معلومات المريض'}, 'bookSuccess': {'en': 'Book Success', 'ar': 'تم حجز الموعد بنجاح'}, 'patientShare': {'en': 'Patient Share', 'ar': 'المبلغ المستحق'}, - 'patientShareWithTax': {'en': 'Patient Share with Tax', 'ar': 'المبلغ الإجمالي المستحق'}, + 'patientShareWithTax': { + 'en': 'Patient Share with Tax', + 'ar': 'المبلغ الإجمالي المستحق' + }, 'confirmAppo': {'en': 'Confirm Appointment', 'ar': 'تأكيد الموعد'}, 'confirm': {'en': 'Confirm', 'ar': 'تأكيد'}, 'appointment': {'en': 'Appointment', 'ar': 'الموعد'}, 'confirmLater': {'en': 'Confirm Later', 'ar': 'تأكيد لاحقا'}, 'todoList': {'en': 'Todo List', 'ar': 'مهامي'}, 'appoActions': {'en': 'Appointment Actions', 'ar': 'إجراءات الموعد'}, - - 'login': {'en': 'Login', 'ar': 'تسجيل الدخول'}, 'loginregister': {'en': 'Login / Register', 'ar': 'دخولتسجيل'}, 'welcome': {'en': 'Welcome', 'ar': 'أهلا بك'}, @@ -82,5 +89,12 @@ const Map> localizedValues = { "verify-login-with": { "en": "Please choose one of the following options to verify", "ar": "الرجاء اختيار احدى الخيارات التالية للتحقق من البيانات" - } + }, + "register-user": {"en": "Register", "ar": "تسجيل"}, + "verify-with-fingerprint": {"en": "Fingerprint", "ar": "بصمة"}, + "verify-with-faceid": {"en": "Face ID", "ar": "معرف الوجه"}, + "verify-with-sms": {"en": "SMS", "ar": "الرسائل القصيرة"}, + "verify-with-whatsapp": {"en": "Whatsapp", "ar": " الواتس اب"}, + "last-login": {"en": "LAST LOGIN AT:", "ar": "آخر تسجيل دخول"}, + "last-login-with": {"en": "VERIFICATION TYPE:", "ar": "نوع التحقق:"}, }; diff --git a/lib/config/shared_pref_kay.dart b/lib/config/shared_pref_kay.dart index 1e75a802..6826de00 100644 --- a/lib/config/shared_pref_kay.dart +++ b/lib/config/shared_pref_kay.dart @@ -5,3 +5,4 @@ const PUSH_TOKEN = 'push-token'; const REGISTER_DATA_FOR_REGISTER = 'register-data-for-register'; const LOGIN_TOKEN_ID = 'register-data-for-register'; const REGISTER_DATA_FOR_LOGIIN = 'register-data-for-login'; +const LAST_LOGIN = 'last-login'; diff --git a/lib/core/model/auth/check_paitent_authentication_req.dart b/lib/models/Authentication/check_paitent_authentication_req.dart similarity index 100% rename from lib/core/model/auth/check_paitent_authentication_req.dart rename to lib/models/Authentication/check_paitent_authentication_req.dart diff --git a/lib/models/Authentication/get_mobile_info_request.dart b/lib/models/Authentication/get_mobile_info_request.dart new file mode 100644 index 00000000..51a58d88 --- /dev/null +++ b/lib/models/Authentication/get_mobile_info_request.dart @@ -0,0 +1,96 @@ +class GetMobileLoginInfoRequest { + int patientMobileNumber; + String mobileNo; + String deviceToken; + int projectOutSA; + int loginType; + String zipCode; + bool isRegister; + String logInTokenID; + int searchType; + int patientID; + String nationalID; + String patientIdentificationID; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + Null sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + + GetMobileLoginInfoRequest( + {this.patientMobileNumber, + this.mobileNo, + this.deviceToken, + this.projectOutSA, + this.loginType, + this.zipCode, + this.isRegister, + this.logInTokenID, + this.searchType, + this.patientID, + this.nationalID, + this.patientIdentificationID, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID}); + + GetMobileLoginInfoRequest.fromJson(Map json) { + patientMobileNumber = json['PatientMobileNumber']; + mobileNo = json['MobileNo']; + deviceToken = json['DeviceToken']; + projectOutSA = json['ProjectOutSA']; + loginType = json['LoginType']; + zipCode = json['ZipCode']; + isRegister = json['isRegister']; + logInTokenID = json['LogInTokenID']; + searchType = json['SearchType']; + patientID = json['PatientID']; + nationalID = json['NationalID']; + patientIdentificationID = json['PatientIdentificationID']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientMobileNumber'] = this.patientMobileNumber; + data['MobileNo'] = this.mobileNo; + data['DeviceToken'] = this.deviceToken; + data['ProjectOutSA'] = this.projectOutSA; + data['LoginType'] = this.loginType; + data['ZipCode'] = this.zipCode; + data['isRegister'] = this.isRegister; + data['LogInTokenID'] = this.logInTokenID; + data['SearchType'] = this.searchType; + data['PatientID'] = this.patientID; + data['NationalID'] = this.nationalID; + data['PatientIdentificationID'] = this.patientIdentificationID; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + return data; + } +} diff --git a/lib/models/Authentication/get_mobile_info_response.dart b/lib/models/Authentication/get_mobile_info_response.dart new file mode 100644 index 00000000..562c82dd --- /dev/null +++ b/lib/models/Authentication/get_mobile_info_response.dart @@ -0,0 +1,292 @@ +class GetMobileLoginInfoResponse { + Null date; + int languageID; + int serviceName; + Null time; + Null androidLink; + Null authenticationTokenID; + Null data; + bool dataw; + int dietType; + Null errorCode; + Null errorEndUserMessage; + Null errorEndUserMessageN; + Null errorMessage; + int errorType; + int foodCategory; + Null iOSLink; + bool isAuthenticated; + int mealOrderStatus; + int mealType; + int messageStatus; + int numberOfResultRecords; + Null patientBlodType; + Null successMsg; + Null successMsgN; + Null doctorInformationList; + Null getAllPendingRecordsList; + Null getAllSharedRecordsByStatusList; + Null getResponseFileList; + bool isHMGPatient; + bool isLoginSuccessfully; + bool isNeedUpdateIdintificationNo; + bool kioskSendSMS; + Null list; + Null listAskHabibMobileLoginInfo; + Null listAskHabibPatientFile; + Null listMergeFiles; + List listMobileLoginInfo; + Null listPatientCount; + String logInTokenID; + Null mohemmPrivilegeList; + int pateintID; + Null patientBloodType; + bool patientHasFile; + Null patientMergedIDs; + bool patientOutSA; + int patientShareRequestID; + int patientType; + int projectIDOut; + Null returnMessage; + bool sMSLoginRequired; + Null servicePrivilegeList; + Null sharePatientName; + Null verificationCode; + Null email; + Null errorList; + bool hasFile; + bool isActiveCode; + bool isMerged; + bool isNeedUserAgreement; + bool isSMSSent; + Null memberList; + Null message; + int statusCode; + + GetMobileLoginInfoResponse( + {this.date, + this.languageID, + this.serviceName, + this.time, + this.androidLink, + this.authenticationTokenID, + this.data, + this.dataw, + this.dietType, + this.errorCode, + this.errorEndUserMessage, + this.errorEndUserMessageN, + this.errorMessage, + this.errorType, + this.foodCategory, + this.iOSLink, + this.isAuthenticated, + this.mealOrderStatus, + this.mealType, + this.messageStatus, + this.numberOfResultRecords, + this.patientBlodType, + this.successMsg, + this.successMsgN, + this.doctorInformationList, + this.getAllPendingRecordsList, + this.getAllSharedRecordsByStatusList, + this.getResponseFileList, + this.isHMGPatient, + this.isLoginSuccessfully, + this.isNeedUpdateIdintificationNo, + this.kioskSendSMS, + this.list, + this.listAskHabibMobileLoginInfo, + this.listAskHabibPatientFile, + this.listMergeFiles, + this.listMobileLoginInfo, + this.listPatientCount, + this.logInTokenID, + this.mohemmPrivilegeList, + this.pateintID, + this.patientBloodType, + this.patientHasFile, + this.patientMergedIDs, + this.patientOutSA, + this.patientShareRequestID, + this.patientType, + this.projectIDOut, + this.returnMessage, + this.sMSLoginRequired, + this.servicePrivilegeList, + this.sharePatientName, + this.verificationCode, + this.email, + this.errorList, + this.hasFile, + this.isActiveCode, + this.isMerged, + this.isNeedUserAgreement, + this.isSMSSent, + this.memberList, + this.message, + this.statusCode}); + + GetMobileLoginInfoResponse.fromJson(Map json) { + date = json['Date']; + languageID = json['LanguageID']; + serviceName = json['ServiceName']; + time = json['Time']; + androidLink = json['AndroidLink']; + authenticationTokenID = json['AuthenticationTokenID']; + data = json['Data']; + dataw = json['Dataw']; + dietType = json['DietType']; + errorCode = json['ErrorCode']; + errorEndUserMessage = json['ErrorEndUserMessage']; + errorEndUserMessageN = json['ErrorEndUserMessageN']; + errorMessage = json['ErrorMessage']; + errorType = json['ErrorType']; + foodCategory = json['FoodCategory']; + iOSLink = json['IOSLink']; + isAuthenticated = json['IsAuthenticated']; + mealOrderStatus = json['MealOrderStatus']; + mealType = json['MealType']; + messageStatus = json['MessageStatus']; + numberOfResultRecords = json['NumberOfResultRecords']; + patientBlodType = json['PatientBlodType']; + successMsg = json['SuccessMsg']; + successMsgN = json['SuccessMsgN']; + doctorInformationList = json['DoctorInformation_List']; + getAllPendingRecordsList = json['GetAllPendingRecordsList']; + getAllSharedRecordsByStatusList = json['GetAllSharedRecordsByStatusList']; + getResponseFileList = json['GetResponseFileList']; + isHMGPatient = json['IsHMGPatient']; + isLoginSuccessfully = json['IsLoginSuccessfully']; + isNeedUpdateIdintificationNo = json['IsNeedUpdateIdintificationNo']; + kioskSendSMS = json['KioskSendSMS']; + list = json['List']; + listAskHabibMobileLoginInfo = json['List_AskHabibMobileLoginInfo']; + listAskHabibPatientFile = json['List_AskHabibPatientFile']; + listMergeFiles = json['List_MergeFiles']; + if (json['List_MobileLoginInfo'] != null) { + listMobileLoginInfo = new List(); + json['List_MobileLoginInfo'].forEach((v) { + listMobileLoginInfo.add(new ListMobileLoginInfo.fromJson(v)); + }); + } + listPatientCount = json['List_PatientCount']; + logInTokenID = json['LogInTokenID']; + mohemmPrivilegeList = json['MohemmPrivilege_List']; + pateintID = json['PateintID']; + patientBloodType = json['PatientBloodType']; + patientHasFile = json['PatientHasFile']; + patientMergedIDs = json['PatientMergedIDs']; + patientOutSA = json['PatientOutSA']; + patientShareRequestID = json['PatientShareRequestID']; + patientType = json['PatientType']; + projectIDOut = json['ProjectIDOut']; + returnMessage = json['ReturnMessage']; + sMSLoginRequired = json['SMSLoginRequired']; + servicePrivilegeList = json['ServicePrivilege_List']; + sharePatientName = json['SharePatientName']; + verificationCode = json['VerificationCode']; + email = json['email']; + errorList = json['errorList']; + hasFile = json['hasFile']; + isActiveCode = json['isActiveCode']; + isMerged = json['isMerged']; + isNeedUserAgreement = json['isNeedUserAgreement']; + isSMSSent = json['isSMSSent']; + memberList = json['memberList']; + message = json['message']; + statusCode = json['statusCode']; + } + + Map toJson() { + final Map data = new Map(); + data['Date'] = this.date; + data['LanguageID'] = this.languageID; + data['ServiceName'] = this.serviceName; + data['Time'] = this.time; + data['AndroidLink'] = this.androidLink; + data['AuthenticationTokenID'] = this.authenticationTokenID; + data['Data'] = this.data; + data['Dataw'] = this.dataw; + data['DietType'] = this.dietType; + data['ErrorCode'] = this.errorCode; + data['ErrorEndUserMessage'] = this.errorEndUserMessage; + data['ErrorEndUserMessageN'] = this.errorEndUserMessageN; + data['ErrorMessage'] = this.errorMessage; + data['ErrorType'] = this.errorType; + data['FoodCategory'] = this.foodCategory; + data['IOSLink'] = this.iOSLink; + data['IsAuthenticated'] = this.isAuthenticated; + data['MealOrderStatus'] = this.mealOrderStatus; + data['MealType'] = this.mealType; + data['MessageStatus'] = this.messageStatus; + data['NumberOfResultRecords'] = this.numberOfResultRecords; + data['PatientBlodType'] = this.patientBlodType; + data['SuccessMsg'] = this.successMsg; + data['SuccessMsgN'] = this.successMsgN; + data['DoctorInformation_List'] = this.doctorInformationList; + data['GetAllPendingRecordsList'] = this.getAllPendingRecordsList; + data['GetAllSharedRecordsByStatusList'] = + this.getAllSharedRecordsByStatusList; + data['GetResponseFileList'] = this.getResponseFileList; + data['IsHMGPatient'] = this.isHMGPatient; + data['IsLoginSuccessfully'] = this.isLoginSuccessfully; + data['IsNeedUpdateIdintificationNo'] = this.isNeedUpdateIdintificationNo; + data['KioskSendSMS'] = this.kioskSendSMS; + data['List'] = this.list; + data['List_AskHabibMobileLoginInfo'] = this.listAskHabibMobileLoginInfo; + data['List_AskHabibPatientFile'] = this.listAskHabibPatientFile; + data['List_MergeFiles'] = this.listMergeFiles; + if (this.listMobileLoginInfo != null) { + data['List_MobileLoginInfo'] = + this.listMobileLoginInfo.map((v) => v.toJson()).toList(); + } + data['List_PatientCount'] = this.listPatientCount; + data['LogInTokenID'] = this.logInTokenID; + data['MohemmPrivilege_List'] = this.mohemmPrivilegeList; + data['PateintID'] = this.pateintID; + data['PatientBloodType'] = this.patientBloodType; + data['PatientHasFile'] = this.patientHasFile; + data['PatientMergedIDs'] = this.patientMergedIDs; + data['PatientOutSA'] = this.patientOutSA; + data['PatientShareRequestID'] = this.patientShareRequestID; + data['PatientType'] = this.patientType; + data['ProjectIDOut'] = this.projectIDOut; + data['ReturnMessage'] = this.returnMessage; + data['SMSLoginRequired'] = this.sMSLoginRequired; + data['ServicePrivilege_List'] = this.servicePrivilegeList; + data['SharePatientName'] = this.sharePatientName; + data['VerificationCode'] = this.verificationCode; + data['email'] = this.email; + data['errorList'] = this.errorList; + data['hasFile'] = this.hasFile; + data['isActiveCode'] = this.isActiveCode; + data['isMerged'] = this.isMerged; + data['isNeedUserAgreement'] = this.isNeedUserAgreement; + data['isSMSSent'] = this.isSMSSent; + data['memberList'] = this.memberList; + data['message'] = this.message; + data['statusCode'] = this.statusCode; + return data; + } +} + +class ListMobileLoginInfo { + int iD; + int loginType; + + ListMobileLoginInfo({this.iD, this.loginType}); + + ListMobileLoginInfo.fromJson(Map json) { + iD = json['ID']; + loginType = json['LoginType']; + } + + Map toJson() { + final Map data = new Map(); + data['ID'] = this.iD; + data['LoginType'] = this.loginType; + return data; + } +} diff --git a/lib/core/model/auth/select_device_imei_res.dart b/lib/models/Authentication/select_device_imei_res.dart similarity index 100% rename from lib/core/model/auth/select_device_imei_res.dart rename to lib/models/Authentication/select_device_imei_res.dart diff --git a/lib/models/Authentication/send_activation_request.dart b/lib/models/Authentication/send_activation_request.dart new file mode 100644 index 00000000..804f6ef0 --- /dev/null +++ b/lib/models/Authentication/send_activation_request.dart @@ -0,0 +1,100 @@ +class SendActivationRequest { + int patientMobileNumber; + String mobileNo; + String deviceToken; + int projectOutSA; + int loginType; + String zipCode; + bool isRegister; + String logInTokenID; + int searchType; + int patientID; + String nationalID; + String patientIdentificationID; + int oTPSendType; + int languageID; + double versionID; + int channel; + String iPAdress; + String generalid; + int patientOutSA; + Null sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + + SendActivationRequest( + {this.patientMobileNumber, + this.mobileNo, + this.deviceToken, + this.projectOutSA, + this.loginType, + this.zipCode, + this.isRegister, + this.logInTokenID, + this.searchType, + this.patientID, + this.nationalID, + this.patientIdentificationID, + this.oTPSendType, + this.languageID, + this.versionID, + this.channel, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID}); + + SendActivationRequest.fromJson(Map json) { + patientMobileNumber = json['PatientMobileNumber']; + mobileNo = json['MobileNo']; + deviceToken = json['DeviceToken']; + projectOutSA = json['ProjectOutSA']; + loginType = json['LoginType']; + zipCode = json['ZipCode']; + isRegister = json['isRegister']; + logInTokenID = json['LogInTokenID']; + searchType = json['SearchType']; + patientID = json['PatientID']; + nationalID = json['NationalID']; + patientIdentificationID = json['PatientIdentificationID']; + oTPSendType = json['OTP_SendType']; + languageID = json['LanguageID']; + versionID = json['VersionID']; + channel = json['Channel']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientMobileNumber'] = this.patientMobileNumber; + data['MobileNo'] = this.mobileNo; + data['DeviceToken'] = this.deviceToken; + data['ProjectOutSA'] = this.projectOutSA; + data['LoginType'] = this.loginType; + data['ZipCode'] = this.zipCode; + data['isRegister'] = this.isRegister; + data['LogInTokenID'] = this.logInTokenID; + data['SearchType'] = this.searchType; + data['PatientID'] = this.patientID; + data['NationalID'] = this.nationalID; + data['PatientIdentificationID'] = this.patientIdentificationID; + data['OTP_SendType'] = this.oTPSendType; + data['LanguageID'] = this.languageID; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + return data; + } +} diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 3b02024d..ab2ada4c 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -1,8 +1,9 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; -import 'package:diplomaticquarterapp/core/model/auth/select_device_imei_res.dart'; +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart'; import 'package:diplomaticquarterapp/pages/landing/replay_page.dart'; -import 'package:diplomaticquarterapp/providers/auth_provider.dart'; +import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart'; import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart'; diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index d6552883..afbc5915 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -1,4 +1,11 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart'; +import 'package:diplomaticquarterapp/models/Authentication/get_mobile_info_request.dart'; +import 'package:diplomaticquarterapp/models/Authentication/get_mobile_info_response.dart'; +import 'package:diplomaticquarterapp/models/Authentication/send_activation_request.dart'; +import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -6,9 +13,48 @@ import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/routes.dart'; +import 'package:flutter/services.dart'; +import 'package:local_auth/local_auth.dart'; -class ConfirmLogin extends StatelessWidget { - static int loginType = 0; +class ConfirmLogin extends StatefulWidget { + @override + _ConfirmLogin createState() => _ConfirmLogin(); +} + +class _ConfirmLogin extends State { + final LocalAuthentication auth = LocalAuthentication(); + List _availableBiometrics; + var sharedPref = new AppSharedPreferences(); + bool authenticated; + final authService = new AuthProvider(); + int mobileNumber; + + var user; + + CheckPatientAuthenticationReq registerd_data; + + var zipCode; + + var patientOutSA; + + var loginTokenID; + + var loginType; + + var deviceToken; + + var lastLogin; + + int selectedOption; + + bool onlySMSBox; + + @override + void initState() { + _getAvailableBiometrics(); + setDefault(); + super.initState(); + } @override Widget build(BuildContext context) { @@ -19,29 +65,43 @@ class ConfirmLogin extends StatelessWidget { padding: EdgeInsets.all(20), child: Column( children: [ + Expanded( + flex: 3, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Image.asset( + 'assets/images/habib-logo.png', + height: 80, + width: 80, + ), + AppText( + TranslationBase.of(context).verifyLoginWith, + fontSize: SizeConfig.textMultiplier * 3.5, + textAlign: TextAlign.left, + ), + ])), Expanded( flex: 4, child: Column( mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Image.asset( - 'assets/images/habib-logo.png', - height: 80, - width: 80, - ), - AppText( - TranslationBase.of(context).verifyLoginWith, - fontSize: SizeConfig.textMultiplier * 3.5, - textAlign: TextAlign.left, - ), Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Expanded( child: InkWell( - onTap: () => {}, + onTap: () => { + authenticateUser( + 3, BiometricType.face.index) + }, child: RoundedContainer( + backgroundColor: + BiometricType.face.index == 1 + ? Colors.white + : Colors.white.withOpacity(.7), borderColor: Colors.grey, showBorder: true, child: Padding( @@ -52,20 +112,20 @@ class ConfirmLogin extends StatelessWidget { MainAxisAlignment.center, children: [ Image.asset( - 'assets/images/id_card_icon.png', + 'assets/images/login/101.png', height: SizeConfig .imageSizeMultiplier * - 12, + 13, width: SizeConfig .imageSizeMultiplier * - 15, + 16, ), SizedBox( height: 20, ), AppText( TranslationBase.of(context) - .nationalID, + .verifyFaceID, fontSize: SizeConfig.textMultiplier * 2, @@ -75,8 +135,15 @@ class ConfirmLogin extends StatelessWidget { )))), Expanded( child: InkWell( - onTap: () => {}, + onTap: () => { + authenticateUser(2, + BiometricType.fingerprint.index) + }, child: RoundedContainer( + backgroundColor: + BiometricType.fingerprint.index == 1 + ? Colors.white + : Colors.white.withOpacity(.7), borderColor: Colors.grey, showBorder: true, child: Padding( @@ -85,20 +152,20 @@ class ConfirmLogin extends StatelessWidget { child: Column( children: [ Image.asset( - 'assets/images/my_file_white_icon.png', + 'assets/images/login/102.png', height: SizeConfig .imageSizeMultiplier * - 12, + 13, width: SizeConfig .imageSizeMultiplier * - 15, + 16, ), SizedBox( height: 20, ), AppText( TranslationBase.of(context) - .fileNo, + .verifyFingerprint, fontSize: SizeConfig.textMultiplier * 2, @@ -108,18 +175,79 @@ class ConfirmLogin extends StatelessWidget { )))) ], ), - Divider( - color: Colors.grey, - height: 2, + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: InkWell( + onTap: () => {authenticateUser(1, true)}, + child: RoundedContainer( + borderColor: Colors.grey, + showBorder: true, + child: Padding( + padding: EdgeInsets.fromLTRB( + 20, 10, 20, 10), + child: Column( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Image.asset( + 'assets/images/login/103.png', + height: SizeConfig + .imageSizeMultiplier * + 13, + width: SizeConfig + .imageSizeMultiplier * + 16, + ), + SizedBox( + height: 20, + ), + AppText( + TranslationBase.of(context) + .verifySMS, + fontSize: + SizeConfig.textMultiplier * + 2, + ) + ], + ), + )))), + Expanded( + child: InkWell( + onTap: () => {authenticateUser(4, true)}, + child: RoundedContainer( + borderColor: Colors.grey, + showBorder: true, + child: Padding( + padding: EdgeInsets.fromLTRB( + 25, 10, 25, 10), + child: Column( + children: [ + Image.asset( + 'assets/images/login/104.png', + height: SizeConfig + .imageSizeMultiplier * + 13, + width: SizeConfig + .imageSizeMultiplier * + 16, + ), + SizedBox( + height: 20, + ), + AppText( + TranslationBase.of(context) + .verifyWhatsApp, + fontSize: + SizeConfig.textMultiplier * + 2, + ) + ], + ), + )))) + ], ), - Center( - child: InkWell( - onTap: () => {}, - child: AppText( - TranslationBase.of(context).forgotPassword, - fontSize: SizeConfig.textMultiplier * 3, - margin: 10, - underline: true))) ]), ), Expanded( @@ -127,25 +255,171 @@ class ConfirmLogin extends StatelessWidget { child: Column( mainAxisAlignment: MainAxisAlignment.end, children: [ - Row( - children: [ - Expanded( - child: RaisedButton( - color: Colors.grey, - textColor: Colors.white, - child: - Text(TranslationBase.of(context).registerNow), - onPressed: () => { - Navigator.of(context).pushNamed( - REGISTER, - ) - }, - )) - ], - ), + // Row( + // children: [ + // Expanded( + // child: RaisedButton( + // color: Colors.grey, + // textColor: Colors.white, + // child: + // Text(TranslationBase.of(context).registerNow), + // onPressed: () => { + // Navigator.of(context).pushNamed( + // REGISTER, + // ) + // }, + // )) + // ], + // ), ], )) ], ))); } + + Future _getAvailableBiometrics() async { + List availableBiometrics; + try { + availableBiometrics = await auth.getAvailableBiometrics(); + } on PlatformException catch (e) { + print(e); + } + if (!mounted) return; + + setState(() { + _availableBiometrics = availableBiometrics; + print(_availableBiometrics); + }); + } + + authenticateUser(type, isActive) { + this.selectedOption = + type; //this.selectedOption && !this.onlySMSBox ? this.selectedOption : this.fingrePrintBefore ? this.fingrePrintBefore : el.value; + + switch (type) { + case 1: + this.loginWithSMS(type, isActive); + break; + case 2: + this.loginWithFingurePrintFace(type, isActive); + break; + case 3: + this.loginWithFingurePrintFace(type, isActive); + break; + case 4: + this.loginWithWhatsapp(type, isActive); + break; + default: + break; + } + sharedPref.setInt(LAST_LOGIN, + type); //this.cs.sharedService.setStorage(this.selectedOption, AuthenticationService.LAST_LOGIN); + } + + loginWithSMS(type, isActive) {} + loginWithFingurePrintFace(type, isActive) async { + if (isActive == 1) { + // this.startBiometricLoginIfAvailable(); + authenticated = await auth.authenticateWithBiometrics( + localizedReason: 'Scan your fingerprint to authenticate', + useErrorDialogs: true, + stickyAuth: true); + print(authenticated); + if (authenticated == true) { + var request = this.getCommonRequest(); + this.getMobileInfo(request); + } + } + } + + loginWithWhatsapp(type, isActive) {} + getMobileInfo(request) { + this + .authService + .getLoginInfo(request) + .then((GetMobileLoginInfoResponse result) => { + if (!result.sMSLoginRequired) + { + this.loginTokenID = result.logInTokenID, + this.patientOutSA = result.patientOutSA, + // sms for register the biometric + if (result.isSMSSent) + { + this.onlySMSBox = false, + //this.button(); + } + else + { + //this.checkActivationCode(); + } + } + else + { + if (result.isAuthenticated) + { + // this.onlySMSBox = false; + // this.cs.sharedService.setSharedData(true, AuthenticationService.ONLY_SMS); + // this.cs.sharedService.setSharedData(this.selectedOption, AuthenticationService.FINGUREPRINT_BEFORE); + // this.cs.confirmLogin(); + // this.button(); + } + else + { + // this.cs.presentAlert(result.ErrorEndUserMessage); + } + } + }); + } + + setDefault() async { + // this.user = this.cs.sharedService.getSharedData( + // AuthenticationService.IMEI_USER_DATA, + // false + // ); + this.registerd_data = await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN); + this.mobileNumber = this.registerd_data != null + ? this.registerd_data.patientMobileNumber + : int.parse(this.user.Mobile); + this.zipCode = this.registerd_data != null + ? this.registerd_data.zipCode + : this.user.OutSA ? "971" : "966"; + this.patientOutSA = this.registerd_data != null + ? this.registerd_data.zipCode == "966" ? 0 : 1 + : this.user.OutSA; + if (this.registerd_data != null) { + this.loginTokenID = sharedPref.getString(LOGIN_TOKEN_ID); + this.loginType = this.registerd_data.searchType; + } + this.deviceToken = sharedPref.getString(PUSH_TOKEN); + this.lastLogin = sharedPref.getInt( + LAST_LOGIN); //this.cs.sharedService.getStorage(AuthenticationService.LAST_LOGIN); + } + + getCommonRequest() { + var request = SendActivationRequest(); + request.patientMobileNumber = this.mobileNumber; + request.mobileNo = '0' + this.mobileNumber.toString(); + request.deviceToken = this.deviceToken; + request.projectOutSA = this.patientOutSA; + request.loginType = this.selectedOption; + request.zipCode = this.zipCode; + request.isRegister = false; + request.logInTokenID = this.loginTokenID ?? ""; + if (this.registerd_data != null) { + request.searchType = this.registerd_data.searchType == 1 + ? this.registerd_data.searchType + : 1; + request.patientID = this.registerd_data.patientID != 0 + ? this.registerd_data.patientID + : 0; + request.patientIdentificationID = + request.nationalID = this.registerd_data.patientIdentificationID; + } else { + request.searchType = request.searchType == 1 ? request.searchType : 2; + request.patientID = int.parse(this.user.PatientID); + request.patientID = request.nationalID = + request.nationalID != null ? request.nationalID : 0; + } + return request; + } } diff --git a/lib/pages/login/login-type.dart b/lib/pages/login/login-type.dart index c0697099..7a8a940d 100644 --- a/lib/pages/login/login-type.dart +++ b/lib/pages/login/login-type.dart @@ -1,5 +1,6 @@ import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; @@ -128,7 +129,7 @@ class LoginType extends StatelessWidget { }, child: AppText( TranslationBase.of(context).forgotPassword, - fontSize: SizeConfig.textMultiplier * 3, + fontSize: SizeConfig.textMultiplier * 2.5, margin: 10, underline: true))) ]), @@ -141,12 +142,9 @@ class LoginType extends StatelessWidget { Row( children: [ Expanded( - child: RaisedButton( - color: Colors.grey, - textColor: Colors.white, - child: - Text(TranslationBase.of(context).registerNow), - onPressed: () => { + child: DefaultButton( + TranslationBase.of(context).registerNow, + () => { Navigator.of(context).pushNamed( REGISTER, ) diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index ad88371b..982d75e3 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -1,18 +1,20 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/size_config.dart'; -import 'package:diplomaticquarterapp/core/model/auth/check_paitent_authentication_req.dart'; +import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart'; import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart'; import 'package:diplomaticquarterapp/pages/login/login-type.dart'; -import 'package:diplomaticquarterapp/providers/auth_provider.dart'; +import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -31,73 +33,77 @@ class _Login extends State { bool isButtonDisabled = true; final authService = new AuthProvider(); var sharedPref = new AppSharedPreferences(); + bool isLoading = false; @override Widget build(BuildContext context) { return AppScaffold( appBarTitle: TranslationBase.of(context).login, isShowAppBar: true, - body: SingleChildScrollView( - child: Container( - padding: EdgeInsets.only(top: 10, left: 20, right: 20), - height: SizeConfig.realScreenHeight * .8, - width: SizeConfig.realScreenWidth, - child: Column(children: [ - Expanded( - flex: 1, - child: AppText( - TranslationBase.of(context).enterNationalId, - fontSize: SizeConfig.textMultiplier * 3.5, - textAlign: TextAlign.left, - )), - Expanded( - flex: 2, - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - MobileNo( - onNumberChange: (value) => - {mobileNo = value, validateForm()}, - onCountryChange: (value) => countryCode = value), - Container( - child: TextFields( - controller: nationalIDorFile, - onChanged: (value) => {validateForm()}, - prefixIcon: Icon( - loginType == 1 - ? Icons.chrome_reader_mode - : Icons.receipt, - color: Colors.red), - padding: EdgeInsets.only( - top: 20, bottom: 20, left: 10, right: 10), - hintText: loginType == 1 - ? TranslationBase.of(context).nationalID - : TranslationBase.of(context).fileNo, - )) - ], - ), - ), - Expanded( - flex: 2, - child: Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Row( + body: isLoading == true + ? AppCircularProgressIndicator() + : SingleChildScrollView( + child: Container( + padding: + EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 20), + height: SizeConfig.realScreenHeight * .9, + width: SizeConfig.realScreenWidth, + child: Column(children: [ + Expanded( + flex: 1, + child: AppText( + TranslationBase.of(context).enterNationalId, + fontSize: SizeConfig.textMultiplier * 3.5, + textAlign: TextAlign.left, + )), + Expanded( + flex: 2, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ - Expanded( - child: RaisedButton( - color: isButtonDisabled == true - ? Colors.grey - : Colors.grey[600], - textColor: Colors.white, - child: Text(TranslationBase.of(context).login), - onPressed: () => {this.startLogin()}, + MobileNo( + onNumberChange: (value) => + {mobileNo = value, validateForm()}, + onCountryChange: (value) => countryCode = value), + Container( + child: TextFields( + controller: nationalIDorFile, + onChanged: (value) => {validateForm()}, + prefixIcon: Icon( + loginType == 1 + ? Icons.chrome_reader_mode + : Icons.receipt, + color: Colors.red), + padding: EdgeInsets.only( + top: 20, bottom: 20, left: 10, right: 10), + hintText: loginType == 1 + ? TranslationBase.of(context).nationalID + : TranslationBase.of(context).fileNo, )) ], ), - ], - )) - ]), - ))); + ), + Expanded( + flex: 3, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Row( + children: [ + Expanded( + child: DefaultButton( + TranslationBase.of(context).login, + () => {this.startLogin()}, + color: isButtonDisabled == true + ? Colors.grey + : Colors.grey[600], + textColor: Colors.white, + )) + ], + ), + ], + )) + ]), + ))); } startLogin() { @@ -133,6 +139,7 @@ class _Login extends State { } checkUserAuthentication() { + showLoader(true); var request = CheckPatientAuthenticationReq(); request.isRegister = false; request.patientMobileNumber = int.parse(mobileNo); @@ -148,6 +155,7 @@ class _Login extends State { } sharedPref.setObject(REGISTER_DATA_FOR_REGISTER, request); authService.checkPatientAuthentication(request).then((value) => { + showLoader(false), if (value['isSMSSent']) { sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']), @@ -162,4 +170,9 @@ class _Login extends State { } checkActivationCode() {} + showLoader(bool isTrue) { + setState(() { + isLoading = isTrue; + }); + } } diff --git a/lib/pages/login/register.dart b/lib/pages/login/register.dart index 6c58ba72..31a4c4a1 100644 --- a/lib/pages/login/register.dart +++ b/lib/pages/login/register.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/pages/login/login-type.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; @@ -25,19 +26,19 @@ class _Register extends State { @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: TranslationBase.of(context).login, + appBarTitle: TranslationBase.of(context).register, isShowAppBar: true, body: SingleChildScrollView( child: Container( - padding: EdgeInsets.only(top: 10, left: 20, right: 20), - height: SizeConfig.realScreenHeight * .8, + padding: EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 20), + height: SizeConfig.realScreenHeight * .9, width: SizeConfig.realScreenWidth, child: Column(children: [ Expanded( flex: 1, child: AppText( TranslationBase.of(context).enterNationalId, - fontSize: SizeConfig.textMultiplier * 3.5, + fontSize: SizeConfig.textMultiplier * 3, textAlign: TextAlign.left, )), Expanded( @@ -111,11 +112,9 @@ class _Register extends State { Row( children: [ Expanded( - child: RaisedButton( - color: Colors.grey, - textColor: Colors.white, - child: Text(TranslationBase.of(context).login), - onPressed: () => {}, + child: DefaultButton( + TranslationBase.of(context).login, + () => {}, )) ], ), diff --git a/lib/pages/login/welcome.dart b/lib/pages/login/welcome.dart index 978ff449..250f6d34 100644 --- a/lib/pages/login/welcome.dart +++ b/lib/pages/login/welcome.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -17,7 +18,7 @@ class WelcomeLogin extends StatelessWidget { child: Column( children: [ Expanded( - flex: 3, + flex: 4, child: Column( mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.start, @@ -41,35 +42,39 @@ class WelcomeLogin extends StatelessWidget { TranslationBase.of(context).welcomeText2, style: TextStyle(fontSize: 24), textAlign: TextAlign.left, + ), + SizedBox( + height: SizeConfig.realScreenHeight * .2, ) ]), ), Expanded( - flex: 2, + flex: 1, child: Column( - mainAxisAlignment: MainAxisAlignment.end, + // mainAxisAlignment: MainAxisAlignment.end, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( children: [ Expanded( - child: RaisedButton( - color: Colors.red[900], - textColor: Colors.white, - child: Text(TranslationBase.of(context).yes), - onPressed: () => { + child: DefaultButton( + TranslationBase.of(context).yes, + () => { Navigator.of(context).pushNamed( LOGIN_TYPE, - ) + ), }, + color: Colors.red[900], + textColor: Colors.white, )) ], ), Row( children: [ Expanded( - child: RaisedButton( - child: Text(TranslationBase.of(context).no), - onPressed: () => { + child: DefaultButton( + TranslationBase.of(context).no, + () => { Navigator.of(context).pushNamed( REGISTER, ) diff --git a/lib/providers/auth_provider.dart b/lib/services/authentication/auth_provider.dart similarity index 75% rename from lib/providers/auth_provider.dart rename to lib/services/authentication/auth_provider.dart index 3590355b..96548939 100644 --- a/lib/providers/auth_provider.dart +++ b/lib/services/authentication/auth_provider.dart @@ -1,7 +1,9 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; -import 'package:diplomaticquarterapp/core/model/auth/check_paitent_authentication_req.dart'; -import 'package:diplomaticquarterapp/core/model/auth/select_device_imei_res.dart'; +import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart'; +import 'package:diplomaticquarterapp/models/Authentication/get_mobile_info_request.dart'; +import 'package:diplomaticquarterapp/models/Authentication/get_mobile_info_response.dart'; +import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart'; import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -16,6 +18,7 @@ const String SELECT_DEVICE_IMEI = '/Patients.svc/REST/Patient_SELECTDeviceIMEIbyIMEI'; const String CHECK_PATIENT_AUTH = '/Authentication.svc/REST/CheckPatientAuthentication'; +const GET_MOBILE_INFO = '/Authentication.svc/REST/GetMobileLoginInfo'; class AuthProvider with ChangeNotifier { bool isLogin = false; @@ -121,4 +124,27 @@ class AuthProvider with ChangeNotifier { throw error; } } + + Future getLoginInfo( + GetMobileLoginInfoRequest request) async { + request.versionID = VERSION_ID; + request.channel = CHANNEL; + request.iPAdress = IP_ADDRESS; + request.generalid = GENERAL_ID; + request.languageID = 2; + request.patientOutSA = request.zipCode == '966' ? 0 : 1; + try { + dynamic localRes; + await new BaseAppClient().post(GET_MOBILE_INFO, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request.toJson()); + return Future.value(localRes); + } catch (error) { + print(error); + throw error; + } + } } diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index fd452325..237e6988 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -54,9 +54,11 @@ class TranslationBase { String get nearestAppo => localizedValues['nearestAppo'][locale.languageCode]; - String get searchByDocText => localizedValues['searchByDocText'][locale.languageCode]; + String get searchByDocText => + localizedValues['searchByDocText'][locale.languageCode]; - String get enterDocName => localizedValues['enterDocName'][locale.languageCode]; + String get enterDocName => + localizedValues['enterDocName'][locale.languageCode]; String get search => localizedValues['search'][locale.languageCode]; @@ -66,29 +68,35 @@ class TranslationBase { String get appoInfo => localizedValues['appoInfo'][locale.languageCode]; - String get availableAppo => localizedValues['availableAppo'][locale.languageCode]; + String get availableAppo => + localizedValues['availableAppo'][locale.languageCode]; String get gender => localizedValues['gender'][locale.languageCode]; String get nationality => localizedValues['nationality'][locale.languageCode]; - String get docQualifications => localizedValues['docQualifications'][locale.languageCode]; + String get docQualifications => + localizedValues['docQualifications'][locale.languageCode]; - String get confirmAppoHeading => localizedValues['confirmAppoHeading'][locale.languageCode]; + String get confirmAppoHeading => + localizedValues['confirmAppoHeading'][locale.languageCode]; String get patientInfo => localizedValues['patientInfo'][locale.languageCode]; String get bookSuccess => localizedValues['bookSuccess'][locale.languageCode]; - String get patientShare => localizedValues['patientShare'][locale.languageCode]; + String get patientShare => + localizedValues['patientShare'][locale.languageCode]; - String get patientShareWithTax => localizedValues['patientShareWithTax'][locale.languageCode]; + String get patientShareWithTax => + localizedValues['patientShareWithTax'][locale.languageCode]; String get confirmAppo => localizedValues['confirmAppo'][locale.languageCode]; String get confirm => localizedValues['confirm'][locale.languageCode]; - String get confirmLater => localizedValues['confirmLater'][locale.languageCode]; + String get confirmLater => + localizedValues['confirmLater'][locale.languageCode]; String get todoList => localizedValues['todoList'][locale.languageCode]; @@ -124,6 +132,18 @@ class TranslationBase { localizedValues['gregorian-date'][locale.languageCode]; String get verifyLoginWith => localizedValues['verify-login-with'][locale.languageCode]; + String get register => localizedValues['register-user'][locale.languageCode]; + String get verifyFingerprint => + localizedValues['verify-with-fingerprint'][locale.languageCode]; + String get verifyFaceID => + localizedValues['verify-with-faceid'][locale.languageCode]; + String get verifySMS => + localizedValues['verify-with-sms'][locale.languageCode]; + String get verifyWhatsApp => + localizedValues['verify-with-whatsapp'][locale.languageCode]; + String get lastLoginAt => localizedValues['last-login'][locale.languageCode]; + String get lastLoginWith => + localizedValues['last-login-with'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/buttons/defaultButton.dart b/lib/widgets/buttons/defaultButton.dart new file mode 100644 index 00000000..bc56f474 --- /dev/null +++ b/lib/widgets/buttons/defaultButton.dart @@ -0,0 +1,26 @@ +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/material.dart'; + +class DefaultButton extends StatelessWidget { + final String text; + final Function onPress; + final Color textColor; + final Color color; + DefaultButton(this.text, this.onPress, {this.color, this.textColor}); + @override + Widget build(BuildContext context) { + return Container( + height: 60, + child: RaisedButton( + shape: + RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)), + color: color != null ? color : Colors.grey[700], + textColor: color != null ? textColor : Colors.white, + child: Text( + this.text, + style: TextStyle(fontSize: SizeConfig.textMultiplier * 2), + ), + onPressed: () => this.onPress())); + } +} diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index 4a5071d1..24d3bc4f 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -15,7 +15,8 @@ class AppDrawer extends StatefulWidget { class _AppDrawerState extends State { @override Widget build(BuildContext context) { - return FlexibleContainer( + return SizedBox( + width: MediaQuery.of(context).size.width * 0.75, child: Container( color: Colors.white, child: Drawer( diff --git a/pubspec.yaml b/pubspec.yaml index 9a13dcdd..3af9946a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -95,6 +95,7 @@ flutter: assets: - assets/images/ - assets/images/new-design/ + - assets/images/login/ - assets/json/ fonts: