feat: Implement client hubs management feature, including CRUD operations and NFC tag assignment.
This commit is contained in:
49
apps/packages/features/client/hubs/lib/client_hubs.dart
Normal file
49
apps/packages/features/client/hubs/lib/client_hubs.dart
Normal file
@@ -0,0 +1,49 @@
|
||||
library client_hubs;
|
||||
|
||||
import 'package:flutter_modular/flutter_modular.dart';
|
||||
import 'package:krow_data_connect/krow_data_connect.dart';
|
||||
import 'src/data/repositories_impl/hub_repository_impl.dart';
|
||||
import 'src/domain/repositories/hub_repository_interface.dart';
|
||||
import 'src/domain/usecases/assign_nfc_tag_usecase.dart';
|
||||
import 'src/domain/usecases/create_hub_usecase.dart';
|
||||
import 'src/domain/usecases/delete_hub_usecase.dart';
|
||||
import 'src/domain/usecases/get_hubs_usecase.dart';
|
||||
import 'src/presentation/blocs/client_hubs_bloc.dart';
|
||||
import 'src/presentation/pages/client_hubs_page.dart';
|
||||
|
||||
export 'src/presentation/pages/client_hubs_page.dart';
|
||||
|
||||
/// A [Module] for the client hubs feature.
|
||||
class ClientHubsModule extends Module {
|
||||
@override
|
||||
List<Module> get imports => [DataConnectModule()];
|
||||
|
||||
@override
|
||||
void binds(Injector i) {
|
||||
// Repositories
|
||||
i.addLazySingleton<HubRepositoryInterface>(
|
||||
() => HubRepositoryImpl(mock: i.get<BusinessRepositoryMock>()),
|
||||
);
|
||||
|
||||
// UseCases
|
||||
i.addLazySingleton(GetHubsUseCase.new);
|
||||
i.addLazySingleton(CreateHubUseCase.new);
|
||||
i.addLazySingleton(DeleteHubUseCase.new);
|
||||
i.addLazySingleton(AssignNfcTagUseCase.new);
|
||||
|
||||
// BLoCs
|
||||
i.add<ClientHubsBloc>(
|
||||
() => ClientHubsBloc(
|
||||
getHubsUseCase: i.get<GetHubsUseCase>(),
|
||||
createHubUseCase: i.get<CreateHubUseCase>(),
|
||||
deleteHubUseCase: i.get<DeleteHubUseCase>(),
|
||||
assignNfcTagUseCase: i.get<AssignNfcTagUseCase>(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void routes(RouteManager r) {
|
||||
r.child('/', child: (_) => const ClientHubsPage());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user