import 'package:flisp_app/models/flisp.dart'; import 'package:hive_flutter/hive_flutter.dart'; class FlispService { static const String boxName = 'flisps'; Box get box => Hive.box(boxName); Future addFlisp(Flisp flisp) async { try { await box.add(flisp); return true; } catch (e) { return false; } } List getAllFlisps() { return box.values.toList(); } Future updateFlisp(Flisp flisp) async { try { await flisp.save(); return true; } catch (e) { return false; } } Future deleteFlisp(Flisp flisp) async { try { await flisp.delete(); return true; } catch (e) { return false; } } }