diff --git a/core/lib/utils/platform_info.dart b/core/lib/utils/platform_info.dart index 733f369cf..9256e0650 100644 --- a/core/lib/utils/platform_info.dart +++ b/core/lib/utils/platform_info.dart @@ -13,6 +13,7 @@ abstract class PlatformInfo { static bool get isAndroid => !kIsWeb && Platform.isAndroid; static bool get isMobile => isAndroid || isIOS; static bool get isDesktop => isLinux || isWindows || isMacOS; + static bool get isWebMobile => kIsWeb && (defaultTargetPlatform == TargetPlatform.iOS || defaultTargetPlatform == TargetPlatform.android); static String get platformNameOS { var platformName = ''; diff --git a/lib/features/composer/presentation/styles/recipient_tag_item_widget_style.dart b/lib/features/composer/presentation/styles/recipient_tag_item_widget_style.dart index d068a931d..d68d51e73 100644 --- a/lib/features/composer/presentation/styles/recipient_tag_item_widget_style.dart +++ b/lib/features/composer/presentation/styles/recipient_tag_item_widget_style.dart @@ -1,4 +1,3 @@ -import 'package:core/utils/platform_info.dart'; import 'package:flutter/material.dart'; class RecipientTagItemWidgetStyle { @@ -9,7 +8,9 @@ class RecipientTagItemWidgetStyle { static const EdgeInsetsGeometry padding = EdgeInsetsDirectional.only(start: 4); static const EdgeInsetsGeometry counterPadding = EdgeInsetsDirectional.symmetric(vertical: 5, horizontal: 8); static const EdgeInsetsGeometry mobileCounterPadding = EdgeInsetsDirectional.symmetric(vertical: 8, horizontal: 8); - static const EdgeInsetsGeometry counterMargin = EdgeInsetsDirectional.only(top: PlatformInfo.isWeb ? 8 : 0, start: 8); + static const EdgeInsetsGeometry counterMargin = EdgeInsetsDirectional.only(start: 8); + static const EdgeInsetsGeometry webMobileCounterMargin = EdgeInsetsDirectional.only(start: 8); + static const EdgeInsetsGeometry webCounterMargin = EdgeInsetsDirectional.only(top: 8, start: 8); static const TextStyle labelTextStyle = TextStyle( color: Colors.black, diff --git a/lib/features/composer/presentation/widgets/recipient_tag_item_widget.dart b/lib/features/composer/presentation/widgets/recipient_tag_item_widget.dart index 943c91a1a..53fb30f4c 100644 --- a/lib/features/composer/presentation/widgets/recipient_tag_item_widget.dart +++ b/lib/features/composer/presentation/widgets/recipient_tag_item_widget.dart @@ -56,7 +56,9 @@ class RecipientTagItemWidget extends StatelessWidget { if (PlatformInfo.isWeb) Flexible( child: Padding( - padding: const EdgeInsetsDirectional.only(top: 8), + padding: EdgeInsetsDirectional.only( + top: PlatformInfo.isWebMobile ? 0 : 8 + ), child: InkWell( onTap: () => isCollapsed ? onShowFullAction?.call(prefix) @@ -140,7 +142,7 @@ class RecipientTagItemWidget extends StatelessWidget { ), if (isCollapsed) TMailButtonWidget.fromText( - margin: RecipientTagItemWidgetStyle.counterMargin, + margin: _counterMargin, text: '+$countRecipients', onTapActionCallback: () => onShowFullAction?.call(prefix), borderRadius: RecipientTagItemWidgetStyle.radius, @@ -155,6 +157,16 @@ class RecipientTagItemWidget extends StatelessWidget { ); } + EdgeInsetsGeometry? get _counterMargin { + if (PlatformInfo.isWebMobile) { + return RecipientTagItemWidgetStyle.webMobileCounterMargin; + } else if (PlatformInfo.isWeb) { + return RecipientTagItemWidgetStyle.webCounterMargin; + } else { + return RecipientTagItemWidgetStyle.counterMargin; + } + } + int get countRecipients => currentListEmailAddress.length - collapsedListEmailAddress.length; Color _getTagBackgroundColor() {