TF-1418 remove bottom padding in identity_creator_view in web

This commit is contained in:
sherlockvn
2023-02-05 18:18:38 +07:00
committed by Dat Vu
parent c80e839c7d
commit 580a0411e1
@@ -8,6 +8,7 @@ import 'package:get/get.dart';
import 'package:html_editor_enhanced/html_editor.dart' as html_editor_browser; import 'package:html_editor_enhanced/html_editor.dart' as html_editor_browser;
import 'package:html_editor_enhanced/html_editor.dart'; import 'package:html_editor_enhanced/html_editor.dart';
import 'package:jmap_dart_client/jmap/mail/email/email_address.dart'; import 'package:jmap_dart_client/jmap/mail/email/email_address.dart';
import 'package:pointer_interceptor/pointer_interceptor.dart';
import 'package:rich_text_composer/views/keyboard_richtext.dart'; import 'package:rich_text_composer/views/keyboard_richtext.dart';
import 'package:rich_text_composer/views/widgets/rich_text_keyboard_toolbar.dart'; import 'package:rich_text_composer/views/widgets/rich_text_keyboard_toolbar.dart';
import 'package:tmail_ui_user/features/composer/presentation/widgets/toolbar_rich_text_builder.dart'; import 'package:tmail_ui_user/features/composer/presentation/widgets/toolbar_rich_text_builder.dart';
@@ -75,17 +76,6 @@ class IdentityCreatorView extends GetWidget<IdentityCreatorController> {
backgroundColor: Colors.black.withAlpha(24), backgroundColor: Colors.black.withAlpha(24),
body: GestureDetector( body: GestureDetector(
onTap: () => controller.clearFocusEditor(context), onTap: () => controller.clearFocusEditor(context),
child: KeyboardRichText(
richTextController: controller.keyboardRichTextController,
keyBroadToolbar: RichTextKeyboardToolBar(
backgroundKeyboardToolBarColor: AppColor.colorBackgroundKeyboard,
richTextController: controller.keyboardRichTextController,
titleQuickStyleBottomSheet: AppLocalizations.of(context).titleQuickStyles,
titleBackgroundBottomSheet: AppLocalizations.of(context).titleBackground,
titleForegroundBottomSheet: AppLocalizations.of(context).titleForeground,
titleFormatBottomSheet: AppLocalizations.of(context).titleFormat,
titleBack: AppLocalizations.of(context).format,
),
child: Center(child: Card( child: Center(child: Card(
color: Colors.transparent, color: Colors.transparent,
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(16))), shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(16))),
@@ -100,25 +90,13 @@ class IdentityCreatorView extends GetWidget<IdentityCreatorController> {
child: _buildBodyMobile(context) child: _buildBodyMobile(context)
) )
) )
)), ))
)
), ),
), ),
tabletLarge: Scaffold( tabletLarge: Scaffold(
backgroundColor: Colors.black.withAlpha(24), backgroundColor: Colors.black.withAlpha(24),
body: GestureDetector( body: GestureDetector(
onTap: () => controller.clearFocusEditor(context), onTap: () => controller.clearFocusEditor(context),
child: KeyboardRichText(
richTextController: controller.keyboardRichTextController,
keyBroadToolbar: RichTextKeyboardToolBar(
backgroundKeyboardToolBarColor: AppColor.colorBackgroundKeyboard,
richTextController: controller.keyboardRichTextController,
titleQuickStyleBottomSheet: AppLocalizations.of(context).titleQuickStyles,
titleBackgroundBottomSheet: AppLocalizations.of(context).titleBackground,
titleForegroundBottomSheet: AppLocalizations.of(context).titleForeground,
titleFormatBottomSheet: AppLocalizations.of(context).titleFormat,
titleBack: AppLocalizations.of(context).format,
),
child: Center(child: Card( child: Center(child: Card(
color: Colors.transparent, color: Colors.transparent,
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(16))), shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(16))),
@@ -133,25 +111,13 @@ class IdentityCreatorView extends GetWidget<IdentityCreatorController> {
child: _buildBodyMobile(context) child: _buildBodyMobile(context)
) )
) )
)), ))
)
) )
), ),
landscapeTablet: Scaffold( landscapeTablet: Scaffold(
backgroundColor: Colors.black.withAlpha(24), backgroundColor: Colors.black.withAlpha(24),
body: GestureDetector( body: GestureDetector(
onTap: () => controller.clearFocusEditor(context), onTap: () => controller.clearFocusEditor(context),
child: KeyboardRichText(
richTextController: controller.keyboardRichTextController,
keyBroadToolbar: RichTextKeyboardToolBar(
backgroundKeyboardToolBarColor: AppColor.colorBackgroundKeyboard,
richTextController: controller.keyboardRichTextController,
titleQuickStyleBottomSheet: AppLocalizations.of(context).titleQuickStyles,
titleBackgroundBottomSheet: AppLocalizations.of(context).titleBackground,
titleForegroundBottomSheet: AppLocalizations.of(context).titleForeground,
titleFormatBottomSheet: AppLocalizations.of(context).titleFormat,
titleBack: AppLocalizations.of(context).format,
),
child: Center(child: Card( child: Center(child: Card(
color: Colors.transparent, color: Colors.transparent,
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(16))), shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(16))),
@@ -166,17 +132,13 @@ class IdentityCreatorView extends GetWidget<IdentityCreatorController> {
child: _buildBodyMobile(context) child: _buildBodyMobile(context)
) )
) )
)), ))
)
) )
), ),
desktop: Scaffold( desktop: Scaffold(
backgroundColor: Colors.black.withAlpha(24), backgroundColor: Colors.black.withAlpha(24),
body: GestureDetector( body: GestureDetector(
onTap: () { onTap: () => controller.clearFocusEditor(context),
controller.clearFocusEditor(context);
debugPrint('${MediaQuery.of(context).size.width}');
},
child: Center(child: Card( child: Center(child: Card(
color: Colors.transparent, color: Colors.transparent,
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(16))), shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(16))),
@@ -198,34 +160,7 @@ class IdentityCreatorView extends GetWidget<IdentityCreatorController> {
} }
Widget _buildBodyMobile(BuildContext context) { Widget _buildBodyMobile(BuildContext context) {
return GestureDetector( final bodyCreatorView = SingleChildScrollView(
onTap: () => controller.clearFocusEditor(context),
child: Stack(
children: [
Column(children: [
Padding(
padding: const EdgeInsets.only(top: 14),
child: Obx(() {
return Text(controller.actionType.value == IdentityActionType.create
? AppLocalizations.of(context).createNewIdentity.inCaps
: AppLocalizations.of(context).edit_identity.inCaps,
style: const TextStyle(fontWeight: FontWeight.bold, fontSize: 20, color: Colors.black));
})),
const SizedBox(height: 8),
Expanded(
child: KeyboardRichText(
keyBroadToolbar: RichTextKeyboardToolBar(
titleBack: AppLocalizations.of(context).titleFormat,
backgroundKeyboardToolBarColor: AppColor.colorBackgroundKeyboard,
isLandScapeMode: _responsiveUtils.isLandscapeMobile(context),
richTextController: controller.keyboardRichTextController,
titleQuickStyleBottomSheet: AppLocalizations.of(context).titleQuickStyles,
titleBackgroundBottomSheet: AppLocalizations.of(context).titleBackground,
titleForegroundBottomSheet: AppLocalizations.of(context).titleForeground,
titleFormatBottomSheet: AppLocalizations.of(context).titleFormat,
),
richTextController: controller.keyboardRichTextController,
child: SingleChildScrollView(
controller: controller.scrollController, controller: controller.scrollController,
physics: const ClampingScrollPhysics(), physics: const ClampingScrollPhysics(),
child: Padding( child: Padding(
@@ -308,8 +243,9 @@ class IdentityCreatorView extends GetWidget<IdentityCreatorController> {
], ],
), ),
const SizedBox(height: 8), const SizedBox(height: 8),
Obx(() => Container( Obx(() => PointerInterceptor(
height: 160, child: Container(
height: 300,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
border: Border.all(color: AppColor.colorInputBorderCreateMailbox), border: Border.all(color: AppColor.colorInputBorderCreateMailbox),
@@ -324,6 +260,7 @@ class IdentityCreatorView extends GetWidget<IdentityCreatorController> {
_buildSignatureHtmlTemplate(context) _buildSignatureHtmlTemplate(context)
] ]
), ),
),
)), )),
if (_responsiveUtils.isTablet(context) || _responsiveUtils.isMobile(context))...[ if (_responsiveUtils.isTablet(context) || _responsiveUtils.isMobile(context))...[
Obx(() => Padding( Obx(() => Padding(
@@ -390,8 +327,38 @@ class IdentityCreatorView extends GetWidget<IdentityCreatorController> {
] ]
]), ]),
), ),
);
return GestureDetector(
onTap: () => controller.clearFocusEditor(context),
child: Stack(
children: [
Column(children: [
Padding(
padding: const EdgeInsets.only(top: 14),
child: Obx(() {
return Text(controller.actionType.value == IdentityActionType.create
? AppLocalizations.of(context).createNewIdentity.inCaps
: AppLocalizations.of(context).edit_identity.inCaps,
style: const TextStyle(fontWeight: FontWeight.bold, fontSize: 20, color: Colors.black));
})),
const SizedBox(height: 8),
Expanded(
child: BuildUtils.isWeb
? PointerInterceptor(child: bodyCreatorView)
: KeyboardRichText(
keyBroadToolbar: RichTextKeyboardToolBar(
titleBack: AppLocalizations.of(context).titleFormat,
backgroundKeyboardToolBarColor: AppColor.colorBackgroundKeyboard,
isLandScapeMode: _responsiveUtils.isLandscapeMobile(context),
richTextController: controller.keyboardRichTextController,
titleQuickStyleBottomSheet: AppLocalizations.of(context).titleQuickStyles,
titleBackgroundBottomSheet: AppLocalizations.of(context).titleBackground,
titleForegroundBottomSheet: AppLocalizations.of(context).titleForeground,
titleFormatBottomSheet: AppLocalizations.of(context).titleFormat,
), ),
), richTextController: controller.keyboardRichTextController,
child: bodyCreatorView),
), ),
]), ]),
Positioned(top: 2, right: 8, Positioned(top: 2, right: 8,