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,7 +23,9 @@ class ComposerView extends GetWidget<ComposerController> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return WillPopScope( return ResponsiveWidget(
responsiveUtils: responsiveUtils,
mobile: WillPopScope(
onWillPop: () async { onWillPop: () async {
controller.saveEmailAsDrafts(context); controller.saveEmailAsDrafts(context);
return true; return true;
@@ -54,6 +56,44 @@ class ComposerView extends GetWidget<ComposerController> {
), ),
) )
) )
),
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(