TF-295 Apply new UI for composer tablet

This commit is contained in:
dab246
2022-03-16 18:31:57 +07:00
committed by Dat H. Pham
parent c751cabd06
commit b0198640a4
2 changed files with 72 additions and 31 deletions
@@ -23,36 +23,76 @@ class ComposerView extends GetWidget<ComposerController> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return WillPopScope( return ResponsiveWidget(
onWillPop: () async { responsiveUtils: responsiveUtils,
controller.saveEmailAsDrafts(context); mobile: WillPopScope(
return true; onWillPop: () async {
}, controller.saveEmailAsDrafts(context);
child: GestureDetector( return true;
onTap: () { },
controller.clearFocusEditor(context); child: GestureDetector(
}, onTap: () {
child: Scaffold( controller.clearFocusEditor(context);
backgroundColor: AppColor.primaryLightColor, },
body: SafeArea( child: Scaffold(
right: responsiveUtils.isMobileDevice(context) && responsiveUtils.isLandscape(context), backgroundColor: AppColor.primaryLightColor,
left: responsiveUtils.isMobileDevice(context) && responsiveUtils.isLandscape(context), body: SafeArea(
child: Container( right: responsiveUtils.isMobileDevice(context) && responsiveUtils.isLandscape(context),
color: Colors.white, left: responsiveUtils.isMobileDevice(context) && responsiveUtils.isLandscape(context),
child: Column(children: [ child: Container(
Obx(() => Padding( color: Colors.white,
padding: EdgeInsets.only(left: 8, right: 8, child: Column(children: [
top: responsiveUtils.isMobileDevice(context) && responsiveUtils.isLandscape(context) ? 16 : 0, Obx(() => Padding(
bottom: responsiveUtils.isMobileDevice(context) && responsiveUtils.isLandscape(context) ? 8 : 0), padding: EdgeInsets.only(left: 8, right: 8,
child: _buildAppBar(context, controller.isEnableEmailSendButton.value, controller.expandModeMobile.value),)), top: responsiveUtils.isMobileDevice(context) && responsiveUtils.isLandscape(context) ? 16 : 0,
Obx(() => controller.expandModeMobile == ExpandMode.COLLAPSE bottom: responsiveUtils.isMobileDevice(context) && responsiveUtils.isLandscape(context) ? 8 : 0),
? Divider(color: AppColor.colorDividerComposer, height: 1) child: _buildAppBar(context, controller.isEnableEmailSendButton.value, controller.expandModeMobile.value),)),
: SizedBox.shrink()), Obx(() => controller.expandModeMobile == ExpandMode.COLLAPSE
Expanded(child: _buildEditorAndAttachments(context)) ? Divider(color: AppColor.colorDividerComposer, height: 1)
]) : SizedBox.shrink()),
) Expanded(child: _buildEditorAndAttachments(context))
), ])
) )
),
)
)
),
tablet: WillPopScope(
onWillPop: () async {
controller.saveEmailAsDrafts(context);
return true;
},
child: GestureDetector(
onTap: () {
controller.clearFocusEditor(context);
},
child: Scaffold(
backgroundColor: Colors.black38,
body: Align(alignment: Alignment.center, child: Card(
color: Colors.transparent,
elevation: 20,
child: Container(
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(10))),
width: responsiveUtils.getSizeWidthScreen(context) * 0.85,
height: responsiveUtils.getSizeHeightScreen(context) * 0.85,
child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(10)),
child: SafeArea(
child: Column(children: [
Obx(() => Padding(
padding: EdgeInsets.only(left: 8, right: 8),
child: _buildAppBar(context, controller.isEnableEmailSendButton.value, controller.expandModeMobile.value),)),
Obx(() => controller.expandModeMobile == ExpandMode.COLLAPSE
? Divider(color: AppColor.colorDividerComposer, height: 1)
: SizedBox.shrink()),
Expanded(child: _buildEditorAndAttachments(context))
])
)
)
)
))
)
)
) )
); );
} }
@@ -249,7 +289,7 @@ class ComposerView extends GetWidget<ComposerController> {
child: _buildAttachmentsList(context, controller.attachments, controller.expandModeAttachments.value)) child: _buildAttachmentsList(context, controller.attachments, controller.expandModeAttachments.value))
: SizedBox.shrink()), : SizedBox.shrink()),
Padding( Padding(
padding: EdgeInsets.symmetric(horizontal: 16), padding: EdgeInsets.only(left: 16, right: 16, bottom: 20),
child: _buildComposerEditor(context)), child: _buildComposerEditor(context)),
]) ])
) )
+1
View File
@@ -48,6 +48,7 @@ class AppPages {
page: () => EmailView()), page: () => EmailView()),
GetPage( GetPage(
name: AppRoutes.COMPOSER, name: AppRoutes.COMPOSER,
opaque: false,
page: () => ComposerView(), page: () => ComposerView(),
binding: ComposerBindings()), binding: ComposerBindings()),
GetPage( GetPage(