路径规划作业列表 其余界面优化

This commit is contained in:
mmc
2026-02-27 13:17:09 +08:00
parent e690ec7993
commit 6e6986a49a
14 changed files with 625 additions and 360 deletions

View File

@@ -6,6 +6,7 @@ import 'package:maibu_satabot_v2/core/logging/i_logger_service.dart';
import 'package:maibu_satabot_v2/features/devices/data/datasources/impl/device_http_datasource_impl.dart';
import 'package:maibu_satabot_v2/features/devices/domain/repositories/device_repository.dart';
import 'package:maibu_satabot_v2/features/devices/domain/usecases/get_user_device_usecase.dart';
import 'package:maibu_satabot_v2/features/devices/domain/usecases/unbind_device_usecase.dart';
import 'package:maibu_satabot_v2/features/devices/presentation/bloc/devices_cubit.dart';
import 'package:maibu_satabot_v2/features/remote_control/data/repositories/remote_control_repository_impl.dart';
import 'package:maibu_satabot_v2/features/remote_control/domain/repositories/remote_control_repository.dart';
@@ -83,16 +84,14 @@ Future<void> init() async {
localTokenStorage: sl(), // 自动寻找已注册的 TokenStorage
),
);
//工作历史
//工作历史
sl.registerLazySingleton<DeviceHostrityWorkRepositoryRepository>(
() => DeviceHostrityWorkRepositoryImpl(
() => DeviceHostrityWorkRepositoryImpl(
client: sl<Dio>(), // 使用 Dio 实例
userStorage: sl<UserStorage>(),
),
);
sl.registerLazySingleton<DeviceRepository>(() => DeviceRepositoryImpl(sl()));
sl.registerLazySingleton<RemoteControlRepository>(
() => RemoteControlRepositoryImpl(sl(), sl()),
@@ -103,27 +102,26 @@ Future<void> init() async {
sl.registerLazySingleton(() => GetUserDeviceUseCase(sl()));
sl.registerLazySingleton(() => DiffSteerUseCase());
sl.registerLazySingleton(() => DeviceWorkHostrirty(sl()));
sl.registerLazySingleton(() => UnbindDeviceUseCase(sl()));
/// 5. 状态管理 (Cubit/Bloc)
sl.registerLazySingleton(() => AppUserCubit()); // AuthCubit 依赖它,必须先注册
sl.registerLazySingleton(() => GetDeviceLocationUseCase(sl()));
sl.registerLazySingleton(() => DevicesCubit( sl(), sl(), sl(), sl(), sl()));
sl.registerLazySingleton(
() => DevicesCubit(sl(), sl(), sl(), sl(), sl(), sl()),
);
sl.registerFactory(() => RemoteControlCubit(sl()));
/// . 路径生成
/// . 路径生成
sl.registerLazySingleton<PathRepository>(() => PathRepositoryImpl());
sl.registerLazySingleton<GeneratePathUseCase>(
() => GeneratePathUseCaseImpl(sl<PathRepository>()),
() => GeneratePathUseCaseImpl(sl<PathRepository>()),
);
///.路径获取和删除
///.路径获取和删除
sl.registerLazySingleton(() => GetWorkRecordUseCase(sl<PathRepository>()));
sl.registerLazySingleton(() => DeleteWorkRecordUseCase(sl<PathRepository>()));
/// 6. 认证 (Auth)
// --- 关键修改点 1: AuthCubit 必须在 GoRouter 之前注册,并传入参数 ---
sl.registerLazySingleton(
@@ -141,14 +139,4 @@ Future<void> init() async {
/// 8. 页面级 Bloc/Cubit (Factory)
sl.registerFactory(() => LoginBloc(sl()));
sl.registerFactory(() => LoginCubit(sl(), sl()));
}