From cc814f4b894b217dca02c9bea7edc6b09c77dcac Mon Sep 17 00:00:00 2001 From: dab246 Date: Wed, 24 Jul 2024 19:10:23 +0700 Subject: [PATCH] TF-2676 Fix lost button at the bottom of identity editor --- .../presentation/identity_creator_view.dart | 163 +++++++++--------- 1 file changed, 86 insertions(+), 77 deletions(-) diff --git a/lib/features/identity_creator/presentation/identity_creator_view.dart b/lib/features/identity_creator/presentation/identity_creator_view.dart index 3d9bca237..fde22bad2 100644 --- a/lib/features/identity_creator/presentation/identity_creator_view.dart +++ b/lib/features/identity_creator/presentation/identity_creator_view.dart @@ -120,55 +120,83 @@ class IdentityCreatorView extends GetWidget const SizedBox(height: 12), if (controller.isMobile(context)) _buildActionButtonMobile(context) - else - _buildActionButtonDesktop(context) ]), ), ); if (PlatformInfo.isWeb) { - return GestureDetector( - onTap: () => controller.clearFocusEditor(context), - child: ResponsiveWidget( - responsiveUtils: controller.responsiveUtils, - mobile: Scaffold( - backgroundColor: Colors.black38, - body: Card( - margin: EdgeInsets.zero, - borderOnForeground: false, - color: Colors.transparent, - child: ClipRRect( - borderRadius: const BorderRadius.only( - topRight: Radius.circular(16), - topLeft: Radius.circular(16)), - child: Container( - decoration: const BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.only( - topRight: Radius.circular(16), - topLeft: Radius.circular(16) + return PointerInterceptor( + child: GestureDetector( + onTap: () => controller.clearFocusEditor(context), + child: ResponsiveWidget( + responsiveUtils: controller.responsiveUtils, + mobile: Scaffold( + backgroundColor: Colors.black38, + body: Card( + margin: EdgeInsets.zero, + borderOnForeground: false, + color: Colors.transparent, + child: ClipRRect( + borderRadius: const BorderRadius.only( + topRight: Radius.circular(16), + topLeft: Radius.circular(16)), + child: Container( + decoration: const BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + topRight: Radius.circular(16), + topLeft: Radius.circular(16) + ), ), + child: Column(children: [ + _buildHeaderView(context), + Expanded(child: bodyCreatorView) + ]), ), - child: Column(children: [ - _buildHeaderView(context), - Expanded(child: PointerInterceptor(child: bodyCreatorView)) - ]), ), ), ), - ), - landscapeMobile: Scaffold( - backgroundColor: Colors.white, - body: Column(children: [ - _buildHeaderView(context), - Expanded(child: PointerInterceptor(child: bodyCreatorView)) - ]) - ), - tablet: Scaffold( - backgroundColor: Colors.black38, - body: Center( - child: Padding( - padding: const EdgeInsetsDirectional.symmetric(horizontal: 24), + landscapeMobile: Scaffold( + backgroundColor: Colors.white, + body: Column(children: [ + _buildHeaderView(context), + Expanded(child: bodyCreatorView) + ]) + ), + tablet: Scaffold( + backgroundColor: Colors.black38, + body: Center( + child: Padding( + padding: const EdgeInsetsDirectional.symmetric(horizontal: 24), + child: Card( + color: Colors.transparent, + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.all(Radius.circular(16)) + ), + child: Container( + decoration: const BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all(Radius.circular(16)) + ), + width: math.max(controller.responsiveUtils.getSizeScreenWidth(context) * 0.4, 700), + height: controller.responsiveUtils.getSizeScreenHeight(context) * 0.8, + child: ClipRRect( + borderRadius: const BorderRadius.all(Radius.circular(16)), + child: Column(children: [ + _buildHeaderView(context), + Expanded(child: bodyCreatorView), + const SizedBox(height: 12), + _buildActionButtonDesktop(context) + ]) + ) + ) + ), + ) + ), + ), + desktop: Scaffold( + backgroundColor: Colors.black38, + body: Center( child: Card( color: Colors.transparent, shape: const RoundedRectangleBorder( @@ -179,46 +207,22 @@ class IdentityCreatorView extends GetWidget color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(16)) ), - width: math.max(controller.responsiveUtils.getSizeScreenWidth(context) * 0.4, 700), + width: math.max(controller.responsiveUtils.getSizeScreenWidth(context) * 0.4, 800), height: controller.responsiveUtils.getSizeScreenHeight(context) * 0.8, child: ClipRRect( borderRadius: const BorderRadius.all(Radius.circular(16)), child: Column(children: [ _buildHeaderView(context), - Expanded(child: PointerInterceptor(child: bodyCreatorView)) + Expanded(child: bodyCreatorView), + const SizedBox(height: 12), + _buildActionButtonDesktop(context) ]) ) ) - ), - ) - ), - ), - desktop: Scaffold( - backgroundColor: Colors.black38, - body: Center( - child: Card( - color: Colors.transparent, - shape: const RoundedRectangleBorder( - borderRadius: BorderRadius.all(Radius.circular(16)) - ), - child: Container( - decoration: const BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all(Radius.circular(16)) - ), - width: math.max(controller.responsiveUtils.getSizeScreenWidth(context) * 0.4, 800), - height: controller.responsiveUtils.getSizeScreenHeight(context) * 0.8, - child: ClipRRect( - borderRadius: const BorderRadius.all(Radius.circular(16)), - child: Column(children: [ - _buildHeaderView(context), - Expanded(child: PointerInterceptor(child: bodyCreatorView)) - ]) - ) ) ) ) - ) + ), ), ); } else { @@ -344,7 +348,9 @@ class IdentityCreatorView extends GetWidget height: controller.responsiveUtils.getSizeScreenHeight(context) * 0.8, child: Column(children: [ _buildHeaderView(context), - Expanded(child: bodyCreatorView) + Expanded(child: bodyCreatorView), + const SizedBox(height: 12), + _buildActionButtonDesktop(context) ]) ) ), @@ -484,14 +490,17 @@ class IdentityCreatorView extends GetWidget } Widget _buildActionButtonDesktop(BuildContext context) { - return Row( - children: [ - Expanded(child: _buildCheckboxIdentityDefault(context)), - const SizedBox(width: 12), - _buildCancelButton(context, width: 156), - const SizedBox(width: 12), - _buildSaveButton(context, width: 156) - ], + return Padding( + padding: const EdgeInsetsDirectional.symmetric(vertical: 12, horizontal: 24), + child: Row( + children: [ + Expanded(child: _buildCheckboxIdentityDefault(context)), + const SizedBox(width: 12), + _buildCancelButton(context, width: 156), + const SizedBox(width: 12), + _buildSaveButton(context, width: 156) + ], + ), ); }