1bc45e35f3
TF-3769 Thread Detail fallback to single email when get thread fails TF-3769 Thread Detail fix font height thread TF-3769 Thread Detail init with get status TF-3769 Thread Detail fix font height email receiver and sender TF-3769 Thread Detail refactor reset thread detail ui action UpdatedThreadDetailSettingAction TF-3769 Thread Detail refresh settings on app lifecycle changed TF-3769 Thread Detail fix font height email receiver and sender TF-3769 Thread Detail fix scroll view exception of single email TF-3769 Thread Detail refactor local setting TF-3769 Thread Detail optimize get cache setting TF-3769 Thread Detail fix font height email receiver TF-3769 Thread Detail refactor local setting cache TF-3769 Thread Detail fix font height email receiver and sender TF-3769 Thread Detail use CacheExceptionThrower for ManageAccountDataSourceImpl TF-3769 Thread Detail fix changing email in tablet view TF-3769 Thread Detail refresh on setting changed TF-3769 Thread Detail fix receiver alignments TF-3769 Thread Detail fix receiver alignments TF-3769 Thread Detail default setting enabled TF-3769 Thread Detail fix font style email receiver and sender TF-3769 Thread Detail fix toggle setting when responsive TF-3769 Thread Detail adjust receive time position when single email TF-3769 Thread Detail revert initializeThreadDetailEmails to void TF-3769 Thread Detail fix CI on initializeThreadDetailEmails test TF-3769 Thread Detail fix spacing email sender TF-3769 Thread Detail update receiver color mobile TF-3769 Thread Detail update collapsed preview letter spacing TF-3769 Thread Detail update receiver color mobile TF-3769 Thread Detail fix receive time position TF-3769 Thread Detail add mark read button mobile collapsed email TF-3769 Thread Detail fix font style email receiver and sender TF-3769 Thread Detail update collapsed preview font weight TF-3769 Thread Detail fix position email receiver and sender
99 lines
4.2 KiB
Dart
99 lines
4.2 KiB
Dart
import 'package:flutter/material.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/base/setting_detail_view_builder.dart';
|
|
import 'package:tmail_ui_user/features/manage_account/presentation/menu/settings_utils.dart';
|
|
import 'package:tmail_ui_user/features/manage_account/presentation/model/account_menu_item.dart';
|
|
import 'package:tmail_ui_user/features/manage_account/presentation/model/setting_option_type.dart';
|
|
import 'package:tmail_ui_user/features/manage_account/presentation/preferences/preferences_controller.dart';
|
|
import 'package:tmail_ui_user/features/manage_account/presentation/preferences/widgets/setting_option_item.dart';
|
|
import 'package:tmail_ui_user/features/manage_account/presentation/widgets/setting_header_widget.dart';
|
|
|
|
class PreferencesView extends GetWidget<PreferencesController> with AppLoaderMixin {
|
|
const PreferencesView({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Column(
|
|
children: [
|
|
Obx(() {
|
|
if (!controller.isLoading) {
|
|
return const SizedBox.shrink();
|
|
}
|
|
return Padding(
|
|
padding: SettingsUtils.getSettingProgressBarPadding(
|
|
context,
|
|
controller.responsiveUtils,
|
|
),
|
|
child: horizontalLoadingWidget,
|
|
);
|
|
}),
|
|
Expanded(
|
|
child: SettingDetailViewBuilder(
|
|
responsiveUtils: controller.responsiveUtils,
|
|
padding: SettingsUtils.getSettingContentWithoutHeaderPadding(
|
|
context,
|
|
controller.responsiveUtils,
|
|
),
|
|
child: Container(
|
|
color: SettingsUtils.getContentBackgroundColor(
|
|
context, controller.responsiveUtils,
|
|
),
|
|
decoration: SettingsUtils.getBoxDecorationForContent(
|
|
context,
|
|
controller.responsiveUtils,
|
|
),
|
|
width: double.infinity,
|
|
padding: controller.responsiveUtils.isDesktop(context)
|
|
? const EdgeInsets.symmetric(vertical: 30, horizontal: 22)
|
|
: null,
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
if (controller.responsiveUtils.isWebDesktop(context))
|
|
const SettingHeaderWidget(
|
|
menuItem: AccountMenuItem.preferences,
|
|
padding: EdgeInsets.only(bottom: 21),
|
|
),
|
|
Obx(() {
|
|
final settingOption = controller.settingOption.value;
|
|
final localSettingOption = controller.localSettings;
|
|
|
|
if (settingOption == null && (localSettingOption.value?.isEmpty ?? true)) {
|
|
return const SizedBox.shrink();
|
|
}
|
|
|
|
final availableSettingOptions = [
|
|
if (settingOption != null) ...SettingOptionType.values.where(
|
|
(optionType) => !optionType.isLocal,
|
|
),
|
|
...SettingOptionType.values.where(
|
|
(optionType) => optionType.isLocal,
|
|
),
|
|
];
|
|
|
|
return Expanded(
|
|
child: ListView.separated(
|
|
itemCount: availableSettingOptions.length,
|
|
itemBuilder: (context, index) {
|
|
return SettingOptionItem(
|
|
imagePaths: controller.imagePaths,
|
|
settingOption: settingOption,
|
|
localSettings: localSettingOption.value ?? {},
|
|
optionType: availableSettingOptions[index],
|
|
onTapSettingOptionAction: controller.updateStateSettingOption,
|
|
);
|
|
},
|
|
separatorBuilder: (_, __) => const SizedBox(height: 49),
|
|
),
|
|
);
|
|
}),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
} |