TF-2682 Create always read receipt setting view
This commit is contained in:
+1
-1
@@ -87,7 +87,7 @@ class AlwaysReadReceiptController extends BaseController {
|
||||
void _getAlwaysReadReceiptSettingSuccess(
|
||||
GetAlwaysReadReceiptSettingSuccess success
|
||||
) {
|
||||
_updateAlwaysReadReceiptValue(success.isEnabled);
|
||||
_updateAlwaysReadReceiptValue(success.alwaysReadReceiptEnabled);
|
||||
}
|
||||
|
||||
void _getCurrentAlwaysReadReceiptSetting() {
|
||||
|
||||
+86
@@ -0,0 +1,86 @@
|
||||
import 'package:core/presentation/extensions/color_extension.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tmail_ui_user/features/base/mixin/app_loader_mixin.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/always_read_receipt/always_read_receipt_controller.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/menu/settings_utils.dart';
|
||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||
|
||||
class AlwaysReadReceiptView extends GetWidget<AlwaysReadReceiptController> with AppLoaderMixin {
|
||||
const AlwaysReadReceiptView({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: SettingsUtils.getBackgroundColor(context, controller.responsiveUtils),
|
||||
body: Container(
|
||||
color: SettingsUtils.getContentBackgroundColor(context, controller.responsiveUtils),
|
||||
decoration: SettingsUtils.getBoxDecorationForContent(context, controller.responsiveUtils),
|
||||
margin: SettingsUtils.getMarginViewForSettingDetails(context, controller.responsiveUtils),
|
||||
padding: SettingsUtils.getPaddingAlwaysReadReceiptSetting(context, controller.responsiveUtils),
|
||||
child: Column(
|
||||
children: [
|
||||
Obx(() {
|
||||
if (!controller.isLoading) {
|
||||
return const SizedBox(height: 3);
|
||||
}
|
||||
return horizontalLoadingWidget;
|
||||
}),
|
||||
Expanded(
|
||||
child: ListView(
|
||||
physics: const ClampingScrollPhysics(),
|
||||
children: [
|
||||
Text(
|
||||
AppLocalizations.of(context).emailReadReceipts,
|
||||
style: const TextStyle(
|
||||
fontSize: 17,
|
||||
height: 24 / 17,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Colors.black)),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
AppLocalizations.of(context).emailReadReceiptsSettingExplanation,
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
height: 20 / 16,
|
||||
color: AppColor.colorTextSettingDescriptions)),
|
||||
const SizedBox(height: 24),
|
||||
Row(
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: controller.toggleAlwaysReadReceipt,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(4),
|
||||
child: Obx(() {
|
||||
return SvgPicture.asset(
|
||||
controller.alwaysReadReceipt.value
|
||||
? controller.imagePaths.icSwitchOn
|
||||
: controller.imagePaths.icSwitchOff,
|
||||
fit: BoxFit.fill,
|
||||
width: 32,
|
||||
height: 20);
|
||||
}),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Text(
|
||||
AppLocalizations.of(context).emailReadReceiptsToggleDescription,
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
height: 20 / 16,
|
||||
color: Colors.black),
|
||||
)),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tmail_ui_user/features/base/state/banner_state.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/always_read_receipt/always_read_receipt_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/extensions/vacation_response_extension.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/forward/forward_view.dart';
|
||||
@@ -178,6 +179,12 @@ class ManageAccountDashBoardView extends GetWidget<ManageAccountDashBoardControl
|
||||
} else {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
case AccountMenuItem.alwaysReadReceipt:
|
||||
if(controller.isServerSettingsCapabilitySupported){
|
||||
return const AlwaysReadReceiptView();
|
||||
} else {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
case AccountMenuItem.forward:
|
||||
if(controller.isForwardCapabilitySupported){
|
||||
return ForwardView();
|
||||
|
||||
@@ -60,6 +60,26 @@ class SettingsFirstLevelView extends GetWidget<SettingsController> {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
}),
|
||||
Obx(() {
|
||||
if (controller.manageAccountDashboardController.isServerSettingsCapabilitySupported) {
|
||||
return Column(children: [
|
||||
SettingFirstLevelTileBuilder(
|
||||
AccountMenuItem.alwaysReadReceipt.getName(context),
|
||||
AccountMenuItem.alwaysReadReceipt.getIcon(controller.imagePaths),
|
||||
subtitle: AppLocalizations.of(context).emailReadReceiptsSettingExplanation,
|
||||
() => controller.selectSettings(AccountMenuItem.alwaysReadReceipt)
|
||||
),
|
||||
Divider(
|
||||
color: AppColor.colorDividerHorizontal,
|
||||
height: 1,
|
||||
indent: SettingsUtils.getHorizontalPadding(context, controller.responsiveUtils),
|
||||
endIndent: SettingsUtils.getHorizontalPadding(context, controller.responsiveUtils)
|
||||
),
|
||||
]);
|
||||
} else {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
}),
|
||||
Obx(() {
|
||||
if (controller.manageAccountDashboardController.isForwardCapabilitySupported) {
|
||||
return Column(children: [
|
||||
|
||||
@@ -7,6 +7,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tmail_ui_user/features/base/state/banner_state.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/always_read_receipt/always_read_receipt_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/extensions/vacation_response_extension.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/forward/forward_view.dart';
|
||||
@@ -207,6 +208,12 @@ class SettingsView extends GetWidget<SettingsController> {
|
||||
} else {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
case AccountMenuItem.alwaysReadReceipt:
|
||||
if (controller.manageAccountDashboardController.isServerSettingsCapabilitySupported) {
|
||||
return const AlwaysReadReceiptView();
|
||||
} else {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
case AccountMenuItem.forward:
|
||||
if (controller.manageAccountDashboardController.isForwardCapabilitySupported) {
|
||||
return ForwardView();
|
||||
|
||||
@@ -159,4 +159,15 @@ class SettingsUtils {
|
||||
return const EdgeInsets.only(right: 10, top: 16, bottom: 10, left: 48);
|
||||
}
|
||||
}
|
||||
|
||||
static EdgeInsets getPaddingAlwaysReadReceiptSetting(
|
||||
BuildContext context,
|
||||
ResponsiveUtils responsiveUtils
|
||||
) {
|
||||
if (responsiveUtils.isWebDesktop(context)) {
|
||||
return const EdgeInsets.all(24);
|
||||
} else {
|
||||
return EdgeInsets.zero;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user