first commit
This commit is contained in:
21
lib/Screens/Income/Providers/all_income_provider.dart
Normal file
21
lib/Screens/Income/Providers/all_income_provider.dart
Normal file
@@ -0,0 +1,21 @@
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
import '../../../Provider/transactions_provider.dart';
|
||||
import '../Model/income_modle.dart';
|
||||
import '../Repo/income_repo.dart';
|
||||
|
||||
final incomeRepoProvider = Provider<IncomeRepo>(
|
||||
(ref) => IncomeRepo(),
|
||||
);
|
||||
|
||||
final filteredIncomeProvider = FutureProvider.family.autoDispose<List<Income>, FilterModel>(
|
||||
(ref, filter) {
|
||||
final repo = ref.read(incomeRepoProvider);
|
||||
|
||||
return repo.fetchAllIncome(
|
||||
type: filter.duration,
|
||||
fromDate: filter.fromDate,
|
||||
toDate: filter.toDate,
|
||||
);
|
||||
},
|
||||
);
|
||||
Reference in New Issue
Block a user