TF-801 Add presentation layer for get all vacation
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.4902 3.17C11.1102 1.61 8.89024 1.61 8.51024 3.17C8.45351 3.40442 8.34223 3.62212 8.18546 3.80541C8.02869 3.9887 7.83087 4.13238 7.60808 4.22477C7.3853 4.31716 7.14384 4.35564 6.90338 4.33709C6.66291 4.31854 6.43022 4.24347 6.22424 4.118C4.85224 3.282 3.28224 4.852 4.11824 6.224C4.65824 7.11 4.17924 8.266 3.17124 8.511C1.61024 8.89 1.61024 11.111 3.17124 11.489C3.40572 11.5458 3.62346 11.6572 3.80675 11.8141C3.99004 11.971 4.13368 12.1689 4.22598 12.3918C4.31828 12.6147 4.35663 12.8563 4.33791 13.0968C4.31919 13.3373 4.24392 13.5701 4.11824 13.776C3.28224 15.148 4.85224 16.718 6.22424 15.882C6.43018 15.7563 6.66289 15.6811 6.90342 15.6623C7.14396 15.6436 7.38551 15.682 7.60842 15.7743C7.83132 15.8666 8.02928 16.0102 8.18617 16.1935C8.34305 16.3768 8.45443 16.5945 8.51124 16.829C8.89024 18.39 11.1112 18.39 11.4892 16.829C11.5462 16.5946 11.6577 16.377 11.8146 16.1939C11.9716 16.0107 12.1695 15.8672 12.3923 15.7749C12.6152 15.6826 12.8566 15.6442 13.0971 15.6628C13.3376 15.6815 13.5702 15.7565 13.7762 15.882C15.1482 16.718 16.7182 15.148 15.8822 13.776C15.7568 13.57 15.6817 13.3373 15.6631 13.0969C15.6445 12.8564 15.6829 12.6149 15.7751 12.3921C15.8674 12.1692 16.011 11.9713 16.1941 11.8144C16.3773 11.6575 16.5949 11.546 16.8292 11.489C18.3902 11.11 18.3902 8.889 16.8292 8.511C16.5948 8.45419 16.377 8.34281 16.1937 8.18593C16.0104 8.02904 15.8668 7.83109 15.7745 7.60818C15.6822 7.38527 15.6438 7.14372 15.6626 6.90318C15.6813 6.66265 15.7566 6.42994 15.8822 6.224C16.7182 4.852 15.1482 3.282 13.7762 4.118C13.5703 4.24368 13.3376 4.31895 13.0971 4.33767C12.8565 4.35639 12.615 4.31804 12.3921 4.22574C12.1692 4.13344 11.9712 3.9898 11.8143 3.80651C11.6574 3.62323 11.546 3.40548 11.4892 3.171L11.4902 3.17ZM10.0002 13C10.7959 13 11.559 12.6839 12.1216 12.1213C12.6842 11.5587 13.0002 10.7956 13.0002 10C13.0002 9.20435 12.6842 8.44129 12.1216 7.87868C11.559 7.31607 10.7959 7 10.0002 7C9.20459 7 8.44153 7.31607 7.87892 7.87868C7.31631 8.44129 7.00024 9.20435 7.00024 10C7.00024 10.7956 7.31631 11.5587 7.87892 12.1213C8.44153 12.6839 9.20459 13 10.0002 13V13Z" stroke="#007AFF" stroke-width="1.5"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 2.2 KiB |
@@ -1,3 +1,3 @@
|
|||||||
<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
<path d="M13.9546 14.2061C15.98 14.2061 17.6152 12.4297 17.6152 10.23C17.6152 8.08008 15.98 6.34521 13.9546 6.34521C11.9375 6.34521 10.2773 8.09668 10.2856 10.2466C10.2939 12.4297 11.9209 14.2061 13.9546 14.2061ZM13.9546 12.6289C12.8506 12.6289 11.9209 11.6162 11.9209 10.2383C11.9126 8.91016 12.8506 7.92236 13.9546 7.92236C15.0669 7.92236 15.9883 8.90186 15.9883 10.23C15.9883 11.6079 15.0669 12.6289 13.9546 12.6289ZM8.7998 21.9507H19.0928C20.562 21.9507 21.2842 21.4692 21.2842 20.4565C21.2842 18.1074 18.3706 15.1274 13.9463 15.1274C9.53027 15.1274 6.6167 18.1074 6.6167 20.4565C6.6167 21.4692 7.33057 21.9507 8.7998 21.9507ZM8.61719 20.3818C8.44287 20.3818 8.37646 20.3154 8.37646 20.1743C8.37646 18.9707 10.3853 16.7046 13.9463 16.7046C17.5073 16.7046 19.5244 18.9707 19.5244 20.1743C19.5244 20.3154 19.458 20.3818 19.2754 20.3818H8.61719Z" fill="#007AFF"/>
|
<path d="M9.95459 10.2061C11.98 10.2061 13.6152 8.42969 13.6152 6.22998C13.6152 4.08008 11.98 2.34521 9.95459 2.34521C7.9375 2.34521 6.27734 4.09668 6.28564 6.24658C6.29395 8.42969 7.9209 10.2061 9.95459 10.2061ZM9.95459 8.62891C8.85059 8.62891 7.9209 7.61621 7.9209 6.23828C7.9126 4.91016 8.85059 3.92236 9.95459 3.92236C11.0669 3.92236 11.9883 4.90186 11.9883 6.22998C11.9883 7.60791 11.0669 8.62891 9.95459 8.62891ZM4.7998 17.9507H15.0928C16.562 17.9507 17.2842 17.4692 17.2842 16.4565C17.2842 14.1074 14.3706 11.1274 9.94629 11.1274C5.53027 11.1274 2.6167 14.1074 2.6167 16.4565C2.6167 17.4692 3.33057 17.9507 4.7998 17.9507ZM4.61719 16.3818C4.44287 16.3818 4.37646 16.3154 4.37646 16.1743C4.37646 14.9707 6.38525 12.7046 9.94629 12.7046C13.5073 12.7046 15.5244 14.9707 15.5244 16.1743C15.5244 16.3154 15.458 16.3818 15.2754 16.3818H4.61719Z" fill="#007AFF"/>
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 968 B After Width: | Height: | Size: 967 B |
@@ -0,0 +1,3 @@
|
|||||||
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.39821 2.14258L9.28592 2.14258C9.68041 2.14258 10.0002 2.46238 10.0002 2.85686C10.0002 3.25135 9.68041 3.57115 9.28592 3.57115H7.42878C6.61692 3.57115 6.05098 3.57171 5.61038 3.6077C5.17812 3.64302 4.92977 3.70886 4.74166 3.80471C4.33845 4.01015 4.01064 4.33797 3.8052 4.74117C3.70935 4.92928 3.64351 5.17763 3.60819 5.60989C3.57219 6.05049 3.57164 6.61643 3.57164 7.42829V12.5712C3.57164 13.383 3.57219 13.9489 3.60819 14.3895C3.64351 14.8218 3.70935 15.0702 3.8052 15.2583C4.01064 15.6615 4.33845 15.9893 4.74166 16.1947C4.92977 16.2906 5.17812 16.3564 5.61038 16.3917C6.05098 16.4277 6.61692 16.4283 7.42878 16.4283H9.28592C9.68041 16.4283 10.0002 16.7481 10.0002 17.1426C10.0002 17.5371 9.68041 17.8569 9.28592 17.8569H7.39819C6.62406 17.8569 5.99967 17.8569 5.49405 17.8156C4.97344 17.773 4.51617 17.6832 4.0931 17.4676C3.42109 17.1252 2.87473 16.5788 2.53233 15.9068C2.31677 15.4838 2.2269 15.0265 2.18437 14.5059C2.14305 14.0003 2.14306 13.3759 2.14307 12.6017V7.39772C2.14306 6.62358 2.14305 5.99919 2.18437 5.49356C2.2269 4.97295 2.31677 4.51568 2.53233 4.09261C2.87473 3.42061 3.42109 2.87425 4.0931 2.53184C4.51617 2.31628 4.97344 2.22641 5.49405 2.18388C5.99968 2.14257 6.62407 2.14257 7.39821 2.14258ZM13.7808 6.6375C14.0598 6.35856 14.5121 6.35856 14.791 6.6375L17.6481 9.49465C17.7821 9.6286 17.8574 9.81028 17.8574 9.99972C17.8574 10.1892 17.7821 10.3708 17.6481 10.5048L14.791 13.3619C14.5121 13.6409 14.0598 13.6409 13.7808 13.3619C13.5019 13.083 13.5019 12.6307 13.7808 12.3518L15.4186 10.714H8.57164C8.17715 10.714 7.85735 10.3942 7.85735 9.99972C7.85735 9.60523 8.17715 9.28544 8.57164 9.28544H15.4186L13.7808 7.64766C13.5019 7.36871 13.5019 6.91645 13.7808 6.6375Z" fill="#007AFF"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.8 KiB |
@@ -137,6 +137,7 @@ extension AppColor on Color {
|
|||||||
static const colorBorderListForwardsFilter = Color(0xFFE7E8EC);
|
static const colorBorderListForwardsFilter = Color(0xFFE7E8EC);
|
||||||
static const colorBackgroundFieldConditionRulesFilter = Color(0xFFF2F3F5);
|
static const colorBackgroundFieldConditionRulesFilter = Color(0xFFF2F3F5);
|
||||||
static const colorDividerRuleFilter = Color(0xFFE7E8EC);
|
static const colorDividerRuleFilter = Color(0xFFE7E8EC);
|
||||||
|
static const colorIconTextField = Color(0xFFB8C1CC);
|
||||||
|
|
||||||
static const mapGradientColor = [
|
static const mapGradientColor = [
|
||||||
[Color(0xFF21D4FD), Color(0xFFB721FF)],
|
[Color(0xFF21D4FD), Color(0xFFB721FF)],
|
||||||
|
|||||||
@@ -153,6 +153,8 @@ class ImagePaths {
|
|||||||
String get icEditRuleMobile => _getImagePath('ic_edit_rule_mobile.svg');
|
String get icEditRuleMobile => _getImagePath('ic_edit_rule_mobile.svg');
|
||||||
String get icDeleteRuleMobile => _getImagePath('ic_delete_rule_mobile.svg');
|
String get icDeleteRuleMobile => _getImagePath('ic_delete_rule_mobile.svg');
|
||||||
String get icDeleteEmailForward => _getImagePath('ic_delete_email_forward.svg');
|
String get icDeleteEmailForward => _getImagePath('ic_delete_email_forward.svg');
|
||||||
|
String get icVacation => _getImagePath('ic_vacation.svg');
|
||||||
|
String get icSignOut => _getImagePath('ic_sign_out.svg');
|
||||||
|
|
||||||
String _getImagePath(String imageName) {
|
String _getImagePath(String imageName) {
|
||||||
return AssetsPaths.images + imageName;
|
return AssetsPaths.images + imageName;
|
||||||
|
|||||||
@@ -0,0 +1,83 @@
|
|||||||
|
|
||||||
|
import 'package:core/presentation/extensions/color_extension.dart';
|
||||||
|
import 'package:core/presentation/resources/image_paths.dart';
|
||||||
|
import 'package:core/presentation/utils/style_utils.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:tmail_ui_user/features/manage_account/presentation/extensions/datetime_extension.dart';
|
||||||
|
|
||||||
|
typedef OnTapActionCallback<T> = Function(T? value);
|
||||||
|
|
||||||
|
class BorderButtonField<T> extends StatelessWidget {
|
||||||
|
|
||||||
|
final T? value;
|
||||||
|
final OnTapActionCallback? tapActionCallback;
|
||||||
|
final Widget? icon;
|
||||||
|
final TextStyle? textStyle;
|
||||||
|
final MouseCursor? mouseCursor;
|
||||||
|
final String? hintText;
|
||||||
|
|
||||||
|
const BorderButtonField({
|
||||||
|
super.key,
|
||||||
|
this.value,
|
||||||
|
this.tapActionCallback,
|
||||||
|
this.icon,
|
||||||
|
this.textStyle,
|
||||||
|
this.mouseCursor,
|
||||||
|
this.hintText,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final _imagePaths = Get.find<ImagePaths>();
|
||||||
|
|
||||||
|
return InkWell(
|
||||||
|
onTap: () => tapActionCallback?.call(value),
|
||||||
|
mouseCursor: mouseCursor,
|
||||||
|
child: Container(
|
||||||
|
height: 44,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
border: Border.all(
|
||||||
|
color: AppColor.colorInputBorderCreateMailbox,
|
||||||
|
width: 1),
|
||||||
|
color: Colors.white),
|
||||||
|
padding: const EdgeInsets.only(left: 12, right: 10),
|
||||||
|
child: Row(children: [
|
||||||
|
Expanded(child: Text(
|
||||||
|
_getName(context, value),
|
||||||
|
style: _getTextStyle(value),
|
||||||
|
maxLines: 1,
|
||||||
|
softWrap: CommonTextStyle.defaultSoftWrap,
|
||||||
|
overflow: CommonTextStyle.defaultTextOverFlow,
|
||||||
|
)),
|
||||||
|
icon ?? SvgPicture.asset(_imagePaths.icDropDown)
|
||||||
|
]),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
TextStyle? _getTextStyle(T? value) {
|
||||||
|
if (hintText != null && value == null) {
|
||||||
|
return const TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.normal,
|
||||||
|
color: AppColor.colorHintInputCreateMailbox);
|
||||||
|
}
|
||||||
|
return textStyle ?? const TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.normal,
|
||||||
|
color: Colors.black);
|
||||||
|
}
|
||||||
|
|
||||||
|
String _getName(BuildContext context, T? value) {
|
||||||
|
if (value is DateTime) {
|
||||||
|
return value.formatDate(locale: Localizations.localeOf(context).toLanguageTag());
|
||||||
|
}
|
||||||
|
if (value is TimeOfDay) {
|
||||||
|
return value.formatTime(context);
|
||||||
|
}
|
||||||
|
return hintText ?? '';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:tmail_ui_user/features/base/base_bindings.dart';
|
||||||
|
import 'package:tmail_ui_user/features/manage_account/presentation/configuration/configuration_controller.dart';
|
||||||
|
import 'package:tmail_ui_user/features/manage_account/presentation/configuration/vacation/vacation_bindings.dart';
|
||||||
|
|
||||||
|
class ConfigurationBindings extends BaseBindings {
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dependencies() {
|
||||||
|
super.dependencies();
|
||||||
|
VacationBindings().dependencies();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void bindingsController() {
|
||||||
|
Get.lazyPut(() => ConfigurationController());
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void bindingsDataSource() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void bindingsDataSourceImpl() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void bindingsInteractor() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void bindingsRepository() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void bindingsRepositoryImpl() {
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
import 'package:tmail_ui_user/features/base/base_controller.dart';
|
||||||
|
|
||||||
|
class ConfigurationController extends BaseController {
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onDone() {}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onError(error) {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
|
||||||
|
import 'package:core/core.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:tmail_ui_user/features/manage_account/presentation/configuration/configuration_controller.dart';
|
||||||
|
import 'package:tmail_ui_user/features/manage_account/presentation/configuration/vacation/vacation_view.dart';
|
||||||
|
import 'package:tmail_ui_user/features/manage_account/presentation/model/configuration_tab_type.dart';
|
||||||
|
|
||||||
|
class ConfigurationView extends GetWidget<ConfigurationController> {
|
||||||
|
|
||||||
|
final _responsiveUtils = Get.find<ResponsiveUtils>();
|
||||||
|
|
||||||
|
ConfigurationView({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: _responsiveUtils.isWebDesktop(context)
|
||||||
|
? AppColor.colorBgDesktop
|
||||||
|
: Colors.white,
|
||||||
|
body: Container(
|
||||||
|
margin: _responsiveUtils.isWebDesktop(context)
|
||||||
|
? const EdgeInsets.all(24)
|
||||||
|
: EdgeInsets.zero,
|
||||||
|
color: _responsiveUtils.isWebDesktop(context) ? null : Colors.white,
|
||||||
|
decoration: _responsiveUtils.isWebDesktop(context)
|
||||||
|
? BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(20),
|
||||||
|
border: Border.all(color: AppColor.colorBorderBodyThread, width: 1),
|
||||||
|
color: Colors.white)
|
||||||
|
: null,
|
||||||
|
child: ClipRRect(
|
||||||
|
borderRadius: BorderRadius.circular(
|
||||||
|
_responsiveUtils.isWebDesktop(context) ? 20 : 0),
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.only(
|
||||||
|
left: BuildUtils.isWeb ? 10 : 0,
|
||||||
|
right: 10,
|
||||||
|
bottom: 10),
|
||||||
|
child: DefaultTabController(
|
||||||
|
initialIndex: 0,
|
||||||
|
length: 1,
|
||||||
|
child: Scaffold(
|
||||||
|
appBar: TabBar(
|
||||||
|
unselectedLabelColor: AppColor.colorTextButtonHeaderThread,
|
||||||
|
unselectedLabelStyle: const TextStyle(
|
||||||
|
fontSize: 15,
|
||||||
|
fontWeight: FontWeight.normal,
|
||||||
|
color: AppColor.colorTextButtonHeaderThread),
|
||||||
|
labelStyle: const TextStyle(
|
||||||
|
fontSize: 15,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: AppColor.primaryColor),
|
||||||
|
labelColor: AppColor.primaryColor,
|
||||||
|
indicatorSize: TabBarIndicatorSize.label,
|
||||||
|
isScrollable: true,
|
||||||
|
indicator: const CustomIndicator(
|
||||||
|
indicatorHeight: 4,
|
||||||
|
indicatorColor: AppColor.primaryColor,
|
||||||
|
indicatorSize: CustomIndicatorSize.full),
|
||||||
|
onTap: (index) {},
|
||||||
|
tabs: ConfigurationTabType.values
|
||||||
|
.map((tab) => Tab(text: tab.getTitle(context)))
|
||||||
|
.toList()
|
||||||
|
),
|
||||||
|
body: Column(children: [
|
||||||
|
const Divider(color: AppColor.colorDividerMailbox, height: 0.5, thickness: 0.2),
|
||||||
|
Expanded(child: TabBarView(
|
||||||
|
children: [
|
||||||
|
VacationView(),
|
||||||
|
],
|
||||||
|
))
|
||||||
|
]),
|
||||||
|
)
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
+34
@@ -0,0 +1,34 @@
|
|||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:tmail_ui_user/features/base/base_bindings.dart';
|
||||||
|
import 'package:tmail_ui_user/features/manage_account/domain/repository/manage_account_repository.dart';
|
||||||
|
import 'package:tmail_ui_user/features/manage_account/domain/usecases/get_all_vacation_interactor.dart';
|
||||||
|
import 'package:tmail_ui_user/features/manage_account/presentation/configuration/vacation/vacation_controller.dart';
|
||||||
|
|
||||||
|
class VacationBindings extends BaseBindings {
|
||||||
|
|
||||||
|
@override
|
||||||
|
void bindingsController() {
|
||||||
|
Get.lazyPut(() => VacationController(Get.find<GetAllVacationInteractor>()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void bindingsDataSource() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void bindingsDataSourceImpl() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void bindingsInteractor() {
|
||||||
|
Get.lazyPut(() => GetAllVacationInteractor(Get.find<ManageAccountRepository>()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void bindingsRepository() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void bindingsRepositoryImpl() {
|
||||||
|
}
|
||||||
|
}
|
||||||
+162
@@ -0,0 +1,162 @@
|
|||||||
|
import 'package:core/utils/app_logger.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:jmap_dart_client/jmap/mail/vacation/vacation_response.dart';
|
||||||
|
import 'package:tmail_ui_user/features/base/base_controller.dart';
|
||||||
|
import 'package:tmail_ui_user/features/manage_account/domain/state/get_all_vacation_state.dart';
|
||||||
|
import 'package:tmail_ui_user/features/manage_account/domain/usecases/get_all_vacation_interactor.dart';
|
||||||
|
import 'package:tmail_ui_user/features/manage_account/presentation/manage_account_dashboard_controller.dart';
|
||||||
|
import 'package:tmail_ui_user/features/manage_account/presentation/model/vacation/date_type.dart';
|
||||||
|
import 'package:tmail_ui_user/features/manage_account/presentation/model/vacation/vacation_presentation.dart';
|
||||||
|
import 'package:tmail_ui_user/features/manage_account/presentation/model/vacation/vacation_responder_status.dart';
|
||||||
|
|
||||||
|
class VacationController extends BaseController {
|
||||||
|
|
||||||
|
final _accountDashBoardController = Get.find<ManageAccountDashBoardController>();
|
||||||
|
|
||||||
|
final GetAllVacationInteractor _getAllVacationInteractor;
|
||||||
|
|
||||||
|
final vacationPresentation = VacationPresentation.initialize().obs;
|
||||||
|
|
||||||
|
final TextEditingController messageBodyEditorController = TextEditingController();
|
||||||
|
|
||||||
|
VacationResponse? currentVacation;
|
||||||
|
|
||||||
|
VacationController(this._getAllVacationInteractor);
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onReady() {
|
||||||
|
_getAllVacation();
|
||||||
|
super.onReady();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onDone() {
|
||||||
|
viewState.value.fold(
|
||||||
|
(failure) => null,
|
||||||
|
(success) {
|
||||||
|
if (success is GetAllVacationSuccess) {
|
||||||
|
_handleGetAllVacationSuccess(success);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onError(error) {}
|
||||||
|
|
||||||
|
void _getAllVacation() {
|
||||||
|
final accountId = _accountDashBoardController.accountId.value;
|
||||||
|
if (accountId != null) {
|
||||||
|
consumeState(_getAllVacationInteractor.execute(accountId));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void _handleGetAllVacationSuccess(GetAllVacationSuccess success) {
|
||||||
|
if (success.listVacationResponse?.isNotEmpty == true) {
|
||||||
|
currentVacation = success.listVacationResponse!.first;
|
||||||
|
log('VacationController::_handleGetAllVacationSuccess(): $currentVacation');
|
||||||
|
|
||||||
|
final vacationStatus = currentVacation?.isEnabled;
|
||||||
|
final startDate = currentVacation?.fromDate?.value;
|
||||||
|
final endDate = currentVacation?.toDate?.value;
|
||||||
|
final messageBody = currentVacation?.htmlBody ?? currentVacation?.textBody;
|
||||||
|
final startTime = startDate != null
|
||||||
|
? TimeOfDay.fromDateTime(startDate)
|
||||||
|
: null;
|
||||||
|
final endTime = endDate != null
|
||||||
|
? TimeOfDay.fromDateTime(endDate)
|
||||||
|
: null;
|
||||||
|
final vacationStopEnabled = endDate != null;
|
||||||
|
|
||||||
|
if (messageBody != null) {
|
||||||
|
messageBodyEditorController.text = messageBody;
|
||||||
|
}
|
||||||
|
|
||||||
|
updateVacationPresentation(
|
||||||
|
newStatus: vacationStatus == true
|
||||||
|
? VacationResponderStatus.activated
|
||||||
|
: VacationResponderStatus.deactivated,
|
||||||
|
startDate: startDate,
|
||||||
|
startTime: startTime,
|
||||||
|
endDate: endDate,
|
||||||
|
endTime: endTime,
|
||||||
|
vacationStopEnabled: vacationStopEnabled,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool get isVacationDeactivated =>
|
||||||
|
vacationPresentation.value.status == VacationResponderStatus.deactivated;
|
||||||
|
|
||||||
|
bool get isVacationStopEnabled => vacationPresentation.value.vacationStopEnabled;
|
||||||
|
|
||||||
|
bool get canChangeEndDate => !isVacationDeactivated && isVacationStopEnabled;
|
||||||
|
|
||||||
|
void updateVacationPresentation({
|
||||||
|
VacationResponderStatus? newStatus,
|
||||||
|
DateTime? startDate,
|
||||||
|
TimeOfDay? startTime,
|
||||||
|
DateTime? endDate,
|
||||||
|
TimeOfDay? endTime,
|
||||||
|
bool? vacationStopEnabled,
|
||||||
|
}) {
|
||||||
|
final currentVacation = vacationPresentation.value;
|
||||||
|
final newVacation = currentVacation.copyWidth(
|
||||||
|
status: newStatus,
|
||||||
|
startDate: startDate,
|
||||||
|
startTime: startTime,
|
||||||
|
endDate: endDate,
|
||||||
|
endTime: endTime,
|
||||||
|
vacationStopEnabled: vacationStopEnabled);
|
||||||
|
vacationPresentation.value = newVacation;
|
||||||
|
}
|
||||||
|
|
||||||
|
void selectDate(BuildContext context, DateType dateType, DateTime? currentDate) async {
|
||||||
|
final datePicked = await showDatePicker(
|
||||||
|
context: context,
|
||||||
|
initialDate: currentDate ?? DateTime.now(),
|
||||||
|
initialDatePickerMode: DatePickerMode.day,
|
||||||
|
firstDate: DateTime(1900),
|
||||||
|
lastDate: DateTime(2100),
|
||||||
|
locale: Localizations.localeOf(context)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (datePicked == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dateType == DateType.start) {
|
||||||
|
updateVacationPresentation(startDate: datePicked);
|
||||||
|
} else {
|
||||||
|
updateVacationPresentation(endDate: datePicked);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void selectTime(BuildContext context, DateType dateType, TimeOfDay? currentTime) async {
|
||||||
|
final timePicked = await showTimePicker(
|
||||||
|
context: context,
|
||||||
|
initialTime: currentTime ?? TimeOfDay.now(),
|
||||||
|
);
|
||||||
|
|
||||||
|
if (timePicked == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dateType == DateType.start) {
|
||||||
|
updateVacationPresentation(startTime: timePicked);
|
||||||
|
} else {
|
||||||
|
updateVacationPresentation(endTime: timePicked);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void saveVacation(BuildContext context) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onClose() {
|
||||||
|
messageBodyEditorController.dispose();
|
||||||
|
super.onClose();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,454 @@
|
|||||||
|
|
||||||
|
import 'package:core/core.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:tmail_ui_user/features/base/widget/border_button_field.dart';
|
||||||
|
import 'package:tmail_ui_user/features/manage_account/presentation/configuration/vacation/vacation_controller.dart';
|
||||||
|
import 'package:tmail_ui_user/features/manage_account/presentation/configuration/vacation/widgets/vacation_input_decoration_builder.dart';
|
||||||
|
import 'package:tmail_ui_user/features/manage_account/presentation/model/vacation/date_type.dart';
|
||||||
|
import 'package:tmail_ui_user/features/manage_account/presentation/model/vacation/vacation_responder_status.dart';
|
||||||
|
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||||
|
import 'package:toggle_switch/toggle_switch.dart';
|
||||||
|
|
||||||
|
class VacationView extends GetWidget<VacationController> {
|
||||||
|
|
||||||
|
final _responsiveUtils = Get.find<ResponsiveUtils>();
|
||||||
|
|
||||||
|
VacationView({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: Colors.white,
|
||||||
|
body: Container(
|
||||||
|
width: double.infinity,
|
||||||
|
color: Colors.white,
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 16, horizontal: 16),
|
||||||
|
child: ResponsiveWidget(
|
||||||
|
responsiveUtils: _responsiveUtils,
|
||||||
|
desktop: SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Row(children: [
|
||||||
|
Container(
|
||||||
|
width: 200,
|
||||||
|
color: Colors.white,
|
||||||
|
child: Text(
|
||||||
|
AppLocalizations.of(context).vacationResponder,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 15,
|
||||||
|
fontWeight: FontWeight.normal,
|
||||||
|
color: Colors.black))),
|
||||||
|
const SizedBox(width: 16),
|
||||||
|
ToggleSwitch(
|
||||||
|
minWidth: 150.0,
|
||||||
|
cornerRadius: 20.0,
|
||||||
|
activeBgColors: const [[Colors.green], [Colors.redAccent]],
|
||||||
|
activeFgColor: Colors.white,
|
||||||
|
inactiveBgColor: Colors.grey,
|
||||||
|
inactiveFgColor: Colors.white,
|
||||||
|
initialLabelIndex: 1,
|
||||||
|
totalSwitches: VacationResponderStatus.values.length,
|
||||||
|
labels: VacationResponderStatus.values
|
||||||
|
.map((status) => status.getTitle(context))
|
||||||
|
.toList(),
|
||||||
|
radiusStyle: true,
|
||||||
|
onToggle: (index) {
|
||||||
|
log('VacationView::build():ToggleSwitch:index: $index');
|
||||||
|
final newStatus = index == 0
|
||||||
|
? VacationResponderStatus.activated
|
||||||
|
: VacationResponderStatus.deactivated;
|
||||||
|
controller.updateVacationPresentation(newStatus: newStatus);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
]),
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
Obx(() => AbsorbPointer(
|
||||||
|
absorbing: controller.isVacationDeactivated,
|
||||||
|
child: Row(children: [
|
||||||
|
Container(
|
||||||
|
width: 200,
|
||||||
|
color: Colors.white,
|
||||||
|
child: Text(
|
||||||
|
AppLocalizations.of(context).startDate,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 15,
|
||||||
|
fontWeight: FontWeight.normal,
|
||||||
|
color: Colors.black.withOpacity(
|
||||||
|
controller.isVacationDeactivated ? 0.5 : 1.0)))),
|
||||||
|
const SizedBox(width: 16),
|
||||||
|
Expanded(child: Obx(() => BorderButtonField<DateTime>(
|
||||||
|
value: controller.vacationPresentation.value.startDate,
|
||||||
|
mouseCursor: SystemMouseCursors.text,
|
||||||
|
textStyle: TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.normal,
|
||||||
|
color: Colors.black.withOpacity(
|
||||||
|
controller.isVacationDeactivated ? 0.5 : 1.0)),
|
||||||
|
hintText: AppLocalizations.of(context).startDate,
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.date_range,
|
||||||
|
color: AppColor.colorIconTextField,
|
||||||
|
size: 20),
|
||||||
|
tapActionCallback: (value) =>
|
||||||
|
controller.selectDate(context, DateType.start, value)))),
|
||||||
|
const SizedBox(width: 16),
|
||||||
|
Expanded(child: Obx(() => BorderButtonField<TimeOfDay>(
|
||||||
|
value: controller.vacationPresentation.value.startTime,
|
||||||
|
mouseCursor: SystemMouseCursors.text,
|
||||||
|
textStyle: TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.normal,
|
||||||
|
color: Colors.black.withOpacity(
|
||||||
|
controller.isVacationDeactivated ? 0.5 : 1.0)),
|
||||||
|
hintText: AppLocalizations.of(context).noStartTime,
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.timer,
|
||||||
|
color: AppColor.colorIconTextField,
|
||||||
|
size: 20),
|
||||||
|
tapActionCallback: (value) =>
|
||||||
|
controller.selectTime(context, DateType.start, value)))),
|
||||||
|
]),
|
||||||
|
)),
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
Obx(() => AbsorbPointer(
|
||||||
|
absorbing: controller.isVacationDeactivated,
|
||||||
|
child: Container(
|
||||||
|
width: 200,
|
||||||
|
color: Colors.white,
|
||||||
|
child: CheckboxListTile(
|
||||||
|
contentPadding: EdgeInsets.zero,
|
||||||
|
activeColor: AppColor.primaryColor.withOpacity(
|
||||||
|
controller.isVacationDeactivated ? 0.5 : 1.0),
|
||||||
|
controlAffinity: ListTileControlAffinity.leading,
|
||||||
|
value: controller.vacationPresentation.value.vacationStopEnabled,
|
||||||
|
onChanged: (value) =>
|
||||||
|
controller.updateVacationPresentation(vacationStopEnabled: value),
|
||||||
|
title: Text(AppLocalizations.of(context).vacationStopsAt,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 15,
|
||||||
|
fontWeight: FontWeight.normal,
|
||||||
|
color: Colors.black.withOpacity(
|
||||||
|
controller.isVacationDeactivated ? 0.5 : 1.0))),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
Obx(() => AbsorbPointer(
|
||||||
|
absorbing: !controller.canChangeEndDate,
|
||||||
|
child: Row(children: [
|
||||||
|
Container(
|
||||||
|
width: 200,
|
||||||
|
color: Colors.white,
|
||||||
|
child: Text(
|
||||||
|
AppLocalizations.of(context).endDate,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 15,
|
||||||
|
fontWeight: FontWeight.normal,
|
||||||
|
color: Colors.black.withOpacity(
|
||||||
|
!controller.canChangeEndDate ? 0.5 : 1.0)))),
|
||||||
|
const SizedBox(width: 16),
|
||||||
|
Expanded(child: Obx(() => BorderButtonField<DateTime>(
|
||||||
|
value: controller.vacationPresentation.value.endDate,
|
||||||
|
mouseCursor: SystemMouseCursors.text,
|
||||||
|
textStyle: TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.normal,
|
||||||
|
color: Colors.black.withOpacity(
|
||||||
|
!controller.canChangeEndDate ? 0.5 : 1.0)),
|
||||||
|
hintText: AppLocalizations.of(context).noEndDate,
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.date_range,
|
||||||
|
color: AppColor.colorIconTextField,
|
||||||
|
size: 20),
|
||||||
|
tapActionCallback: (value) =>
|
||||||
|
controller.selectDate(context, DateType.end, value)))),
|
||||||
|
const SizedBox(width: 16),
|
||||||
|
Expanded(child: Obx(() => BorderButtonField<TimeOfDay>(
|
||||||
|
value: controller.vacationPresentation.value.endTime,
|
||||||
|
mouseCursor: SystemMouseCursors.text,
|
||||||
|
textStyle: TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.normal,
|
||||||
|
color: Colors.black.withOpacity(
|
||||||
|
!controller.canChangeEndDate ? 0.5 : 1.0)),
|
||||||
|
hintText: AppLocalizations.of(context).noEndTime,
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.timer,
|
||||||
|
color: AppColor.colorIconTextField,
|
||||||
|
size: 20),
|
||||||
|
tapActionCallback: (value) =>
|
||||||
|
controller.selectTime(context, DateType.end, value)))),
|
||||||
|
])
|
||||||
|
)),
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
Obx(() => AbsorbPointer(
|
||||||
|
absorbing: controller.isVacationDeactivated,
|
||||||
|
child: Row(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||||
|
Container(
|
||||||
|
width: 200,
|
||||||
|
color: Colors.white,
|
||||||
|
child: Text(
|
||||||
|
AppLocalizations.of(context).messageBody,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 15,
|
||||||
|
fontWeight: FontWeight.normal,
|
||||||
|
color: Colors.black.withOpacity(
|
||||||
|
controller.isVacationDeactivated ? 0.5 : 1.0)))),
|
||||||
|
const SizedBox(width: 16),
|
||||||
|
Expanded(child: _buildMessageBodyWidget(
|
||||||
|
context,
|
||||||
|
controller.isVacationDeactivated ? 0.5 : 1.0))
|
||||||
|
]),
|
||||||
|
)),
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
Align(
|
||||||
|
alignment: Alignment.centerRight,
|
||||||
|
child: buildTextButton(
|
||||||
|
AppLocalizations.of(context).save,
|
||||||
|
width: 128,
|
||||||
|
height: 44,
|
||||||
|
radius: 10,
|
||||||
|
onTap: () => controller.saveVacation(context)),
|
||||||
|
)
|
||||||
|
]
|
||||||
|
),
|
||||||
|
),
|
||||||
|
mobile: SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
if (_responsiveUtils.isPortraitMobile(context))
|
||||||
|
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||||
|
Text(
|
||||||
|
AppLocalizations.of(context).vacationResponder,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 15,
|
||||||
|
fontWeight: FontWeight.normal,
|
||||||
|
color: Colors.black)),
|
||||||
|
const SizedBox(height: 16),
|
||||||
|
ToggleSwitch(
|
||||||
|
minWidth: 150.0,
|
||||||
|
cornerRadius: 20.0,
|
||||||
|
activeBgColors: const [[Colors.green], [Colors.redAccent]],
|
||||||
|
activeFgColor: Colors.white,
|
||||||
|
inactiveBgColor: Colors.grey,
|
||||||
|
inactiveFgColor: Colors.white,
|
||||||
|
initialLabelIndex: 1,
|
||||||
|
totalSwitches: VacationResponderStatus.values.length,
|
||||||
|
labels: VacationResponderStatus.values
|
||||||
|
.map((status) => status.getTitle(context))
|
||||||
|
.toList(),
|
||||||
|
radiusStyle: true,
|
||||||
|
onToggle: (index) {
|
||||||
|
log('VacationView::build():ToggleSwitch:index: $index');
|
||||||
|
final newStatus = index == 0
|
||||||
|
? VacationResponderStatus.activated
|
||||||
|
: VacationResponderStatus.deactivated;
|
||||||
|
controller.updateVacationPresentation(newStatus: newStatus);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
])
|
||||||
|
else
|
||||||
|
Row(children: [
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
AppLocalizations.of(context).vacationResponder,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 15,
|
||||||
|
fontWeight: FontWeight.normal,
|
||||||
|
color: Colors.black)),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 16),
|
||||||
|
ToggleSwitch(
|
||||||
|
minWidth: 150.0,
|
||||||
|
cornerRadius: 20.0,
|
||||||
|
activeBgColors: const [[Colors.green], [Colors.redAccent]],
|
||||||
|
activeFgColor: Colors.white,
|
||||||
|
inactiveBgColor: Colors.grey,
|
||||||
|
inactiveFgColor: Colors.white,
|
||||||
|
initialLabelIndex: 1,
|
||||||
|
totalSwitches: VacationResponderStatus.values.length,
|
||||||
|
labels: VacationResponderStatus.values
|
||||||
|
.map((status) => status.getTitle(context))
|
||||||
|
.toList(),
|
||||||
|
radiusStyle: true,
|
||||||
|
onToggle: (index) {
|
||||||
|
log('VacationView::build():ToggleSwitch:index: $index');
|
||||||
|
final newStatus = index == 0
|
||||||
|
? VacationResponderStatus.activated
|
||||||
|
: VacationResponderStatus.deactivated;
|
||||||
|
controller.updateVacationPresentation(newStatus: newStatus);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
]),
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
Obx(() => AbsorbPointer(
|
||||||
|
absorbing: controller.isVacationDeactivated,
|
||||||
|
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||||
|
Text(
|
||||||
|
AppLocalizations.of(context).startDate,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 15,
|
||||||
|
fontWeight: FontWeight.normal,
|
||||||
|
color: Colors.black.withOpacity(
|
||||||
|
controller.isVacationDeactivated ? 0.5 : 1.0))),
|
||||||
|
const SizedBox(height: 16),
|
||||||
|
Row(children: [
|
||||||
|
Expanded(child: Obx(() => BorderButtonField<DateTime>(
|
||||||
|
value: controller.vacationPresentation.value.startDate,
|
||||||
|
mouseCursor: SystemMouseCursors.text,
|
||||||
|
textStyle: TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.normal,
|
||||||
|
color: Colors.black.withOpacity(
|
||||||
|
controller.isVacationDeactivated ? 0.5 : 1.0)),
|
||||||
|
hintText: AppLocalizations.of(context).startDate,
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.date_range,
|
||||||
|
color: AppColor.colorIconTextField,
|
||||||
|
size: 20),
|
||||||
|
tapActionCallback: (value) =>
|
||||||
|
controller.selectDate(context, DateType.start, value)))),
|
||||||
|
const SizedBox(width: 16),
|
||||||
|
Expanded(child: Obx(() => BorderButtonField<TimeOfDay>(
|
||||||
|
value: controller.vacationPresentation.value.startTime,
|
||||||
|
mouseCursor: SystemMouseCursors.text,
|
||||||
|
textStyle: TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.normal,
|
||||||
|
color: Colors.black.withOpacity(
|
||||||
|
controller.isVacationDeactivated ? 0.5 : 1.0)),
|
||||||
|
hintText: AppLocalizations.of(context).noStartTime,
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.timer,
|
||||||
|
color: AppColor.colorIconTextField,
|
||||||
|
size: 20),
|
||||||
|
tapActionCallback: (value) =>
|
||||||
|
controller.selectTime(context, DateType.start, value))))
|
||||||
|
]),
|
||||||
|
]),
|
||||||
|
)),
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
Obx(() => AbsorbPointer(
|
||||||
|
absorbing: controller.isVacationDeactivated,
|
||||||
|
child: CheckboxListTile(
|
||||||
|
contentPadding: EdgeInsets.zero,
|
||||||
|
activeColor: AppColor.primaryColor.withOpacity(
|
||||||
|
controller.isVacationDeactivated ? 0.5 : 1.0),
|
||||||
|
controlAffinity: ListTileControlAffinity.leading,
|
||||||
|
value: controller.vacationPresentation.value.vacationStopEnabled,
|
||||||
|
onChanged: (value) =>
|
||||||
|
controller.updateVacationPresentation(vacationStopEnabled: value),
|
||||||
|
title: Text(AppLocalizations.of(context).vacationStopsAt,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 15,
|
||||||
|
fontWeight: FontWeight.normal,
|
||||||
|
color: Colors.black.withOpacity(
|
||||||
|
controller.isVacationDeactivated ? 0.5 : 1.0))),
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
Obx(() => AbsorbPointer(
|
||||||
|
absorbing: !controller.canChangeEndDate,
|
||||||
|
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||||
|
Text(
|
||||||
|
AppLocalizations.of(context).endDate,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 15,
|
||||||
|
fontWeight: FontWeight.normal,
|
||||||
|
color: Colors.black.withOpacity(
|
||||||
|
!controller.canChangeEndDate ? 0.5 : 1.0))),
|
||||||
|
const SizedBox(height: 16),
|
||||||
|
Row(children: [
|
||||||
|
Expanded(child: Obx(() => BorderButtonField<DateTime>(
|
||||||
|
value: controller.vacationPresentation.value.endDate,
|
||||||
|
mouseCursor: SystemMouseCursors.text,
|
||||||
|
textStyle: TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.normal,
|
||||||
|
color: Colors.black.withOpacity(
|
||||||
|
!controller.canChangeEndDate ? 0.5 : 1.0)),
|
||||||
|
hintText: AppLocalizations.of(context).noEndDate,
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.date_range,
|
||||||
|
color: AppColor.colorIconTextField,
|
||||||
|
size: 20),
|
||||||
|
tapActionCallback: (value) =>
|
||||||
|
controller.selectDate(context, DateType.end, value)))),
|
||||||
|
const SizedBox(width: 16),
|
||||||
|
Expanded(child: Obx(() => BorderButtonField<TimeOfDay>(
|
||||||
|
value: controller.vacationPresentation.value.endTime,
|
||||||
|
mouseCursor: SystemMouseCursors.text,
|
||||||
|
textStyle: TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.normal,
|
||||||
|
color: Colors.black.withOpacity(
|
||||||
|
!controller.canChangeEndDate ? 0.5 : 1.0)),
|
||||||
|
hintText: AppLocalizations.of(context).noEndTime,
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.timer,
|
||||||
|
color: AppColor.colorIconTextField,
|
||||||
|
size: 20),
|
||||||
|
tapActionCallback: (value) =>
|
||||||
|
controller.selectTime(context, DateType.end, value))))
|
||||||
|
]),
|
||||||
|
])
|
||||||
|
)),
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
Obx(() => AbsorbPointer(
|
||||||
|
absorbing: controller.isVacationDeactivated,
|
||||||
|
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||||
|
Text(
|
||||||
|
AppLocalizations.of(context).messageBody,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 15,
|
||||||
|
fontWeight: FontWeight.normal,
|
||||||
|
color: Colors.black.withOpacity(
|
||||||
|
controller.isVacationDeactivated ? 0.5 : 1.0))),
|
||||||
|
const SizedBox(height: 16),
|
||||||
|
_buildMessageBodyWidget(
|
||||||
|
context,
|
||||||
|
controller.isVacationDeactivated ? 0.5 : 1.0)
|
||||||
|
]),
|
||||||
|
)),
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
Align(
|
||||||
|
alignment: Alignment.centerRight,
|
||||||
|
child: buildTextButton(
|
||||||
|
AppLocalizations.of(context).save,
|
||||||
|
width: 128,
|
||||||
|
height: 44,
|
||||||
|
radius: 10,
|
||||||
|
onTap: () => controller.saveVacation(context)),
|
||||||
|
)
|
||||||
|
]
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildMessageBodyWidget(BuildContext context, double opacity) {
|
||||||
|
return (TextFieldBuilder()
|
||||||
|
..key(const Key('message_body_editor'))
|
||||||
|
..cursorColor(Colors.black)
|
||||||
|
..addController(controller.messageBodyEditorController)
|
||||||
|
..textStyle(TextStyle(
|
||||||
|
fontWeight: FontWeight.normal,
|
||||||
|
color: Colors.black.withOpacity(opacity),
|
||||||
|
fontSize: 16))
|
||||||
|
..textDecoration((VacationInputDecorationBuilder()
|
||||||
|
..setContentPadding(const EdgeInsets.symmetric(
|
||||||
|
vertical: BuildUtils.isWeb ? 16 : 12,
|
||||||
|
horizontal: 12))
|
||||||
|
..setHintStyle(TextStyle(
|
||||||
|
color: AppColor.colorHintInputCreateMailbox.withOpacity(opacity),
|
||||||
|
fontSize: 16))
|
||||||
|
..setHintText(AppLocalizations.of(context).hintMessageBodyVacation))
|
||||||
|
.build())
|
||||||
|
..minLines(8)
|
||||||
|
..maxLines(null))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
+37
@@ -0,0 +1,37 @@
|
|||||||
|
|
||||||
|
import 'package:core/core.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class VacationInputDecorationBuilder extends InputDecorationBuilder {
|
||||||
|
|
||||||
|
@override
|
||||||
|
InputDecoration build() {
|
||||||
|
return InputDecoration(
|
||||||
|
enabledBorder: enabledBorder ?? const OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(10)),
|
||||||
|
borderSide: BorderSide(width: 1, color: AppColor.colorInputBorderCreateMailbox)),
|
||||||
|
focusedBorder: enabledBorder ?? const OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(10)),
|
||||||
|
borderSide: BorderSide(width: 1, color: AppColor.colorTextButton)),
|
||||||
|
errorBorder: errorBorder ?? const OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(10)),
|
||||||
|
borderSide: BorderSide(width: 1, color: AppColor.colorInputBorderErrorVerifyName)),
|
||||||
|
focusedErrorBorder: errorBorder ?? const OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(10)),
|
||||||
|
borderSide: BorderSide(width: 1, color: AppColor.colorInputBorderErrorVerifyName)),
|
||||||
|
prefixText: prefixText,
|
||||||
|
labelText: labelText,
|
||||||
|
floatingLabelBehavior: FloatingLabelBehavior.never,
|
||||||
|
labelStyle: labelStyle ?? const TextStyle(color: Colors.black, fontSize: 16),
|
||||||
|
hintText: hintText,
|
||||||
|
isDense: true,
|
||||||
|
hintStyle: hintStyle ?? const TextStyle(color: AppColor.colorHintInputCreateMailbox, fontSize: 16),
|
||||||
|
contentPadding: contentPadding ?? const EdgeInsets.symmetric(horizontal: 12, vertical: 12),
|
||||||
|
errorText: errorText,
|
||||||
|
errorStyle: errorTextStyle ?? const TextStyle(color: AppColor.colorInputBorderErrorVerifyName, fontSize: 13),
|
||||||
|
filled: true,
|
||||||
|
fillColor: errorText?.isNotEmpty == true
|
||||||
|
? AppColor.colorInputBackgroundErrorVerifyName
|
||||||
|
: Colors.white);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -44,9 +44,9 @@ class EmailRulesView extends GetWidget<EmailRulesController> with AppLoaderMixin
|
|||||||
return const EdgeInsets.only(left: 16, top: 16, right: 24, bottom: 24);
|
return const EdgeInsets.only(left: 16, top: 16, right: 24, bottom: 24);
|
||||||
} else if (_responsiveUtils.isTabletLarge(context) ||
|
} else if (_responsiveUtils.isTabletLarge(context) ||
|
||||||
_responsiveUtils.isTablet(context)) {
|
_responsiveUtils.isTablet(context)) {
|
||||||
return const EdgeInsets.only(right: 32, top: 16, bottom: 16);
|
return const EdgeInsets.only(right: 24, top: 16, bottom: 16);
|
||||||
} else {
|
} else {
|
||||||
return const EdgeInsets.only(right: 32, top: 16, bottom: 16);
|
return const EdgeInsets.only(right: 24, top: 16, bottom: 16);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (_responsiveUtils.isDesktop(context) ||
|
if (_responsiveUtils.isDesktop(context) ||
|
||||||
@@ -55,7 +55,7 @@ class EmailRulesView extends GetWidget<EmailRulesController> with AppLoaderMixin
|
|||||||
_responsiveUtils.isTablet(context)) {
|
_responsiveUtils.isTablet(context)) {
|
||||||
return const EdgeInsets.only(right: 32, top: 16, bottom: 16);
|
return const EdgeInsets.only(right: 32, top: 16, bottom: 16);
|
||||||
} else {
|
} else {
|
||||||
return const EdgeInsets.only(top: 16, bottom: 16, right: 28, left: 20);
|
return const EdgeInsets.only(right: 18, top: 16, bottom: 16, left: 10);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:intl/intl.dart';
|
||||||
|
|
||||||
|
extension DateTimeExtension on DateTime? {
|
||||||
|
|
||||||
|
String formatDate({String pattern = 'yyyy/MM/dd', String locale = 'en_US'}) {
|
||||||
|
if (this != null) {
|
||||||
|
return DateFormat(pattern, locale).format(this!.toLocal());
|
||||||
|
} else {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
extension TimeOfDayExtension on TimeOfDay? {
|
||||||
|
|
||||||
|
String formatTime(BuildContext context) {
|
||||||
|
if (this != null) {
|
||||||
|
return this!.format(context);
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
+2
-2
@@ -21,7 +21,7 @@ class LanguageAndRegionView extends GetWidget<LanguageAndRegionController> {
|
|||||||
body: Container(
|
body: Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
margin: _responsiveUtils.isWebDesktop(context)
|
margin: _responsiveUtils.isWebDesktop(context)
|
||||||
? const EdgeInsets.only(left: 48, right: 24, top: 24, bottom: 24)
|
? const EdgeInsets.all(24)
|
||||||
: EdgeInsets.zero,
|
: EdgeInsets.zero,
|
||||||
color: _responsiveUtils.isWebDesktop(context) ? null : Colors.white,
|
color: _responsiveUtils.isWebDesktop(context) ? null : Colors.white,
|
||||||
decoration: _responsiveUtils.isWebDesktop(context)
|
decoration: _responsiveUtils.isWebDesktop(context)
|
||||||
@@ -37,7 +37,7 @@ class LanguageAndRegionView extends GetWidget<LanguageAndRegionController> {
|
|||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
left: _responsiveUtils.isWebDesktop(context) ? 24 : 10,
|
left: _responsiveUtils.isWebDesktop(context) ? 24 : 10,
|
||||||
top: 24,
|
top: 24,
|
||||||
right: 24),
|
right: BuildUtils.isWeb ? 24 : 18),
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import 'package:tmail_ui_user/features/manage_account/data/network/manage_accoun
|
|||||||
import 'package:tmail_ui_user/features/manage_account/data/repository/manage_account_repository_impl.dart';
|
import 'package:tmail_ui_user/features/manage_account/data/repository/manage_account_repository_impl.dart';
|
||||||
import 'package:tmail_ui_user/features/manage_account/domain/repository/manage_account_repository.dart';
|
import 'package:tmail_ui_user/features/manage_account/domain/repository/manage_account_repository.dart';
|
||||||
import 'package:tmail_ui_user/features/manage_account/domain/usecases/log_out_oidc_interactor.dart';
|
import 'package:tmail_ui_user/features/manage_account/domain/usecases/log_out_oidc_interactor.dart';
|
||||||
|
import 'package:tmail_ui_user/features/manage_account/presentation/configuration/configuration_bindings.dart';
|
||||||
import 'package:tmail_ui_user/features/manage_account/presentation/language_and_region/language_and_region_bindings.dart';
|
import 'package:tmail_ui_user/features/manage_account/presentation/language_and_region/language_and_region_bindings.dart';
|
||||||
import 'package:tmail_ui_user/features/manage_account/presentation/manage_account_dashboard_controller.dart';
|
import 'package:tmail_ui_user/features/manage_account/presentation/manage_account_dashboard_controller.dart';
|
||||||
import 'package:tmail_ui_user/features/manage_account/presentation/menu/manage_account_menu_bindings.dart';
|
import 'package:tmail_ui_user/features/manage_account/presentation/menu/manage_account_menu_bindings.dart';
|
||||||
@@ -39,6 +40,7 @@ class ManageAccountDashBoardBindings extends BaseBindings {
|
|||||||
ManageAccountMenuBindings().dependencies();
|
ManageAccountMenuBindings().dependencies();
|
||||||
ProfileBindings().dependencies();
|
ProfileBindings().dependencies();
|
||||||
LanguageAndRegionBindings().dependencies();
|
LanguageAndRegionBindings().dependencies();
|
||||||
|
ConfigurationBindings().dependencies();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@@ -23,15 +23,12 @@ import 'package:tmail_ui_user/main/routes/route_navigation.dart';
|
|||||||
|
|
||||||
class ManageAccountDashBoardController extends ReloadableController {
|
class ManageAccountDashBoardController extends ReloadableController {
|
||||||
|
|
||||||
final _responsiveUtils = Get.find<ResponsiveUtils>();
|
|
||||||
|
|
||||||
final menuDrawerKey = GlobalKey<ScaffoldState>(debugLabel: 'manage_account');
|
final menuDrawerKey = GlobalKey<ScaffoldState>(debugLabel: 'manage_account');
|
||||||
|
|
||||||
final appInformation = Rxn<PackageInfo>();
|
final appInformation = Rxn<PackageInfo>();
|
||||||
final userProfile = Rxn<UserProfile>();
|
final userProfile = Rxn<UserProfile>();
|
||||||
final accountId = Rxn<AccountId>();
|
final accountId = Rxn<AccountId>();
|
||||||
final accountMenuItemSelected = AccountMenuItem.profiles.obs;
|
final accountMenuItemSelected = AccountMenuItem.profiles.obs;
|
||||||
|
|
||||||
final sessionCurrent = Rxn<Session>();
|
final sessionCurrent = Rxn<Session>();
|
||||||
|
|
||||||
ManageAccountDashBoardController(
|
ManageAccountDashBoardController(
|
||||||
@@ -116,7 +113,7 @@ class ManageAccountDashBoardController extends ReloadableController {
|
|||||||
ForwardBindings().dependencies();
|
ForwardBindings().dependencies();
|
||||||
}
|
}
|
||||||
accountMenuItemSelected.value = newAccountMenuItem;
|
accountMenuItemSelected.value = newAccountMenuItem;
|
||||||
if (currentContext != null && !_responsiveUtils.isDesktop(currentContext!)) {
|
if (isMenuDrawerOpen) {
|
||||||
closeMenuDrawer();
|
closeMenuDrawer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ 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';
|
||||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/mixin/user_setting_popup_menu_mixin.dart';
|
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/mixin/user_setting_popup_menu_mixin.dart';
|
||||||
|
import 'package:tmail_ui_user/features/manage_account/presentation/configuration/configuration_view.dart';
|
||||||
import 'package:tmail_ui_user/features/manage_account/presentation/email_rules/email_rules_view.dart';
|
import 'package:tmail_ui_user/features/manage_account/presentation/email_rules/email_rules_view.dart';
|
||||||
import 'package:tmail_ui_user/features/manage_account/presentation/forward/forward_view.dart';
|
import 'package:tmail_ui_user/features/manage_account/presentation/forward/forward_view.dart';
|
||||||
import 'package:tmail_ui_user/features/manage_account/presentation/language_and_region/language_and_region_view.dart';
|
import 'package:tmail_ui_user/features/manage_account/presentation/language_and_region/language_and_region_view.dart';
|
||||||
@@ -160,6 +161,8 @@ class ManageAccountDashBoardView extends GetWidget<ManageAccountDashBoardControl
|
|||||||
} else {
|
} else {
|
||||||
return const SizedBox.shrink();
|
return const SizedBox.shrink();
|
||||||
}
|
}
|
||||||
|
case AccountMenuItem.vacation:
|
||||||
|
return VacationView();
|
||||||
default:
|
default:
|
||||||
return const SizedBox.shrink();
|
return const SizedBox.shrink();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ class ManageAccountMenuController extends BaseController {
|
|||||||
final listAccountMenuItem = RxList<AccountMenuItem>([
|
final listAccountMenuItem = RxList<AccountMenuItem>([
|
||||||
AccountMenuItem.profiles,
|
AccountMenuItem.profiles,
|
||||||
AccountMenuItem.languageAndRegion,
|
AccountMenuItem.languageAndRegion,
|
||||||
|
AccountMenuItem.vacation,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
void _initWorker() {
|
void _initWorker() {
|
||||||
@@ -51,6 +52,9 @@ class ManageAccountMenuController extends BaseController {
|
|||||||
listAccountMenuItem.add(
|
listAccountMenuItem.add(
|
||||||
AccountMenuItem.languageAndRegion,
|
AccountMenuItem.languageAndRegion,
|
||||||
);
|
);
|
||||||
|
listAccountMenuItem.add(
|
||||||
|
AccountMenuItem.vacation,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ class ManageAccountMenuView extends GetWidget<ManageAccountMenuController> {
|
|||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () => controller.dashBoardController.logoutAction(),
|
onTap: () => controller.dashBoardController.logoutAction(),
|
||||||
child: Row(children: [
|
child: Row(children: [
|
||||||
SvgPicture.asset(_imagePaths.icLogout, fit: BoxFit.fill),
|
SvgPicture.asset(_imagePaths.icSignOut, fit: BoxFit.fill),
|
||||||
const SizedBox(width: 12),
|
const SizedBox(width: 12),
|
||||||
Expanded(child: Text(AppLocalizations.of(context).sign_out,
|
Expanded(child: Text(AppLocalizations.of(context).sign_out,
|
||||||
style: const TextStyle(fontWeight: FontWeight.normal, fontSize: 15, color: Colors.black)))
|
style: const TextStyle(fontWeight: FontWeight.normal, fontSize: 15, color: Colors.black)))
|
||||||
|
|||||||
+14
-19
@@ -25,31 +25,26 @@ class AccountMenuItemTileBuilder extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return InkWell(
|
return Padding(
|
||||||
onTap: () => onSelectAccountMenuItemAction?.call(_menuItem),
|
padding: const EdgeInsets.only(top: 6),
|
||||||
child: Theme(
|
child: InkWell(
|
||||||
data: ThemeData(
|
onTap: () => onSelectAccountMenuItemAction?.call(_menuItem),
|
||||||
splashColor: Colors.transparent,
|
|
||||||
highlightColor: Colors.transparent),
|
|
||||||
child: Container(
|
child: Container(
|
||||||
key: const Key('account_menu_item_tile'),
|
key: const Key('account_menu_item_tile'),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(10),
|
borderRadius: BorderRadius.circular(10),
|
||||||
color: backgroundColorItem),
|
color: backgroundColorItem),
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6),
|
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6),
|
||||||
child: MediaQuery(
|
child: Column(children: [
|
||||||
data: const MediaQueryData(padding: EdgeInsets.zero),
|
Row(children: [
|
||||||
child: Column(children: [
|
SvgPicture.asset(_menuItem.getIcon(_imagePaths)),
|
||||||
Row(children: [
|
const SizedBox(width: 12),
|
||||||
SvgPicture.asset(_menuItem.getIcon(_imagePaths), width: 28, height: 28, fit: BoxFit.fill),
|
Expanded(child: Text(_menuItem.getName(context),
|
||||||
const SizedBox(width: 12),
|
style: const TextStyle(fontWeight: FontWeight.normal, fontSize: 15, color: Colors.black)))
|
||||||
Expanded(child: Text(_menuItem.getName(context),
|
]),
|
||||||
style: const TextStyle(fontWeight: FontWeight.normal, fontSize: 15, color: Colors.black)))
|
])
|
||||||
]),
|
)),
|
||||||
])
|
);
|
||||||
)
|
|
||||||
)
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Color get backgroundColorItem {
|
Color get backgroundColorItem {
|
||||||
|
|||||||
@@ -8,9 +8,7 @@ enum AccountMenuItem {
|
|||||||
languageAndRegion,
|
languageAndRegion,
|
||||||
emailRules,
|
emailRules,
|
||||||
forward,
|
forward,
|
||||||
}
|
vacation;
|
||||||
|
|
||||||
extension AccountMenuItemExtension on AccountMenuItem {
|
|
||||||
|
|
||||||
String getIcon(ImagePaths imagePaths) {
|
String getIcon(ImagePaths imagePaths) {
|
||||||
switch(this) {
|
switch(this) {
|
||||||
@@ -22,6 +20,8 @@ extension AccountMenuItemExtension on AccountMenuItem {
|
|||||||
return imagePaths.icEmailRules;
|
return imagePaths.icEmailRules;
|
||||||
case AccountMenuItem.forward:
|
case AccountMenuItem.forward:
|
||||||
return imagePaths.icForward;
|
return imagePaths.icForward;
|
||||||
|
case AccountMenuItem.configuration:
|
||||||
|
return imagePaths.icConfiguration;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -35,6 +35,8 @@ extension AccountMenuItemExtension on AccountMenuItem {
|
|||||||
return AppLocalizations.of(context).emailRules;
|
return AppLocalizations.of(context).emailRules;
|
||||||
case AccountMenuItem.forward:
|
case AccountMenuItem.forward:
|
||||||
return AppLocalizations.of(context).forwarding;
|
return AppLocalizations.of(context).forwarding;
|
||||||
|
case AccountMenuItem.configuration:
|
||||||
|
return AppLocalizations.of(context).configuration;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||||
|
|
||||||
|
enum ConfigurationTabType {
|
||||||
|
vacation;
|
||||||
|
|
||||||
|
String getTitle(BuildContext context) {
|
||||||
|
switch(this) {
|
||||||
|
case ConfigurationTabType.vacation:
|
||||||
|
return AppLocalizations.of(context).vacation;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
|
||||||
|
import 'package:flutter/widgets.dart';
|
||||||
|
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||||
|
|
||||||
|
enum DateType {
|
||||||
|
start,
|
||||||
|
end;
|
||||||
|
|
||||||
|
String getTitle(BuildContext context) {
|
||||||
|
switch(this) {
|
||||||
|
case DateType.start:
|
||||||
|
return AppLocalizations.of(context).startDate;
|
||||||
|
case DateType.end:
|
||||||
|
return AppLocalizations.of(context).endDate;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:tmail_ui_user/features/manage_account/presentation/model/vacation/vacation_responder_status.dart';
|
||||||
|
|
||||||
|
class VacationPresentation {
|
||||||
|
final VacationResponderStatus status;
|
||||||
|
final DateTime? startDate;
|
||||||
|
final TimeOfDay? startTime;
|
||||||
|
final DateTime? endDate;
|
||||||
|
final TimeOfDay? endTime;
|
||||||
|
final String? messageBody;
|
||||||
|
final bool vacationStopEnabled;
|
||||||
|
|
||||||
|
VacationPresentation({
|
||||||
|
this.status = VacationResponderStatus.deactivated,
|
||||||
|
this.startDate,
|
||||||
|
this.startTime,
|
||||||
|
this.endDate,
|
||||||
|
this.endTime,
|
||||||
|
this.messageBody,
|
||||||
|
this.vacationStopEnabled = false,
|
||||||
|
});
|
||||||
|
|
||||||
|
factory VacationPresentation.initialize() {
|
||||||
|
return VacationPresentation();
|
||||||
|
}
|
||||||
|
|
||||||
|
VacationPresentation copyWidth({
|
||||||
|
VacationResponderStatus? status,
|
||||||
|
DateTime? startDate,
|
||||||
|
TimeOfDay? startTime,
|
||||||
|
DateTime? endDate,
|
||||||
|
TimeOfDay? endTime,
|
||||||
|
String? messageBody,
|
||||||
|
bool? vacationStopEnabled,
|
||||||
|
}) {
|
||||||
|
return VacationPresentation(
|
||||||
|
status: status ?? this.status,
|
||||||
|
startDate: startDate ?? this.startDate,
|
||||||
|
startTime: startTime ?? this.startTime,
|
||||||
|
endDate: endDate ?? this.endDate,
|
||||||
|
endTime: endTime ?? this.endTime,
|
||||||
|
messageBody: messageBody ?? this.messageBody,
|
||||||
|
vacationStopEnabled: vacationStopEnabled ?? this.vacationStopEnabled
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
|
||||||
|
import 'package:flutter/widgets.dart';
|
||||||
|
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||||
|
|
||||||
|
enum VacationResponderStatus {
|
||||||
|
activated,
|
||||||
|
deactivated;
|
||||||
|
|
||||||
|
String getTitle(BuildContext context) {
|
||||||
|
switch(this) {
|
||||||
|
case VacationResponderStatus.activated:
|
||||||
|
return AppLocalizations.of(context).activated;
|
||||||
|
case VacationResponderStatus.deactivated:
|
||||||
|
return AppLocalizations.of(context).deactivated;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -51,7 +51,10 @@ class IdentitiesView extends GetWidget<IdentitiesController> with PopupMenuWidge
|
|||||||
responsiveUtils: _responsiveUtils,
|
responsiveUtils: _responsiveUtils,
|
||||||
mobile: Scaffold(
|
mobile: Scaffold(
|
||||||
body: Container(
|
body: Container(
|
||||||
margin: const EdgeInsets.only(top: 16, bottom: 16, right: 24),
|
margin: const EdgeInsets.only(
|
||||||
|
top: 16,
|
||||||
|
bottom: 16,
|
||||||
|
right: BuildUtils.isWeb ? 24 : 10),
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:tmail_ui_user/features/base/base_bindings.dart';
|
import 'package:tmail_ui_user/features/base/base_bindings.dart';
|
||||||
import 'package:tmail_ui_user/features/manage_account/presentation/email_rules/email_rules_bindings.dart';
|
|
||||||
import 'package:tmail_ui_user/features/manage_account/presentation/profiles/identities/identities_bindings.dart';
|
import 'package:tmail_ui_user/features/manage_account/presentation/profiles/identities/identities_bindings.dart';
|
||||||
import 'package:tmail_ui_user/features/manage_account/presentation/profiles/profiles_controller.dart';
|
import 'package:tmail_ui_user/features/manage_account/presentation/profiles/profiles_controller.dart';
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ class ProfilesView extends GetWidget<ProfilesController> {
|
|||||||
: Colors.white,
|
: Colors.white,
|
||||||
body: Container(
|
body: Container(
|
||||||
margin: _responsiveUtils.isWebDesktop(context)
|
margin: _responsiveUtils.isWebDesktop(context)
|
||||||
? const EdgeInsets.only(left: 48, right: 24, top: 24, bottom: 24)
|
? const EdgeInsets.all(24)
|
||||||
: EdgeInsets.zero,
|
: EdgeInsets.zero,
|
||||||
color: _responsiveUtils.isWebDesktop(context) ? null : Colors.white,
|
color: _responsiveUtils.isWebDesktop(context) ? null : Colors.white,
|
||||||
decoration: _responsiveUtils.isWebDesktop(context)
|
decoration: _responsiveUtils.isWebDesktop(context)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"@@last_modified": "2022-08-18T10:12:35.405050",
|
"@@last_modified": "2022-08-17T17:27:40.386002",
|
||||||
"initializing_data": "Initializing data...",
|
"initializing_data": "Initializing data...",
|
||||||
"@initializing_data": {
|
"@initializing_data": {
|
||||||
"type": "text",
|
"type": "text",
|
||||||
@@ -1903,5 +1903,83 @@
|
|||||||
"type": "text",
|
"type": "text",
|
||||||
"placeholders_order": [],
|
"placeholders_order": [],
|
||||||
"placeholders": {}
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"vacation": "Vacation",
|
||||||
|
"@vacation": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"configuration": "Configuration",
|
||||||
|
"@configuration": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"vacationResponder": "Vacation responder",
|
||||||
|
"@vacationResponder": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"activated": "Activated",
|
||||||
|
"@activated": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"deactivated": "Deactivated",
|
||||||
|
"@deactivated": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"startDate": "Start date",
|
||||||
|
"@startDate": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"endDate": "End date",
|
||||||
|
"@endDate": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"vacationStopsAt": "Vacation stops at",
|
||||||
|
"@vacationStopsAt": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"messageBody": "Message body",
|
||||||
|
"@messageBody": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"hintMessageBodyVacation": "Start writing your vacation message here",
|
||||||
|
"@hintMessageBodyVacation": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"noStartTime": "No start time",
|
||||||
|
"@noStartTime": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"noEndTime": "No end time",
|
||||||
|
"@noEndTime": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"noEndDate": "No end date",
|
||||||
|
"@noEndDate": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1959,4 +1959,95 @@ class AppLocalizations {
|
|||||||
name: 'forwarding',
|
name: 'forwarding',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String get vacation {
|
||||||
|
return Intl.message(
|
||||||
|
'Vacation',
|
||||||
|
name: 'vacation',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
String get configuration {
|
||||||
|
return Intl.message(
|
||||||
|
'Configuration',
|
||||||
|
name: 'configuration',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
String get vacationResponder {
|
||||||
|
return Intl.message(
|
||||||
|
'Vacation responder',
|
||||||
|
name: 'vacationResponder',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
String get activated {
|
||||||
|
return Intl.message(
|
||||||
|
'Activated',
|
||||||
|
name: 'activated',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
String get deactivated {
|
||||||
|
return Intl.message(
|
||||||
|
'Deactivated',
|
||||||
|
name: 'deactivated',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
String get startDate {
|
||||||
|
return Intl.message(
|
||||||
|
'Start date',
|
||||||
|
name: 'startDate',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
String get endDate {
|
||||||
|
return Intl.message(
|
||||||
|
'End date',
|
||||||
|
name: 'endDate',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
String get vacationStopsAt {
|
||||||
|
return Intl.message(
|
||||||
|
'Vacation stops at',
|
||||||
|
name: 'vacationStopsAt',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
String get messageBody {
|
||||||
|
return Intl.message(
|
||||||
|
'Message body',
|
||||||
|
name: 'messageBody',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
String get hintMessageBodyVacation {
|
||||||
|
return Intl.message(
|
||||||
|
'Start writing your vacation message here',
|
||||||
|
name: 'hintMessageBodyVacation',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
String get noStartTime {
|
||||||
|
return Intl.message(
|
||||||
|
'No start time',
|
||||||
|
name: 'noStartTime',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
String get noEndTime {
|
||||||
|
return Intl.message(
|
||||||
|
'No end time',
|
||||||
|
name: 'noEndTime',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
String get noEndDate {
|
||||||
|
return Intl.message(
|
||||||
|
'No end date',
|
||||||
|
name: 'noEndDate',
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -187,6 +187,8 @@ dependencies:
|
|||||||
|
|
||||||
byte_converter: 1.3.0
|
byte_converter: 1.3.0
|
||||||
|
|
||||||
|
toggle_switch: 2.0.1
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
|||||||
Reference in New Issue
Block a user