TF-524 Drop down list recent search

This commit is contained in:
dab246
2022-05-23 20:23:39 +07:00
committed by Dat H. Pham
parent 51cc3bd979
commit 561ea8d1ad
13 changed files with 133 additions and 8 deletions
@@ -0,0 +1,22 @@
import 'dart:core';
import 'package:core/core.dart';
import 'package:dartz/dartz.dart';
import 'package:tmail_ui_user/features/mailbox_dashboard/domain/repository/search_repository.dart';
import 'package:tmail_ui_user/features/mailbox_dashboard/domain/state/get_all_recent_search_latest_state.dart';
class GetAllRecentSearchLatestInteractor {
final SearchRepository searchRepository;
GetAllRecentSearchLatestInteractor(this.searchRepository);
Future<Either<Failure, Success>> execute({int? limit, String? pattern}) async {
try {
final listRecent = await searchRepository.getAllRecentSearchLatest(limit: limit, pattern: pattern);
log('GetAllRecentSearchLatestInteractor::execute(): listRecent: ${listRecent.length}');
return Right(GetAllRecentSearchLatestSuccess(listRecent));
} catch (exception) {
return Left(GetAllRecentSearchLatestFailure(exception));
}
}
}