Display AI Scribe togge in Preference
This commit is contained in:
+6
@@ -6,6 +6,7 @@ import 'package:tmail_ui_user/features/manage_account/data/local/language_cache_
|
||||
import 'package:tmail_ui_user/features/manage_account/data/local/preferences_setting_manager.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/usecases/get_ai_scribe_config_interactor.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/domain/usecases/save_language_interactor.dart';
|
||||
import 'package:tmail_ui_user/features/server_settings/data/datasource/server_settings_data_source.dart';
|
||||
import 'package:tmail_ui_user/features/server_settings/data/datasource_impl/remote_server_settings_data_source_impl.dart';
|
||||
@@ -62,6 +63,10 @@ class PreferencesInteractorsBindings extends InteractorsBindings {
|
||||
() => SaveLanguageInteractor(Get.find<ManageAccountRepository>(tag: composerId)),
|
||||
tag: composerId,
|
||||
);
|
||||
Get.lazyPut(
|
||||
() => GetAIScribeConfigInteractor(Get.find<ManageAccountRepository>(tag: composerId)),
|
||||
tag: composerId,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -101,5 +106,6 @@ class PreferencesInteractorsBindings extends InteractorsBindings {
|
||||
Get.delete<ManageAccountRepositoryImpl>(tag: composerId);
|
||||
Get.delete<ManageAccountRepository>(tag: composerId);
|
||||
Get.delete<SaveLanguageInteractor>(tag: composerId);
|
||||
Get.delete<GetAIScribeConfigInteractor>(tag: composerId);
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import 'package:server_settings/server_settings/tmail_server_settings.dart';
|
||||
import 'package:tmail_ui_user/features/base/base_controller.dart';
|
||||
import 'package:tmail_ui_user/features/home/data/exceptions/session_exceptions.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/model/loader_status.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/domain/model/preferences/ai_scribe_config.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/domain/model/preferences/preferences_config.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/domain/model/preferences/preferences_setting.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/domain/model/preferences/spam_report_config.dart';
|
||||
@@ -49,6 +50,10 @@ class PreferencesController extends BaseController {
|
||||
|
||||
final _manageAccountDashBoardController = Get.find<ManageAccountDashBoardController>();
|
||||
|
||||
bool get isAIScribeAvailable {
|
||||
return _manageAccountDashBoardController.isAICapabilitySupported;
|
||||
}
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
@@ -150,6 +155,9 @@ class PreferencesController extends BaseController {
|
||||
case PreferencesOptionType.spamReport:
|
||||
config = SpamReportConfig(isEnabled: !isEnabled);
|
||||
break;
|
||||
case PreferencesOptionType.aiScribe:
|
||||
config = AIScribeConfig(isEnabled: !isEnabled);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -72,7 +72,12 @@ class PreferencesView extends GetWidget<PreferencesController> with AppLoaderMix
|
||||
if (localSettingOption.configs.isNotEmpty)
|
||||
...PreferencesOptionType.values.where(
|
||||
(optionType) => optionType.isLocal,
|
||||
),
|
||||
).where((optionType) {
|
||||
if (optionType == PreferencesOptionType.aiScribe) {
|
||||
return controller.isAIScribeAvailable;
|
||||
}
|
||||
return true;
|
||||
}),
|
||||
];
|
||||
|
||||
return Expanded(
|
||||
|
||||
Reference in New Issue
Block a user