28 lines
881 B
Dart
28 lines
881 B
Dart
|
import 'package:demo_hive/data/data_source/local/local_database-set_up.dart';
|
||
|
import 'package:demo_hive/domain/entity/reminder.dart';
|
||
|
import 'package:demo_hive/domain/repositories/reminder_repository.dart';
|
||
|
import 'package:flutter/cupertino.dart';
|
||
|
|
||
|
class ReminderRepoImpl implements ReminderRepository{
|
||
|
final LocalDatabaseSetUp localDatabaseSetUp;
|
||
|
ReminderRepoImpl({@required this.localDatabaseSetUp});
|
||
|
@override
|
||
|
Future<void> removeAll() async{
|
||
|
await localDatabaseSetUp.removeAll();
|
||
|
}
|
||
|
|
||
|
@override
|
||
|
Future<List<ReminderEntity>> getList() async {
|
||
|
// TODO: implement getLocalList
|
||
|
return localDatabaseSetUp.getList();
|
||
|
}
|
||
|
@override
|
||
|
Future<void> addReminder(ReminderEntity reminder) async{
|
||
|
return localDatabaseSetUp.addNoteBox(reminder);
|
||
|
}
|
||
|
|
||
|
@override
|
||
|
Future<void> removeAt(int index) async {
|
||
|
await localDatabaseSetUp.deleteFromBox(index);
|
||
|
}
|
||
|
}
|