Aidra Driver 1.3.5+68
Aidra Driver - Your path to green energy
Loading...
Searching...
No Matches
get_collections_usecase.dart
Go to the documentation of this file.
1import 'package:dartz/dartz.dart';
2import 'package:equatable/equatable.dart';
3
4import '../../../../core/common/use_case/use_case.dart';
5import '../../../../core/error/failures.dart';
6import '../../../../core/common/entities/collection_entity.dart';
7import '../repositories/collection_repository.dart';
8
9class GetCollectionsParams extends Equatable {
10 final int userId;
11 final bool notForToday;
12 final String? type;
13
15 required this.userId,
16 required this.notForToday,
17 required this.type,
18 });
19
20 @override
21 List<Object?> get props => [userId, notForToday, type];
22}
23
24class GetCollectionsUseCase implements UseCase<List<CollectionEntity>, GetCollectionsParams> {
26
27 GetCollectionsUseCase({required this.repository});
28
29 @override
30 Future<Either<Failure, List<CollectionEntity>>> call(GetCollectionsParams params) async {
31 return await repository.getCollections(
32 userId: params.userId,
33 notForToday: params.notForToday,
34 type: params.type,
35 );
36 }
37}
sealed class CheckInOutEvent extends Equatable userId
override List< Object?> get props
const GetCollectionsParams({ required this.userId, required this.notForToday, required this.type, })
final String type
final bool notForToday
class Partner String
String get(String locale)
override Future< Either< Failure, List< VehicleEntity > > > call(GetAvailableVehiclesParams params) async
class GetCollectionContactListParams repository
GetCollectionsUseCase({required this.repository})