import 'package:demo_hive/domain/entity/reminder.dart'; import 'package:flutter/cupertino.dart'; import 'local_init.dart'; class LocalDatabaseSetUp{ LocalDBInit init; LocalDatabaseSetUp({@required this.init}); Future> getList() async { List reminders = []; if(init.unitBox.length != null) { reminders.addAll(init.unitBox.values.toList()); } return reminders; } FuturedeleteFromBox(int index) async{ await init.unitBox.deleteAt(index); } Future addNoteBox(ReminderEntity reminderEntity)async{ await init.unitBox.add(reminderEntity); } Future removeAll()async{ await init.unitBox.clear(); } }