TF-652 Fix alignment in Destination Picker
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
import 'package:core/core.dart';
|
import 'package:core/core.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_svg/flutter_svg.dart';
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -102,13 +101,21 @@ class DestinationPickerView extends GetWidget<DestinationPickerController>
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildBodyMailboxLocation(BuildContext context, MailboxActions? actions) {
|
Widget _buildBodyMailboxLocation(BuildContext context, MailboxActions? actions) {
|
||||||
return SafeArea(top: _responsiveUtils.isPortraitMobile(context), bottom: false, left: false, right: false,
|
return SafeArea(
|
||||||
|
top: !BuildUtils.isWeb && _responsiveUtils.isPortraitMobile(context),
|
||||||
|
bottom: false,
|
||||||
|
left: false,
|
||||||
|
right: false,
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTap: () => {},
|
onTap: () => {},
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius: BorderRadius.only(
|
borderRadius: BorderRadius.only(
|
||||||
topRight: Radius.circular(_responsiveUtils.isPortraitMobile(context) ? 14 : 0),
|
topRight: Radius.circular(
|
||||||
topLeft: Radius.circular(_responsiveUtils.isPortraitMobile(context) ? 14 : 0)),
|
!BuildUtils.isWeb && _responsiveUtils.isPortraitMobile(context)
|
||||||
|
? 14 : 0),
|
||||||
|
topLeft: Radius.circular(
|
||||||
|
!BuildUtils.isWeb && _responsiveUtils.isPortraitMobile(context)
|
||||||
|
? 14 : 0)),
|
||||||
child: Container(
|
child: Container(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: Column(children: [
|
child: Column(children: [
|
||||||
@@ -188,7 +195,7 @@ class DestinationPickerView extends GetWidget<DestinationPickerController>
|
|||||||
if (actions == MailboxActions.create) const SizedBox(height: 12),
|
if (actions == MailboxActions.create) const SizedBox(height: 12),
|
||||||
if (actions != MailboxActions.create && !BuildUtils.isWeb)
|
if (actions != MailboxActions.create && !BuildUtils.isWeb)
|
||||||
const Padding(
|
const Padding(
|
||||||
padding: EdgeInsets.only(left: 60),
|
padding: EdgeInsets.only(left: 55, right: 20),
|
||||||
child: Divider(color: AppColor.lineItemListColor, height: 0.5, thickness: 0.2)),
|
child: Divider(color: AppColor.lineItemListColor, height: 0.5, thickness: 0.2)),
|
||||||
Obx(() => controller.folderMailboxHasChild
|
Obx(() => controller.folderMailboxHasChild
|
||||||
? _buildMailboxCategory(context, MailboxCategories.folders, controller.folderRootNode, actions)
|
? _buildMailboxCategory(context, MailboxCategories.folders, controller.folderRootNode, actions)
|
||||||
@@ -238,25 +245,39 @@ class DestinationPickerView extends GetWidget<DestinationPickerController>
|
|||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(14), color: Colors.white),
|
decoration: BoxDecoration(borderRadius: BorderRadius.circular(14), color: Colors.white),
|
||||||
margin: EdgeInsets.only(
|
margin: _marginMailboxList(context, actions),
|
||||||
left: actions == MailboxActions.moveEmail
|
padding: _paddingMailboxList(context, actions),
|
||||||
|| actions == MailboxActions.move
|
|
||||||
|| _responsiveUtils.isLandscapeMobile(context)
|
|
||||||
? 0
|
|
||||||
: 16,
|
|
||||||
right: actions == MailboxActions.moveEmail || actions == MailboxActions.move
|
|
||||||
? 0
|
|
||||||
: 16),
|
|
||||||
padding: EdgeInsets.only(
|
|
||||||
top: _responsiveUtils.isDesktop(context) && actions == MailboxActions.create ? 8 : 0,
|
|
||||||
bottom: _responsiveUtils.isDesktop(context) && actions == MailboxActions.create ? 8 : 0,
|
|
||||||
left: _responsiveUtils.isDesktop(context) || actions != MailboxActions.create ? 0 : 12,
|
|
||||||
right: actions == MailboxActions.create ? 8 : 16),
|
|
||||||
child: TreeView(
|
child: TreeView(
|
||||||
key: Key('${categories.keyValue}_mailbox_list'),
|
key: Key('${categories.keyValue}_mailbox_list'),
|
||||||
children: _buildListChildTileWidget(context, mailboxNode, lastNode: lastNode)));
|
children: _buildListChildTileWidget(context, mailboxNode, lastNode: lastNode)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EdgeInsets _marginMailboxList(BuildContext context, MailboxActions? actions) {
|
||||||
|
if (BuildUtils.isWeb) {
|
||||||
|
return EdgeInsets.only(
|
||||||
|
left: actions == MailboxActions.moveEmail
|
||||||
|
|| actions == MailboxActions.move ? 0 : 16,
|
||||||
|
right: actions == MailboxActions.moveEmail
|
||||||
|
|| actions == MailboxActions.move ? 0 : 16);
|
||||||
|
} else {
|
||||||
|
return EdgeInsets.only(
|
||||||
|
left: 16,
|
||||||
|
right: actions == MailboxActions.create ? 16 : 8);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
EdgeInsets _paddingMailboxList(BuildContext context, MailboxActions? actions) {
|
||||||
|
if (BuildUtils.isWeb) {
|
||||||
|
return EdgeInsets.only(
|
||||||
|
left: actions == MailboxActions.create ? 0 : 8,
|
||||||
|
right: actions == MailboxActions.create ? 8 : 16);
|
||||||
|
} else {
|
||||||
|
return EdgeInsets.only(
|
||||||
|
left: actions == MailboxActions.create ? 16 : 8,
|
||||||
|
right: 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
List<Widget> _buildListChildTileWidget(BuildContext context, MailboxNode parentNode, {MailboxNode? lastNode}) {
|
List<Widget> _buildListChildTileWidget(BuildContext context, MailboxNode parentNode, {MailboxNode? lastNode}) {
|
||||||
return parentNode.childrenItems
|
return parentNode.childrenItems
|
||||||
?.map((mailboxNode) => mailboxNode.hasChildren()
|
?.map((mailboxNode) => mailboxNode.hasChildren()
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ class MailboxCreatorView extends GetWidget<MailboxCreatorController> {
|
|||||||
|
|
||||||
Widget _buildBody(BuildContext context) {
|
Widget _buildBody(BuildContext context) {
|
||||||
return SafeArea(
|
return SafeArea(
|
||||||
top: _responsiveUtils.isMobile(context),
|
top: !BuildUtils.isWeb && _responsiveUtils.isPortraitMobile(context),
|
||||||
bottom: false,
|
bottom: false,
|
||||||
left: false,
|
left: false,
|
||||||
right: false,
|
right: false,
|
||||||
@@ -54,8 +54,8 @@ class MailboxCreatorView extends GetWidget<MailboxCreatorController> {
|
|||||||
onTap: () => FocusScope.of(context).unfocus(),
|
onTap: () => FocusScope.of(context).unfocus(),
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius: BorderRadius.only(
|
borderRadius: BorderRadius.only(
|
||||||
topRight: Radius.circular(_responsiveUtils.isMobile(context) ? 14 : 0),
|
topRight: Radius.circular(!BuildUtils.isWeb && _responsiveUtils.isPortraitMobile(context) ? 14 : 0),
|
||||||
topLeft: Radius.circular(_responsiveUtils.isMobile(context) ? 14 : 0)),
|
topLeft: Radius.circular(!BuildUtils.isWeb && _responsiveUtils.isPortraitMobile(context) ? 14 : 0)),
|
||||||
child: Container(
|
child: Container(
|
||||||
color: AppColor.colorBgMailbox,
|
color: AppColor.colorBgMailbox,
|
||||||
child: SafeArea(
|
child: SafeArea(
|
||||||
|
|||||||
Reference in New Issue
Block a user