Aidra Driver 1.3.5+68
Aidra Driver - Your path to green energy
Loading...
Searching...
No Matches
history_local_datasource.dart
Go to the documentation of this file.
1
2
3import '../../../../core/common/models/collection_model.dart';
4import '../../../../core/isar/isar_local_database.dart';
5import '../../../../core/isar/models/history/pending_collection_isar_model.dart';
6import '../../../../core/isar/models/history/this_month_collection_isar_model.dart';
7import '../../../../core/isar/models/history/this_week_collection_isar_model.dart';
8
11
12 Future<List<CollectionModel>> getPendingCollections() async {
13 final result = await localDatabase.getAll<PendingCollectionIsarModel>();
14 final pendingCollections = result.map((e) => e.toModel()).toList();
15 return pendingCollections;
16 }
17
18 Future<List<CollectionModel>> getThisMonthHistoryCollections() async {
19 final result = await localDatabase.getAll<ThisMonthCollectionIsarModel>();
20 final thisMonthHistoryCollections = result.map(
21 (e) => e.toModel(),
22 ).toList();
23 return thisMonthHistoryCollections;
24 }
25
26 Future<List<CollectionModel>> getThisWeekHistoryCollections() async {
27 final result = await localDatabase.getAll<ThisWeekCollectionIsarModel>();
28 final thisWeekHistoryCollections = result.map(
29 (e) => e.toModel(),
30 ).toList();
31 return thisWeekHistoryCollections;
32 }
33
34}
Future< List< CollectionModel > > getPendingCollections() async
Future< List< CollectionModel > > getThisMonthHistoryCollections() async
Future< List< CollectionModel > > getThisWeekHistoryCollections() async
static IsarLocalDatabase get instance