TF-2929 Fix vacation banner is truncated in french
This commit is contained in:
@@ -113,7 +113,7 @@ class EmailView extends GetWidget<SingleEmailController> {
|
|||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
return VacationNotificationMessageWidget(
|
return VacationNotificationMessageWidget(
|
||||||
margin: const EdgeInsets.only(left: 12, right: 12, bottom: 5),
|
margin: const EdgeInsetsDirectional.only(start: 12, end: 12, top: 8),
|
||||||
vacationResponse: vacation!,
|
vacationResponse: vacation!,
|
||||||
actionGotoVacationSetting: controller.mailboxDashBoardController.goToVacationSetting,
|
actionGotoVacationSetting: controller.mailboxDashBoardController.goToVacationSetting,
|
||||||
actionEndNow: controller.mailboxDashBoardController.disableVacationResponder
|
actionEndNow: controller.mailboxDashBoardController.disableVacationResponder
|
||||||
|
|||||||
@@ -544,14 +544,10 @@ class MailboxDashBoardView extends BaseMailboxDashBoardView {
|
|||||||
return Obx(() {
|
return Obx(() {
|
||||||
if (controller.vacationResponse.value?.vacationResponderIsValid == true) {
|
if (controller.vacationResponse.value?.vacationResponderIsValid == true) {
|
||||||
return VacationNotificationMessageWidget(
|
return VacationNotificationMessageWidget(
|
||||||
margin: EdgeInsets.only(
|
margin: const EdgeInsetsDirectional.only(top: 8, end: 16),
|
||||||
top: 16,
|
vacationResponse: controller.vacationResponse.value!,
|
||||||
right: AppUtils.isDirectionRTL(context) ? 0 : 16,
|
actionGotoVacationSetting: controller.goToVacationSetting,
|
||||||
left: AppUtils.isDirectionRTL(context) ? 16 : 0,
|
actionEndNow: controller.disableVacationResponder);
|
||||||
),
|
|
||||||
vacationResponse: controller.vacationResponse.value!,
|
|
||||||
actionGotoVacationSetting: () => controller.goToVacationSetting(),
|
|
||||||
actionEndNow: () => controller.disableVacationResponder());
|
|
||||||
} else {
|
} else {
|
||||||
return const SizedBox.shrink();
|
return const SizedBox.shrink();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import 'package:core/presentation/utils/responsive_utils.dart';
|
|||||||
import 'package:core/presentation/views/image/avatar_builder.dart';
|
import 'package:core/presentation/views/image/avatar_builder.dart';
|
||||||
import 'package:core/presentation/views/responsive/responsive_widget.dart';
|
import 'package:core/presentation/views/responsive/responsive_widget.dart';
|
||||||
import 'package:core/presentation/views/text/slogan_builder.dart';
|
import 'package:core/presentation/views/text/slogan_builder.dart';
|
||||||
import 'package:core/utils/platform_info.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:model/model.dart';
|
import 'package:model/model.dart';
|
||||||
@@ -78,31 +77,26 @@ class ManageAccountDashBoardView extends GetWidget<ManageAccountDashBoardControl
|
|||||||
Obx(() {
|
Obx(() {
|
||||||
if (controller.vacationResponse.value?.vacationResponderIsValid == true) {
|
if (controller.vacationResponse.value?.vacationResponderIsValid == true) {
|
||||||
return VacationNotificationMessageWidget(
|
return VacationNotificationMessageWidget(
|
||||||
margin: const EdgeInsets.only(
|
margin: const EdgeInsetsDirectional.only(top: 16, start: 16, end: 16),
|
||||||
top: 16,
|
fromAccountDashBoard: true,
|
||||||
left: PlatformInfo.isWeb ? 24 : 16,
|
vacationResponse: controller.vacationResponse.value!,
|
||||||
right: PlatformInfo.isWeb ? 24 : 16),
|
actionGotoVacationSetting: !controller.inVacationSettings()
|
||||||
fromAccountDashBoard: true,
|
? () => controller.selectAccountMenuItem(AccountMenuItem.vacation)
|
||||||
vacationResponse: controller.vacationResponse.value!,
|
: null,
|
||||||
actionGotoVacationSetting: !controller.inVacationSettings()
|
actionEndNow: controller.disableVacationResponder);
|
||||||
? () => controller.selectAccountMenuItem(AccountMenuItem.vacation)
|
|
||||||
: null,
|
|
||||||
actionEndNow: () => controller.disableVacationResponder());
|
|
||||||
} else if ((controller.vacationResponse.value?.vacationResponderIsWaiting == true
|
} else if ((controller.vacationResponse.value?.vacationResponderIsWaiting == true
|
||||||
|| controller.vacationResponse.value?.vacationResponderIsStopped == true)
|
|| controller.vacationResponse.value?.vacationResponderIsStopped == true)
|
||||||
&& controller.accountMenuItemSelected.value == AccountMenuItem.vacation) {
|
&& controller.accountMenuItemSelected.value == AccountMenuItem.vacation) {
|
||||||
return VacationNotificationMessageWidget(
|
return VacationNotificationMessageWidget(
|
||||||
margin: const EdgeInsets.only(
|
margin: const EdgeInsetsDirectional.only(top: 16, start: 16, end: 16),
|
||||||
top: 16,
|
fromAccountDashBoard: true,
|
||||||
left: PlatformInfo.isWeb ? 24 : 16,
|
vacationResponse: controller.vacationResponse.value!,
|
||||||
right: PlatformInfo.isWeb ? 24 : 16),
|
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 16),
|
||||||
fromAccountDashBoard: true,
|
leadingIcon: const Padding(
|
||||||
vacationResponse: controller.vacationResponse.value!,
|
padding: EdgeInsetsDirectional.only(end: 12),
|
||||||
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 16),
|
child: Icon(Icons.timer, size: 20),
|
||||||
leadingIcon: const Padding(
|
)
|
||||||
padding: EdgeInsets.only(right: 16),
|
);
|
||||||
child: Icon(Icons.timer, size: 20),
|
|
||||||
));
|
|
||||||
} else {
|
} else {
|
||||||
return const SizedBox.shrink();
|
return const SizedBox.shrink();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import 'package:core/presentation/extensions/color_extension.dart';
|
|||||||
import 'package:core/presentation/utils/style_utils.dart';
|
import 'package:core/presentation/utils/style_utils.dart';
|
||||||
import 'package:core/presentation/views/button/icon_button_web.dart';
|
import 'package:core/presentation/views/button/icon_button_web.dart';
|
||||||
import 'package:core/utils/direction_utils.dart';
|
import 'package:core/utils/direction_utils.dart';
|
||||||
import 'package:core/utils/platform_info.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';
|
||||||
@@ -61,16 +60,14 @@ class SettingsView extends GetWidget<SettingsController> {
|
|||||||
top: false,
|
top: false,
|
||||||
bottom: false,
|
bottom: false,
|
||||||
child: VacationNotificationMessageWidget(
|
child: VacationNotificationMessageWidget(
|
||||||
margin: const EdgeInsetsDirectional.only(
|
margin: const EdgeInsetsDirectional.only(start: 12, end: 12, top: 8),
|
||||||
start: PlatformInfo.isWeb ? 24 : 16,
|
fromAccountDashBoard: true,
|
||||||
end: PlatformInfo.isWeb ? 24 : 16,
|
vacationResponse: controller.manageAccountDashboardController.vacationResponse.value!,
|
||||||
top: 16),
|
actionGotoVacationSetting: !controller.manageAccountDashboardController.inVacationSettings()
|
||||||
fromAccountDashBoard: true,
|
? () => controller.manageAccountDashboardController.selectAccountMenuItem(AccountMenuItem.vacation)
|
||||||
vacationResponse: controller.manageAccountDashboardController.vacationResponse.value!,
|
: null,
|
||||||
actionGotoVacationSetting: !controller.manageAccountDashboardController.inVacationSettings()
|
actionEndNow: controller.manageAccountDashboardController.disableVacationResponder
|
||||||
? () => controller.manageAccountDashboardController.selectAccountMenuItem(AccountMenuItem.vacation)
|
),
|
||||||
: null,
|
|
||||||
actionEndNow: () => controller.manageAccountDashboardController.disableVacationResponder()),
|
|
||||||
);
|
);
|
||||||
} else if ((controller.manageAccountDashboardController.vacationResponse.value?.vacationResponderIsWaiting == true
|
} else if ((controller.manageAccountDashboardController.vacationResponse.value?.vacationResponderIsWaiting == true
|
||||||
|| controller.manageAccountDashboardController.vacationResponse.value?.vacationResponderIsStopped == true)
|
|| controller.manageAccountDashboardController.vacationResponse.value?.vacationResponderIsStopped == true)
|
||||||
@@ -79,15 +76,12 @@ class SettingsView extends GetWidget<SettingsController> {
|
|||||||
top: false,
|
top: false,
|
||||||
bottom: false,
|
bottom: false,
|
||||||
child: VacationNotificationMessageWidget(
|
child: VacationNotificationMessageWidget(
|
||||||
margin: const EdgeInsetsDirectional.only(
|
margin: const EdgeInsetsDirectional.only(start: 12, end: 12, top: 8),
|
||||||
start: PlatformInfo.isWeb ? 24 : 16,
|
|
||||||
end: PlatformInfo.isWeb ? 24 : 16,
|
|
||||||
top: 16),
|
|
||||||
fromAccountDashBoard: true,
|
fromAccountDashBoard: true,
|
||||||
vacationResponse: controller.manageAccountDashboardController.vacationResponse.value!,
|
vacationResponse: controller.manageAccountDashboardController.vacationResponse.value!,
|
||||||
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 16),
|
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 16),
|
||||||
leadingIcon: const Padding(
|
leadingIcon: const Padding(
|
||||||
padding: EdgeInsetsDirectional.only(end: 16),
|
padding: EdgeInsetsDirectional.only(end: 12),
|
||||||
child: Icon(Icons.timer, size: 20),
|
child: Icon(Icons.timer, size: 20),
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|||||||
+98
-73
@@ -41,7 +41,7 @@ class VacationNotificationMessageWidget extends StatelessWidget {
|
|||||||
return Container(
|
return Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
margin: margin ?? const EdgeInsets.symmetric(horizontal: 12),
|
margin: margin ?? const EdgeInsets.symmetric(horizontal: 12),
|
||||||
padding: padding ?? const EdgeInsetsDirectional.only(start: 12),
|
padding: padding ?? const EdgeInsets.symmetric(horizontal: 12, vertical: 5),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(radius ?? 8),
|
borderRadius: BorderRadius.circular(radius ?? 8),
|
||||||
color: backgroundColor ?? AppColor.colorBackgroundNotificationVacationSetting,
|
color: backgroundColor ?? AppColor.colorBackgroundNotificationVacationSetting,
|
||||||
@@ -66,86 +66,111 @@ class VacationNotificationMessageWidget extends StatelessWidget {
|
|||||||
return Row(children: [
|
return Row(children: [
|
||||||
if (leadingIcon != null) leadingIcon!,
|
if (leadingIcon != null) leadingIcon!,
|
||||||
Expanded(
|
Expanded(
|
||||||
|
child: Tooltip(
|
||||||
|
message: vacationResponse.getNotificationMessage(context),
|
||||||
child: Text(
|
child: Text(
|
||||||
vacationResponse.getNotificationMessage(context),
|
vacationResponse.getNotificationMessage(context),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
fontWeight: fontWeight ?? FontWeight.normal,
|
fontWeight: fontWeight ?? FontWeight.normal,
|
||||||
))),
|
),
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
),
|
||||||
if (actionEndNow != null)
|
if (actionEndNow != null)
|
||||||
buildTextButton(
|
TMailButtonWidget.fromText(
|
||||||
AppLocalizations.of(context).endNow,
|
text: AppLocalizations.of(context).endNow,
|
||||||
textStyle: const TextStyle(
|
textStyle: const TextStyle(
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
color: AppColor.colorTextButton),
|
color: AppColor.colorTextButton),
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
width: 90,
|
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 5),
|
||||||
height: 44,
|
borderRadius: 10,
|
||||||
radius: 10,
|
maxWidth: 180,
|
||||||
onTap: () => actionEndNow!.call()),
|
maxLines: 1,
|
||||||
|
tooltipMessage: AppLocalizations.of(context).endNow,
|
||||||
|
onTapActionCallback: actionEndNow),
|
||||||
if (actionGotoVacationSetting != null)
|
if (actionGotoVacationSetting != null)
|
||||||
buildTextButton(
|
TMailButtonWidget.fromText(
|
||||||
AppLocalizations.of(context).vacationSetting,
|
text: AppLocalizations.of(context).vacationSetting,
|
||||||
textStyle: const TextStyle(
|
textStyle: const TextStyle(
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
color: AppColor.colorTextButton),
|
color: AppColor.colorTextButton),
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
width: 150,
|
borderRadius: 10,
|
||||||
height: 44,
|
maxWidth: 310,
|
||||||
radius: 10,
|
maxLines: 1,
|
||||||
onTap: () => actionGotoVacationSetting!.call())
|
tooltipMessage: AppLocalizations.of(context).vacationSetting,
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 5),
|
||||||
|
onTapActionCallback: actionGotoVacationSetting)
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildBodyForMobile(BuildContext context) {
|
Widget _buildBodyForMobile(BuildContext context) {
|
||||||
return Column(children: [
|
return Column(
|
||||||
Row(children: [
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
if (leadingIcon != null) leadingIcon!,
|
if (leadingIcon != null) leadingIcon!,
|
||||||
Expanded(
|
Tooltip(
|
||||||
child: Padding(
|
message: vacationResponse.getNotificationMessage(context),
|
||||||
padding: const EdgeInsets.only(right: 12, top: 12),
|
child: Text(
|
||||||
child: Center(
|
vacationResponse.getNotificationMessage(context),
|
||||||
child: Text(
|
style: TextStyle(
|
||||||
vacationResponse.getNotificationMessage(context),
|
color: Colors.black,
|
||||||
style: TextStyle(
|
fontSize: 16,
|
||||||
color: Colors.black,
|
fontWeight: fontWeight ?? FontWeight.normal,
|
||||||
fontSize: 16,
|
),
|
||||||
fontWeight: fontWeight ?? FontWeight.normal,
|
maxLines: 1,
|
||||||
)),
|
textAlign: TextAlign.center,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
if (actionEndNow != null)
|
||||||
|
Flexible(
|
||||||
|
child: TMailButtonWidget.fromText(
|
||||||
|
text: AppLocalizations.of(context).endNow,
|
||||||
|
textStyle: const TextStyle(
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
fontSize: 16,
|
||||||
|
color: AppColor.colorTextButton),
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
borderRadius: 10,
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 5),
|
||||||
|
maxWidth: 180,
|
||||||
|
maxLines: 1,
|
||||||
|
tooltipMessage: AppLocalizations.of(context).endNow,
|
||||||
|
onTapActionCallback: actionEndNow
|
||||||
|
),
|
||||||
),
|
),
|
||||||
)),
|
if (actionGotoVacationSetting != null)
|
||||||
]),
|
Flexible(
|
||||||
Row(children: [
|
child: TMailButtonWidget.fromText(
|
||||||
const Spacer(),
|
text: AppLocalizations.of(context).vacationSetting,
|
||||||
if (actionEndNow != null)
|
textStyle: const TextStyle(
|
||||||
buildTextButton(
|
fontWeight: FontWeight.w500,
|
||||||
AppLocalizations.of(context).endNow,
|
fontSize: 16,
|
||||||
textStyle: const TextStyle(
|
color: AppColor.colorTextButton),
|
||||||
fontWeight: FontWeight.w500,
|
backgroundColor: Colors.transparent,
|
||||||
fontSize: 16,
|
borderRadius: 10,
|
||||||
color: AppColor.colorTextButton),
|
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 5),
|
||||||
backgroundColor: Colors.transparent,
|
maxWidth: 180,
|
||||||
width: 90,
|
maxLines: 1,
|
||||||
height: 36,
|
tooltipMessage: AppLocalizations.of(context).vacationSetting,
|
||||||
radius: 10,
|
onTapActionCallback: actionGotoVacationSetting
|
||||||
onTap: () => actionEndNow!.call()),
|
),
|
||||||
if (actionGotoVacationSetting != null)
|
),
|
||||||
buildTextButton(
|
]
|
||||||
AppLocalizations.of(context).vacationSetting,
|
)
|
||||||
textStyle: const TextStyle(
|
]
|
||||||
fontWeight: FontWeight.w500,
|
);
|
||||||
fontSize: 16,
|
|
||||||
color: AppColor.colorTextButton),
|
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
width: 150,
|
|
||||||
height: 36,
|
|
||||||
radius: 10,
|
|
||||||
onTap: () => actionGotoVacationSetting!.call()),
|
|
||||||
const Spacer(),
|
|
||||||
])
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user