Browse Source

修复home页AI女友跳转

weicu
lxm 2 years ago
parent
commit
ad37abee5a
  1. 2
      lib/modules/home/bindings/home_binding.dart
  2. 6
      lib/modules/home/controllers/home_controller.dart

2
lib/modules/home/bindings/home_binding.dart

@ -1,3 +1,4 @@
import 'package:deep_voice/modules/explore/controllers/explore_controller.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import '../controllers/home_controller.dart'; import '../controllers/home_controller.dart';
@ -5,5 +6,6 @@ class HomeBinding extends Bindings {
@override @override
void dependencies() { void dependencies() {
Get.lazyPut<HomeController>(() => HomeController()); Get.lazyPut<HomeController>(() => HomeController());
Get.lazyPut<ExploreController>(()=>ExploreController());// 注册ExploreController
} }
} }

6
lib/modules/home/controllers/home_controller.dart

@ -6,6 +6,7 @@ import 'package:flutter_blue_plus/flutter_blue_plus.dart' hide BluetoothDevice;
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../../data/services/voice_interaction_service.dart'; import '../../../data/services/voice_interaction_service.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import '../../explore/controllers/explore_controller.dart';
// 连接状态枚举 // 连接状态枚举
enum ConnectionStatus { enum ConnectionStatus {
@ -17,6 +18,7 @@ enum ConnectionStatus {
class HomeController extends GetxController { class HomeController extends GetxController {
static HomeController get to => Get.find(); static HomeController get to => Get.find();
final ExploreController exploreController = Get.find<ExploreController>();
// 经典蓝牙服务 // 经典蓝牙服务
late classic.ClassicBluetoothService _bluetoothService; late classic.ClassicBluetoothService _bluetoothService;
@ -186,13 +188,13 @@ class HomeController extends GetxController {
// 打开AI伴侣功能 // 打开AI伴侣功能
void openAIGirlfriend() { void openAIGirlfriend() {
Get.toNamed(Routes.chat); exploreController.onAIFeatureTap(2);//进入AI女友页面
} }
// 展示AI功能 // 展示AI功能
void exploreAIFeatures() { void exploreAIFeatures() {
// 简单实现,直接跳转到AI聊天页面 // 简单实现,直接跳转到AI聊天页面
openAIGirlfriend(); Get.toNamed(Routes.chat);
} }
// 获取连接状态对应的颜色 // 获取连接状态对应的颜色

Loading…
Cancel
Save