From 6b1e7f8398a684428b633810886692adba5b9fd6 Mon Sep 17 00:00:00 2001 From: Dillon Fagan Date: Thu, 19 Oct 2023 08:16:13 -0400 Subject: [PATCH] Select the loan with same ID and thing ID --- lib/src/features/loans/providers/loan_details_provider.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/src/features/loans/providers/loan_details_provider.dart b/lib/src/features/loans/providers/loan_details_provider.dart index 97c6dd8..e9d3fad 100644 --- a/lib/src/features/loans/providers/loan_details_provider.dart +++ b/lib/src/features/loans/providers/loan_details_provider.dart @@ -12,5 +12,6 @@ final loanDetailsProvider = Provider>((ref) async { } final loans = await ref.watch(loansRepositoryProvider); - return loans.firstWhereOrNull((loan) => loan.id == selectedLoan.id); + return loans.firstWhereOrNull((loan) => + loan.id == selectedLoan.id && loan.thing.id == selectedLoan.thing.id); });