From 362d9425cdcb5377ef875d5e82a285ed9d0a6195 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 24 May 2021 16:10:31 +0300 Subject: [PATCH] fix scrolling in verification --- .../auth/verification_methods_screen.dart | 70 ++++++++++--------- lib/widgets/auth/method_type_card.dart | 14 ++-- .../auth/verification_methods_list.dart | 2 +- .../shared/buttons/app_buttons_widget.dart | 5 +- 4 files changed, 48 insertions(+), 43 deletions(-) diff --git a/lib/screens/auth/verification_methods_screen.dart b/lib/screens/auth/verification_methods_screen.dart index 75d6782c..b6eaa8db 100644 --- a/lib/screens/auth/verification_methods_screen.dart +++ b/lib/screens/auth/verification_methods_screen.dart @@ -71,7 +71,7 @@ class _VerificationMethodsScreenState extends State { // mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ SizedBox( - height: 40, + height: SizeConfig.heightMultiplier * 3, ), if(authenticationViewModel.isFromLogin) InkWell( @@ -85,7 +85,7 @@ class _VerificationMethodsScreenState extends State { Column( children: [ SizedBox( - height: 20, + height: SizeConfig.heightMultiplier*4, ), authenticationViewModel.user != null && isMoreOption == false ? Column( @@ -96,27 +96,27 @@ class _VerificationMethodsScreenState extends State { AppText( TranslationBase.of(context).welcomeBack, - fontSize:12, + fontSize:SizeConfig.getTextMultiplierBasedOnWidth()*4, fontWeight: FontWeight.w700, color: Color(0xFF2B353E), ), AppText( Helpers.capitalize(authenticationViewModel.user.doctorName), - fontSize: 24, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*6, color: Color(0xFF2B353E), fontWeight: FontWeight.bold, ), SizedBox( - height: 20, + height: SizeConfig.heightMultiplier*4, ), AppText( - TranslationBase.of(context).accountInfo , - fontSize: 16, + TranslationBase.of(context).accountInfo , + fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*5, color: Color(0xFF2E303A), fontWeight: FontWeight.w600, ), SizedBox( - height: 20, + height: SizeConfig.heightMultiplier*4 ), Container( padding: EdgeInsets.all(15), @@ -142,7 +142,7 @@ class _VerificationMethodsScreenState extends State { TextOverflow.ellipsis, style: TextStyle( fontFamily: 'Poppins', - fontSize: 16, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *4.5, color: Color(0xFF2E303A), fontWeight: FontWeight.w700,), @@ -153,7 +153,7 @@ class _VerificationMethodsScreenState extends State { TranslationBase .of(context) .verifyWith, - fontSize: 14, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *4.5, color: Color(0xFF575757), fontWeight: FontWeight.w600, ), @@ -162,7 +162,7 @@ class _VerificationMethodsScreenState extends State { authenticationViewModel.user .logInTypeID, context), - fontSize: 14, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *4.5, color: Color(0xFF2B353E), fontWeight: FontWeight.w700, @@ -187,7 +187,7 @@ class _VerificationMethodsScreenState extends State { : '--', textAlign: TextAlign.right, - fontSize: 13, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *4.5, color: Color(0xFF2E303A), fontWeight: FontWeight.w700, ), @@ -206,7 +206,7 @@ class _VerificationMethodsScreenState extends State { : '--', textAlign: TextAlign.right, - fontSize: 14, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *4.5, fontWeight: FontWeight.w600, color: Color(0xFF575757), ) @@ -218,19 +218,25 @@ class _VerificationMethodsScreenState extends State { ), ), SizedBox( - height: 20, + height: SizeConfig.heightMultiplier*3, ), + Row( children: [ + + //todo add translation AppText( "Please Verify", - fontSize: 16, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 5, color: Color(0xFF2B353E), fontWeight: FontWeight.w700, ), ], - ) + ), + SizedBox( + height: SizeConfig.heightMultiplier*2, + ), ], ) : Column( @@ -243,8 +249,8 @@ class _VerificationMethodsScreenState extends State { margin: EdgeInsets.only(bottom: 20, top: 30), child: AppText( TranslationBase.of(context) - .verifyLoginWith, - fontSize: 18, + .verifyLoginWith , + fontSize: SizeConfig.getTextMultiplierBasedOnWidth()* 4 , color: Color(0xFF2E303A), fontWeight: FontWeight.bold, textAlign: TextAlign.left, @@ -254,7 +260,7 @@ class _VerificationMethodsScreenState extends State { TranslationBase.of(context) .verifyFingerprint2, fontSize: - SizeConfig.textMultiplier * 2.5, + SizeConfig.getTextMultiplierBasedOnWidth()* 4, textAlign: TextAlign.start, ), ]), @@ -383,34 +389,32 @@ class _VerificationMethodsScreenState extends State { ), ), bottomSheet: authenticationViewModel.user == null ? SizedBox(height: 0,) : Container( - height: 90, + // color: Colors.green, + height: SizeConfig.heightMultiplier * 10 , width: double.infinity, child: Center( child: FractionallySizedBox( widthFactor: 0.9, child: Column( - mainAxisAlignment: MainAxisAlignment.end, + mainAxisAlignment: MainAxisAlignment.center, children: [ - SecondaryButton( - label: TranslationBase + AppButton( + title: TranslationBase .of(context) .useAnotherAccount, color: Color(0xFFD02127), - //fontWeight: FontWeight.w700, - onTap: () { + + fontWeight: FontWeight.w700, + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightShort? 8 : 6), + hPadding: 1, + + onPressed: () { authenticationViewModel.deleteUser(); authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED); - // Navigator.pushAndRemoveUntil( - // AppGlobal.CONTEX, - // FadePage( - // page: RootPage(), - // ), - // (r) => false); - // Navigator.of(context).pushNamed(LOGIN); }, ), - SizedBox(height: 25,) + // SizedBox(height: SizeConfig.heightMultiplier * (SizeConfig.isHeightShort? 1 : 3),) ], ), ), diff --git a/lib/widgets/auth/method_type_card.dart b/lib/widgets/auth/method_type_card.dart index 6cdaabd8..1945546a 100644 --- a/lib/widgets/auth/method_type_card.dart +++ b/lib/widgets/auth/method_type_card.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -29,19 +30,18 @@ class MethodTypeCard extends StatelessWidget { color: HexColor('#707070'), width: 0.1), ), - height: 170, - child: Padding( - padding: EdgeInsets.fromLTRB(10, 15, 10, 15), + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightShort? 22 : 15), + child: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, children: [ Row( + mainAxisAlignment: MainAxisAlignment.center, children: [ Image.asset( assetPath, - height: 60, - width: 60, + width: SizeConfig.widthMultiplier* 12, ), ], ), @@ -50,7 +50,7 @@ class MethodTypeCard extends StatelessWidget { ), AppText( label, - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth()* 2.5, color: Color(0xFF2E303A), fontWeight: FontWeight.bold, ) diff --git a/lib/widgets/auth/verification_methods_list.dart b/lib/widgets/auth/verification_methods_list.dart index 27dbe8bf..264fefb3 100644 --- a/lib/widgets/auth/verification_methods_list.dart +++ b/lib/widgets/auth/verification_methods_list.dart @@ -89,7 +89,7 @@ class _VerificationMethodsListState extends State { assetPath: 'assets/images/login/more_icon.png', onTap: widget.onShowMore, label: TranslationBase.of(context).moreVerification, - height: 0, + height: 40, ); } } diff --git a/lib/widgets/shared/buttons/app_buttons_widget.dart b/lib/widgets/shared/buttons/app_buttons_widget.dart index ed3e6e98..d2a5b2a0 100644 --- a/lib/widgets/shared/buttons/app_buttons_widget.dart +++ b/lib/widgets/shared/buttons/app_buttons_widget.dart @@ -22,6 +22,7 @@ class AppButton extends StatefulWidget { final double radius; final double vPadding; final double hPadding; + final double height; AppButton({ @required this.onPressed, @@ -39,7 +40,7 @@ class AppButton extends StatefulWidget { this.hPadding = 0, this.radius = 8.0, this.hasBorder = false, - this.borderColor, + this.borderColor, this.height, }); _AppButtonState createState() => _AppButtonState(); @@ -49,7 +50,7 @@ class _AppButtonState extends State { @override Widget build(BuildContext context) { return Container( - // height: MediaQuery.of(context).size.height * 0.075, + height: widget.height, child: IgnorePointer( ignoring: widget.loading ||widget.disabled, child: RawMaterialButton(