From ab53ca82b18764ee2a1fcdea70dad9ccd07ca20e Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 1 Feb 2021 09:43:43 +0200 Subject: [PATCH] fix colors issues --- lib/pages/login/confirm-login.dart | 37 ++++++++-------- lib/pages/login/login.dart | 11 +++-- lib/widgets/mobile-no/mobile_no.dart | 4 +- lib/widgets/others/not_auh_page.dart | 64 +++++++++++++++++----------- 4 files changed, 68 insertions(+), 48 deletions(-) diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index 646158db..444ce9cd 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -21,6 +21,7 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.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/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/otp/sms-popup.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; @@ -109,11 +110,11 @@ class _ConfirmLogin extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Image.asset( - 'assets/images/DQ/dq_logo_icon.png', + 'assets/images/DQ/logo.png', height: 90, width: 90, ), - AppText( + Texts( TranslationBase.of(context).welcomeBack + ' ' + user.name, @@ -122,7 +123,7 @@ class _ConfirmLogin extends State { SizedBox( height: 20, ), - AppText( + Texts( TranslationBase.of(context).accountInfo, fontSize: SizeConfig.textMultiplier * 2.5, ), @@ -173,17 +174,17 @@ class _ConfirmLogin extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Image.asset( - 'assets/images/DQ/dq_logo_icon.png', + 'assets/images/DQ/logo.png', height: 90, width: 90, ), this.onlySMSBox == false - ? AppText( + ? Texts( TranslationBase.of(context).verifyLoginWith, fontSize: SizeConfig.textMultiplier * 3.5, textAlign: TextAlign.left, ) - : AppText( + : Texts( TranslationBase.of(context) .verifyFingerprint2, fontSize: SizeConfig.textMultiplier * 2.5, @@ -634,7 +635,7 @@ class _ConfirmLogin extends State { return InkWell( onTap: () => {authenticateUser(4, true)}, child: RoundedContainer( - height: 140, + height: 150, borderColor: Colors.grey, showBorder: true, child: Padding( @@ -649,7 +650,7 @@ class _ConfirmLogin extends State { SizedBox( height: 20, ), - AppText( + Texts( TranslationBase.of(context).verifyWhatsApp, fontSize: SizeConfig.textMultiplier * 2, ) @@ -661,7 +662,7 @@ class _ConfirmLogin extends State { return InkWell( onTap: () => {authenticateUser(1, true)}, child: RoundedContainer( - height: 140, + height: 150, borderColor: Colors.grey, showBorder: true, child: Padding( @@ -681,7 +682,7 @@ class _ConfirmLogin extends State { : SizedBox( height: 20, ), - AppText( + Texts( TranslationBase.of(context).verifySMS, fontSize: projectViewModel.isArabic ? SizeConfig.textMultiplier * 1.8 @@ -696,7 +697,7 @@ class _ConfirmLogin extends State { return InkWell( onTap: () => {authenticateUser(2, BiometricType.fingerprint.index)}, child: RoundedContainer( - height: 140, + height: 150, backgroundColor: BiometricType.fingerprint.index == 1 ? Colors.white : Colors.white.withOpacity(.7), @@ -714,7 +715,7 @@ class _ConfirmLogin extends State { SizedBox( height: 20, ), - AppText( + Texts( TranslationBase.of(context).verifyFingerprint, fontSize: SizeConfig.textMultiplier * 2, ) @@ -726,7 +727,7 @@ class _ConfirmLogin extends State { return InkWell( onTap: () => {authenticateUser(3, BiometricType.face.index)}, child: RoundedContainer( - height: 140, + height: 150, backgroundColor: checkIfBiometricAvailable(BiometricType.face) ? Colors.white : Colors.white.withOpacity(.7), @@ -745,7 +746,7 @@ class _ConfirmLogin extends State { SizedBox( height: 20, ), - AppText( + Texts( TranslationBase.of(context).verifyFaceID, fontSize: SizeConfig.textMultiplier * 2, ) @@ -762,7 +763,7 @@ class _ConfirmLogin extends State { }) }, child: RoundedContainer( - height: 140, + height: 150, backgroundColor: BiometricType.fingerprint.index == 1 ? Colors.white : Colors.white.withOpacity(.7), @@ -774,7 +775,7 @@ class _ConfirmLogin extends State { children: [ Image.asset( 'assets/images/login/more_icon.png', - height: SizeConfig.imageSizeMultiplier * 13, + height: 45, width: SizeConfig.imageSizeMultiplier * 16, ), projectViewModel.isArabic @@ -784,9 +785,9 @@ class _ConfirmLogin extends State { : SizedBox( height: 10, ), - AppText( + Texts( TranslationBase.of(context).moreVerification, - fontSize: SizeConfig.textMultiplier * 2, + fontSize: SizeConfig.textMultiplier * 1.8, textAlign: TextAlign.center, ) ], diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index c2a943d2..68649db7 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -18,6 +18,7 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; @@ -29,6 +30,8 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import '../../Constants.dart'; + class Login extends StatefulWidget { @override _Login createState() => _Login(); @@ -82,7 +85,7 @@ class _Login extends State { children: [ Expanded( flex: 2, - child: AppText( + child: Texts( TranslationBase.of(context).enterNationalId, fontSize: SizeConfig.textMultiplier * 3.5, textAlign: TextAlign.start, @@ -92,7 +95,9 @@ class _Login extends State { child: Column( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ - MobileNo(onNumberChange: (value) => {mobileNo = value, validateForm()}, onCountryChange: (value) => countryCode = value), + Directionality( + textDirection: TextDirection.ltr, + child: MobileNo(onNumberChange: (value) => {mobileNo = value, validateForm()}, onCountryChange: (value) => countryCode = value)), Directionality( textDirection: TextDirection.ltr, child: Container( @@ -105,7 +110,7 @@ class _Login extends State { loginType == 1 ? Icons.chrome_reader_mode : Icons.receipt, - color: Color(0xFF40ACC9)), + color: secondaryColor), padding: EdgeInsets.only( top: 20, bottom: 20, left: 10, right: 10), hintText: loginType == 1 diff --git a/lib/widgets/mobile-no/mobile_no.dart b/lib/widgets/mobile-no/mobile_no.dart index 5b963b1f..d088586b 100644 --- a/lib/widgets/mobile-no/mobile_no.dart +++ b/lib/widgets/mobile-no/mobile_no.dart @@ -3,6 +3,8 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import '../../Constants.dart'; + // OWNER : Ibrahim albitar // DATE : 12-04-2020 // DESCRIPTION : Customization for Texts in app @@ -102,7 +104,7 @@ class _MobileNo extends State { flex: 1, child: Icon( Icons.phone, - color: Color(0xFF40ACC9), + color: secondaryColor, )), Expanded( flex: 1, diff --git a/lib/widgets/others/not_auh_page.dart b/lib/widgets/others/not_auh_page.dart index 4bda58a4..88f6cfde 100644 --- a/lib/widgets/others/not_auh_page.dart +++ b/lib/widgets/others/not_auh_page.dart @@ -20,17 +20,17 @@ class NotAutPage extends StatefulWidget { final List infoList; final List imagesInfo; - NotAutPage({@required this.title, @required this.description, this.infoList, this.imagesInfo}); + NotAutPage( + {@required this.title, + @required this.description, + this.infoList, + this.imagesInfo}); @override _NotAutPageState createState() => _NotAutPageState(); } class _NotAutPageState extends State { - - int _current = 0; - - @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); @@ -47,7 +47,6 @@ class _NotAutPageState extends State { bold: true, color: Color(0xff60686b), ), - SizedBox( height: 12, ), @@ -63,7 +62,7 @@ class _NotAutPageState extends State { if (widget.infoList != null) ...List.generate( widget.infoList.length, - (index) => Container( + (index) => Container( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -76,14 +75,21 @@ class _NotAutPageState extends State { borderRadius: BorderRadius.circular(20), color: Theme.of(context).primaryColor), child: Center( - child: Texts('${index+1}',color: Colors.white,), + child: Texts( + '${index + 1}', + color: Colors.white, + ), ), ), - SizedBox(width: 6,), + SizedBox( + width: 6, + ), Expanded(child: Texts('${widget.infoList[index]}')) ], ), - SizedBox(height: 12,), + SizedBox( + height: 12, + ), ], ), ), @@ -91,34 +97,40 @@ class _NotAutPageState extends State { SizedBox( height: 22, ), - if(!projectViewModel.isInternetConnection) - Center( - child: SizedBox( - height: MediaQuery.of(context).size.height * 0.55, - width: MediaQuery.of(context).size.width * 0.50, - child: Image.asset(projectViewModel.isArabic - ? 'assets/images/Wifi-AR.png' - : 'assets/images/wifi-EN.png'), + if (!projectViewModel.isInternetConnection) + Center( + child: SizedBox( + height: MediaQuery.of(context).size.height * 0.55, + width: MediaQuery.of(context).size.width * 0.50, + child: Image.asset(projectViewModel.isArabic + ? 'assets/images/Wifi-AR.png' + : 'assets/images/wifi-EN.png'), + ), ), - ), - if(projectViewModel.isInternetConnection && widget.imagesInfo!=null) + if (projectViewModel.isInternetConnection && + widget.imagesInfo != null) CarouselSlider( items: widget.imagesInfo.map((image) { return Builder( - builder: (BuildContext context){ + builder: (BuildContext context) { return SizedBox( width: MediaQuery.of(context).size.width * 0.50, - child: image.isAsset? Image.asset(projectViewModel.isArabic ? image.imageAr : image.imageEn) : Image.network(projectViewModel.isArabic ? image.imageAr : image.imageEn)); + child: image.isAsset + ? Image.asset(projectViewModel.isArabic + ? image.imageAr + : image.imageEn) + : Image.network(projectViewModel.isArabic + ? image.imageAr + : image.imageEn)); }, ); }).toList(), options: CarouselOptions( height: MediaQuery.of(context).size.height * 0.55, - autoPlay: widget.imagesInfo.length>1, + autoPlay: widget.imagesInfo.length > 1, viewportFraction: 1.0, ), ), - SizedBox( height: 77, ), @@ -133,7 +145,7 @@ class _NotAutPageState extends State { Container( width: MediaQuery.of(context).size.width * 0.9, child: SecondaryButton( - onTap: (){ + onTap: () { loginCheck(context); }, label: TranslationBase.of(context).serviceInformationButton, @@ -145,7 +157,7 @@ class _NotAutPageState extends State { ); } - loginCheck(context) async{ + loginCheck(context) async { var data = await sharedPref.getObject(IMEI_USER_DATA); sharedPref.remove(REGISTER_DATA_FOR_LOGIIN); if (data != null) {