TF-2116 Apply new design for web composer
(cherry picked from commit 1295eb59b2f5abd1095c00ade53c90f7d4f1ecd6)
This commit is contained in:
@@ -1,11 +1,43 @@
|
||||
|
||||
import 'package:core/presentation/extensions/color_extension.dart';
|
||||
import 'package:core/presentation/utils/responsive_utils.dart';
|
||||
import 'package:core/utils/platform_info.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ComposerStyle {
|
||||
static const double radius = 28;
|
||||
|
||||
static const double radius = 24;
|
||||
static const Color borderColor = AppColor.colorLineComposer;
|
||||
static const Color backgroundEditorColor = Colors.white;
|
||||
static const Color richToolbarColor = Colors.white;
|
||||
|
||||
static const EdgeInsetsGeometry richToolbarPadding = EdgeInsetsDirectional.symmetric(horizontal: 24, vertical: 8);
|
||||
static const EdgeInsetsGeometry desktopRecipientPadding = EdgeInsetsDirectional.only(end: 24);
|
||||
static const EdgeInsetsGeometry desktopRecipientMargin = EdgeInsetsDirectional.only(start: 24);
|
||||
static const EdgeInsetsGeometry desktopSubjectMargin = EdgeInsetsDirectional.only(start: 24);
|
||||
static const EdgeInsetsGeometry desktopSubjectPadding = EdgeInsetsDirectional.only(end: 24, top: 12, bottom: 12);
|
||||
static const EdgeInsetsGeometry desktopEditorPadding = EdgeInsetsDirectional.symmetric(horizontal: 20);
|
||||
static const EdgeInsetsGeometry tabletRecipientPadding = EdgeInsetsDirectional.only(end: 24);
|
||||
static const EdgeInsetsGeometry tabletRecipientMargin = EdgeInsetsDirectional.only(start: 24);
|
||||
static const EdgeInsetsGeometry tabletSubjectMargin = EdgeInsetsDirectional.only(start: 24);
|
||||
static const EdgeInsetsGeometry tabletSubjectPadding = EdgeInsetsDirectional.only(end: 24, top: 12, bottom: 12);
|
||||
static const EdgeInsetsGeometry tabletEditorPadding = EdgeInsetsDirectional.symmetric(horizontal: 20);
|
||||
static const EdgeInsetsGeometry mobileRecipientPadding = EdgeInsetsDirectional.only(end: 16);
|
||||
static const EdgeInsetsGeometry mobileRecipientMargin = EdgeInsetsDirectional.only(start: 16);
|
||||
static const EdgeInsetsGeometry mobileSubjectMargin = EdgeInsetsDirectional.only(start: 16);
|
||||
static const EdgeInsetsGeometry mobileSubjectPadding = EdgeInsetsDirectional.only(end: 16, top: 12, bottom: 12);
|
||||
static const EdgeInsetsGeometry mobileEditorPadding = EdgeInsetsDirectional.symmetric(horizontal: 12);
|
||||
|
||||
static const List<BoxShadow> richToolbarShadow = [
|
||||
BoxShadow(
|
||||
color: AppColor.colorShadowBgContentEmail,
|
||||
blurRadius: 24
|
||||
),
|
||||
BoxShadow(
|
||||
color: AppColor.colorShadowBgContentEmail,
|
||||
blurRadius: 2
|
||||
),
|
||||
];
|
||||
|
||||
static EdgeInsetsGeometry getAppBarPadding(BuildContext context, ResponsiveUtils responsiveUtils) {
|
||||
if (responsiveUtils.isPortraitMobile(context) || responsiveUtils.isLandscapeMobile(context)) {
|
||||
@@ -23,38 +55,6 @@ class ComposerStyle {
|
||||
}
|
||||
}
|
||||
|
||||
static EdgeInsetsGeometry getToAddressPadding(BuildContext context, ResponsiveUtils responsiveUtils) {
|
||||
if (PlatformInfo.isWeb) {
|
||||
if (responsiveUtils.isMobile(context)) {
|
||||
return const EdgeInsetsDirectional.only(start: 16, end: 8);
|
||||
} else {
|
||||
return const EdgeInsetsDirectional.symmetric(horizontal: 8);
|
||||
}
|
||||
} else {
|
||||
if (responsiveUtils.isPortraitMobile(context) || responsiveUtils.isLandscapeMobile(context)) {
|
||||
return const EdgeInsetsDirectional.symmetric(horizontal: 16);
|
||||
} else {
|
||||
return const EdgeInsetsDirectional.only(start: 8, end: 16);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static EdgeInsetsGeometry getCcBccAddressPadding(BuildContext context, ResponsiveUtils responsiveUtils) {
|
||||
if (PlatformInfo.isWeb) {
|
||||
if (responsiveUtils.isMobile(context)) {
|
||||
return const EdgeInsetsDirectional.only(start: 16);
|
||||
} else {
|
||||
return const EdgeInsetsDirectional.symmetric(horizontal: 8);
|
||||
}
|
||||
} else {
|
||||
if (responsiveUtils.isPortraitMobile(context) || responsiveUtils.isLandscapeMobile(context)) {
|
||||
return const EdgeInsetsDirectional.only(start: 16);
|
||||
} else {
|
||||
return const EdgeInsetsDirectional.symmetric(horizontal: 8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static EdgeInsetsGeometry getSubjectPadding(BuildContext context, ResponsiveUtils responsiveUtils) {
|
||||
if (responsiveUtils.isPortraitMobile(context) || responsiveUtils.isLandscapeMobile(context)) {
|
||||
return const EdgeInsetsDirectional.symmetric(horizontal: 16, vertical: 8);
|
||||
@@ -71,14 +71,6 @@ class ComposerStyle {
|
||||
}
|
||||
}
|
||||
|
||||
static EdgeInsetsGeometry getPadding(BuildContext context, ResponsiveUtils responsiveUtils) {
|
||||
if (responsiveUtils.isPortraitMobile(context) || responsiveUtils.isLandscapeMobile(context)) {
|
||||
return const EdgeInsetsDirectional.symmetric(horizontal: 8);
|
||||
} else {
|
||||
return const EdgeInsetsDirectional.symmetric(horizontal: 32);
|
||||
}
|
||||
}
|
||||
|
||||
static double getAppBarHeight(BuildContext context, ResponsiveUtils responsiveUtils) {
|
||||
if (responsiveUtils.isPortraitMobile(context) || responsiveUtils.isLandscapeMobile(context)) {
|
||||
return 57;
|
||||
@@ -103,14 +95,6 @@ class ComposerStyle {
|
||||
}
|
||||
}
|
||||
|
||||
static EdgeInsetsGeometry getRichTextButtonPadding(BuildContext context, ResponsiveUtils responsiveUtils) {
|
||||
if (responsiveUtils.isMobile(context)) {
|
||||
return const EdgeInsetsDirectional.symmetric(horizontal: 16, vertical: 8);
|
||||
} else {
|
||||
return const EdgeInsetsDirectional.only(start: 88, end: 48, top: 8, bottom: 8);
|
||||
}
|
||||
}
|
||||
|
||||
static EdgeInsetsGeometry getEditorPadding(BuildContext context, ResponsiveUtils responsiveUtils) {
|
||||
if (PlatformInfo.isWeb) {
|
||||
if (responsiveUtils.isMobile(context)) {
|
||||
@@ -144,23 +128,6 @@ class ComposerStyle {
|
||||
}
|
||||
}
|
||||
|
||||
static EdgeInsetsGeometry getMarginForTabletWeb(BuildContext context, ResponsiveUtils responsiveUtils) {
|
||||
if (responsiveUtils.isTablet(context)) {
|
||||
return const EdgeInsetsDirectional.all(24);
|
||||
} else {
|
||||
return const EdgeInsetsDirectional.symmetric(vertical: 24);
|
||||
}
|
||||
}
|
||||
|
||||
static double getWidthForTabletWeb(BuildContext context, ResponsiveUtils responsiveUtils) {
|
||||
final currentWidth = responsiveUtils.getSizeScreenWidth(context);
|
||||
if (responsiveUtils.isTablet(context)) {
|
||||
return currentWidth;
|
||||
} else {
|
||||
return currentWidth * 0.7;
|
||||
}
|
||||
}
|
||||
|
||||
static int getMaxItemRowListAttachment(BuildContext context, BoxConstraints constraints) {
|
||||
if (constraints.maxWidth < ResponsiveUtils.minTabletWidth) {
|
||||
return 2;
|
||||
@@ -175,7 +142,6 @@ class ComposerStyle {
|
||||
return constraints.maxWidth / getMaxItemRowListAttachment(context, constraints);
|
||||
}
|
||||
|
||||
|
||||
static double getMaxHeightEmailAddressWidget(BuildContext context, BoxConstraints constraints, ResponsiveUtils responsiveUtils) {
|
||||
if (responsiveUtils.isDesktop(context)) {
|
||||
return constraints.maxHeight > 0 ? constraints.maxHeight * 0.3 : 150.0;
|
||||
|
||||
Reference in New Issue
Block a user