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
3
import
'../../../../core/common/models/collection_model.dart';
4
import
'../../../../core/isar/isar_local_database.dart';
5
import
'../../../../core/isar/models/history/pending_collection_isar_model.dart';
6
import
'../../../../core/isar/models/history/this_month_collection_isar_model.dart';
7
import
'../../../../core/isar/models/history/this_week_collection_isar_model.dart';
8
9
class
HistoryLocalDatasource
{
10
final
localDatabase
=
IsarLocalDatabase
.
instance
;
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
}
HistoryLocalDatasource
Definition
history_local_datasource.dart:9
HistoryLocalDatasource::getPendingCollections
Future< List< CollectionModel > > getPendingCollections() async
Definition
history_local_datasource.dart:12
HistoryLocalDatasource::localDatabase
final localDatabase
Definition
history_local_datasource.dart:10
HistoryLocalDatasource::getThisMonthHistoryCollections
Future< List< CollectionModel > > getThisMonthHistoryCollections() async
Definition
history_local_datasource.dart:18
HistoryLocalDatasource::getThisWeekHistoryCollections
Future< List< CollectionModel > > getThisWeekHistoryCollections() async
Definition
history_local_datasource.dart:26
IsarLocalDatabase
Definition
isar_local_database.dart:4
IsarLocalDatabase::instance
static IsarLocalDatabase get instance
Definition
isar_local_database.dart:10
PendingCollectionIsarModel
Definition
pending_collection_isar_model.dart:9
ThisMonthCollectionIsarModel
Definition
this_month_collection_isar_model.dart:9
ThisWeekCollectionIsarModel
Definition
this_week_collection_isar_model.dart:9
lib
features
history
data
datasources
history_local_datasource.dart
Generated by
1.16.1