You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
2.0 KiB
55 lines
2.0 KiB
import 'package:get/get.dart';
|
|
import 'dart:io';
|
|
import '../../data/services/speech_factory.dart';
|
|
import '../../data/services/chat_history_service.dart';
|
|
import '../../data/services/volcano_translation_service.dart';
|
|
import '../../data/services/voice_interaction_service.dart';
|
|
import '../../data/services/language_manager.dart';
|
|
import '../../data/services/volcano_ai_service.dart';
|
|
import '../../data/services/classic_bluetooth_service.dart';
|
|
import '../../data/services/bluetooth_media_button_service.dart';
|
|
import '../../core/utils/logger.dart';
|
|
import '../../data/services/voice_interaction_impl/ios_voice_interaction_service.dart';
|
|
import '../../data/services/voice_interaction_impl/android_voice_interaction_service.dart';
|
|
|
|
|
|
/// 初始绑定,用于管理全局依赖
|
|
class InitialBinding extends Bindings {
|
|
@override
|
|
void dependencies() {
|
|
Logger.warning('InitialBinding dependencies');
|
|
|
|
// 语言管理器(需要最先初始化)
|
|
Get.put<LanguageManager>(LanguageManager(), permanent: true);
|
|
|
|
//初始化语音工厂
|
|
Get.put<SpeechFactory>(SpeechFactory(), permanent: true);
|
|
Get.find<SpeechFactory>().initialize(initialType: SpeechServiceType.azure);
|
|
|
|
// 历史记录服务
|
|
Get.lazyPut<ChatHistoryService>(() => ChatHistoryService(), fenix: true);
|
|
|
|
// 火山翻译服务
|
|
Get.lazyPut<VolcanoTranslationService>(() => VolcanoTranslationService(), fenix: true);
|
|
|
|
// 火山AI服务
|
|
Get.lazyPut<VolcanoAIService>(() => VolcanoAIService(), fenix: true);
|
|
|
|
|
|
// 经典蓝牙服务
|
|
Get.lazyPut<ClassicBluetoothService>(() => ClassicBluetoothService(), fenix: true);
|
|
|
|
// 蓝牙媒体按钮服务
|
|
Get.lazyPut<BluetoothMediaButtonService>(() => BluetoothMediaButtonService(), fenix: true);
|
|
|
|
|
|
|
|
// 根据平台注册对应的VoiceInteractionService实现
|
|
if (Platform.isIOS) {
|
|
Get.lazyPut<VoiceInteractionService>(() => IosVoiceInteractionService(), fenix: true);
|
|
|
|
} else {
|
|
Get.lazyPut<VoiceInteractionService>(() => AndroidVoiceInteractionService(), fenix: true);
|
|
}
|
|
}
|
|
}
|