TF-682 Standardize layout of Mailbox Dashboard on web
This commit is contained in:
@@ -84,8 +84,8 @@ class ResponsiveUtils {
|
||||
|
||||
bool hasLeftMenuDrawerActive(BuildContext context) {
|
||||
if (BuildUtils.isWeb) {
|
||||
return isMobile(context) &&
|
||||
isTablet(context) &&
|
||||
return isMobile(context) ||
|
||||
isTablet(context) ||
|
||||
isTabletLarge(context);
|
||||
} else {
|
||||
return true;
|
||||
@@ -94,4 +94,26 @@ class ResponsiveUtils {
|
||||
|
||||
bool isWebDesktop(BuildContext context) =>
|
||||
BuildUtils.isWeb && isDesktop(context);
|
||||
|
||||
bool mailboxDashboardHasMailboxAndEmailView(BuildContext context) {
|
||||
if (BuildUtils.isWeb) {
|
||||
return isDesktop(context) ||
|
||||
isMobile(context) ||
|
||||
isTablet(context);
|
||||
} else {
|
||||
return isPortraitMobile(context) ||
|
||||
isLandscapeMobile(context) ||
|
||||
isTablet(context);
|
||||
}
|
||||
}
|
||||
|
||||
bool mailboxDashboardOnlyHasEmailView(BuildContext context) {
|
||||
if (BuildUtils.isWeb) {
|
||||
return isMobile(context) || isTablet(context);
|
||||
} else {
|
||||
return isPortraitMobile(context) ||
|
||||
isLandscapeMobile(context) ||
|
||||
isTablet(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -122,6 +122,7 @@ class ButtonBuilder {
|
||||
if (_text != null) {
|
||||
return _isVertical!
|
||||
? Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
_buildIcon(),
|
||||
@@ -129,6 +130,7 @@ class ButtonBuilder {
|
||||
if (_iconAction != null) _iconAction!
|
||||
])
|
||||
: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
_buildIcon(),
|
||||
@@ -148,7 +150,7 @@ class ButtonBuilder {
|
||||
return Text(
|
||||
'${_text ?? ''}',
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
overflow: CommonTextStyle.defaultTextOverFlow,
|
||||
style: _textStyle ?? TextStyle(fontSize: 12, color: AppColor.colorTextButton),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -26,30 +26,51 @@ class ResponsiveWidget extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
log('ResponsiveWidget::build(): WIDTH_SIZE: ${responsiveUtils.getDeviceWidth(context)}');
|
||||
|
||||
if (responsiveUtils.isLandscapeMobile(context)) {
|
||||
return landscapeMobile ?? mobile;
|
||||
}
|
||||
if (BuildUtils.isWeb) {
|
||||
|
||||
if (responsiveUtils.isLandscapeTablet(context)) {
|
||||
return landscapeTablet ?? tablet ?? mobile;
|
||||
}
|
||||
if (responsiveUtils.isMobile(context)) {
|
||||
return tablet ?? mobile;
|
||||
}
|
||||
|
||||
if (responsiveUtils.isMobile(context)) {
|
||||
return tablet ?? mobile;
|
||||
}
|
||||
if (responsiveUtils.isTablet(context)) {
|
||||
return tablet ?? mobile;
|
||||
}
|
||||
|
||||
if (responsiveUtils.isTablet(context)) {
|
||||
return tablet ?? mobile;
|
||||
}
|
||||
if (responsiveUtils.isTabletLarge(context)) {
|
||||
return tabletLarge ?? tablet ?? mobile;
|
||||
}
|
||||
|
||||
if (responsiveUtils.isTabletLarge(context)) {
|
||||
return tabletLarge ?? tablet ?? mobile;
|
||||
}
|
||||
if (responsiveUtils.isDesktop(context)) {
|
||||
return desktop ?? tablet ?? mobile;
|
||||
}
|
||||
|
||||
if (responsiveUtils.isDesktop(context)) {
|
||||
return desktop ?? tablet ?? mobile;
|
||||
}
|
||||
return mobile;
|
||||
} else {
|
||||
if (responsiveUtils.isLandscapeMobile(context)) {
|
||||
return landscapeMobile ?? mobile;
|
||||
}
|
||||
|
||||
return mobile;
|
||||
if (responsiveUtils.isLandscapeTablet(context)) {
|
||||
return landscapeTablet ?? tablet ?? mobile;
|
||||
}
|
||||
|
||||
if (responsiveUtils.isMobile(context)) {
|
||||
return tablet ?? mobile;
|
||||
}
|
||||
|
||||
if (responsiveUtils.isTablet(context)) {
|
||||
return tablet ?? mobile;
|
||||
}
|
||||
|
||||
if (responsiveUtils.isTabletLarge(context)) {
|
||||
return tabletLarge ?? tablet ?? mobile;
|
||||
}
|
||||
|
||||
if (responsiveUtils.isDesktop(context)) {
|
||||
return desktop ?? tablet ?? mobile;
|
||||
}
|
||||
|
||||
return mobile;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user