TF-3769 Enable toggle thread detail feature in setting
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
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/model/local_setting_options.dart';
|
||||
|
||||
abstract class ManageAccountRepository {
|
||||
Future<void> persistLanguage(Locale localeCurrent);
|
||||
|
||||
Future<void> updateLocalSettings(
|
||||
Map<SupportedLocalSetting, LocalSettingOptions?> localSettings,
|
||||
);
|
||||
|
||||
Future<Map<SupportedLocalSetting, LocalSettingOptions?>> getLocalSettings(
|
||||
List<SupportedLocalSetting> supportedLocalSettings,
|
||||
);
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
import 'dart:ui';
|
||||
|
||||
abstract class PreferencesRepository {
|
||||
Future<void> persistLanguage(Locale localeCurrent);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import 'package:core/presentation/state/failure.dart';
|
||||
import 'package:core/presentation/state/success.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/model/local_setting_options.dart';
|
||||
|
||||
class GettingLocalSettingsState extends LoadingState {}
|
||||
|
||||
class GetLocalSettingsSuccess extends UIState {
|
||||
GetLocalSettingsSuccess(this.localSettings);
|
||||
|
||||
final Map<SupportedLocalSetting, LocalSettingOptions?> localSettings;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [localSettings];
|
||||
}
|
||||
|
||||
class GetLocalSettingsFailure extends FeatureFailure {
|
||||
GetLocalSettingsFailure({super.exception});
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import 'package:core/presentation/state/failure.dart';
|
||||
import 'package:core/presentation/state/success.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/model/local_setting_options.dart';
|
||||
|
||||
class UpdatingLocalSettingsState extends LoadingState {}
|
||||
|
||||
class UpdateLocalSettingsSuccess extends UIState {
|
||||
final Map<SupportedLocalSetting, LocalSettingOptions?> localSettings;
|
||||
|
||||
UpdateLocalSettingsSuccess(this.localSettings);
|
||||
|
||||
@override
|
||||
List<Object?> get props => [localSettings];
|
||||
}
|
||||
|
||||
class UpdateLocalSettingsFailure extends FeatureFailure {
|
||||
UpdateLocalSettingsFailure({super.exception});
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
import 'package:core/presentation/state/failure.dart';
|
||||
import 'package:core/presentation/state/success.dart';
|
||||
import 'package:core/utils/app_logger.dart';
|
||||
import 'package:dartz/dartz.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/domain/repository/manage_account_repository.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/domain/state/get_local_settings_state.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/model/local_setting_options.dart';
|
||||
|
||||
class GetLocalSettingsInteractor {
|
||||
const GetLocalSettingsInteractor(this._manageAccountRepository);
|
||||
|
||||
final ManageAccountRepository _manageAccountRepository;
|
||||
|
||||
Stream<Either<Failure, Success>> execute(
|
||||
List<SupportedLocalSetting> supportedLocalSettings,
|
||||
) async* {
|
||||
try {
|
||||
yield Right(GettingLocalSettingsState());
|
||||
final result = await _manageAccountRepository.getLocalSettings(supportedLocalSettings);
|
||||
yield Right(GetLocalSettingsSuccess(result));
|
||||
} catch (e) {
|
||||
logError('$runtimeType::execute(): exception: $e');
|
||||
yield Left(GetLocalSettingsFailure(exception: e));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,11 +4,11 @@ import 'dart:ui';
|
||||
import 'package:core/presentation/state/failure.dart';
|
||||
import 'package:core/presentation/state/success.dart';
|
||||
import 'package:dartz/dartz.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/domain/repository/preferences_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/state/save_language_state.dart';
|
||||
|
||||
class SaveLanguageInteractor {
|
||||
final PreferencesRepository manageAccountRepository;
|
||||
final ManageAccountRepository manageAccountRepository;
|
||||
|
||||
SaveLanguageInteractor(this.manageAccountRepository);
|
||||
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
import 'package:core/presentation/state/failure.dart';
|
||||
import 'package:core/presentation/state/success.dart';
|
||||
import 'package:core/utils/app_logger.dart';
|
||||
import 'package:dartz/dartz.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/domain/repository/manage_account_repository.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/domain/state/update_local_settings_state.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/model/local_setting_options.dart';
|
||||
|
||||
class UpdateLocalSettingsInteractor {
|
||||
const UpdateLocalSettingsInteractor(this._manageAccountRepository);
|
||||
|
||||
final ManageAccountRepository _manageAccountRepository;
|
||||
|
||||
Stream<Either<Failure, Success>> execute(
|
||||
Map<SupportedLocalSetting, LocalSettingOptions?> localSettings,
|
||||
) async* {
|
||||
try {
|
||||
yield Right(UpdatingLocalSettingsState());
|
||||
await _manageAccountRepository.updateLocalSettings(localSettings);
|
||||
yield Right(UpdateLocalSettingsSuccess(localSettings));
|
||||
} catch (e) {
|
||||
logError('$runtimeType::execute(): exception: $e');
|
||||
yield Left(UpdateLocalSettingsFailure(exception: e));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user