feat : new injection logic
test : some file :) chore : upgrade android gradle
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
import 'package:rasadyar_livestock/data/model/local/location/tmp_locations.dart';
|
||||
|
||||
class TmpLocalDataSource {
|
||||
Future<void> addLocations(List<TmpLocations> list) async {
|
||||
IsolatedBox<TmpLocations> box = await IsolatedHive.openBox<TmpLocations>('TmpBox');
|
||||
if (await box.isNotEmpty) {
|
||||
box.clear();
|
||||
}
|
||||
box.addAll(list);
|
||||
}
|
||||
|
||||
Future<List<TmpLocations>> getLocations() async {
|
||||
IsolatedBox<TmpLocations> box = await IsolatedHive.openBox<TmpLocations>('TmpBox');
|
||||
var res = await box.values;
|
||||
return res.toList();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user