import 'package:hive_flutter/hive_flutter.dart'; import 'package:smooth_app/database/abstract_dao.dart'; /// Where we store ints. class DaoInt extends AbstractDao { DaoInt(super.localDatabase); static const String _hiveBoxName = 'int'; @override Future init() async => Hive.openBox(_hiveBoxName); @override void registerAdapter() {} Box _getBox() => Hive.box(_hiveBoxName); int? get(final String key) => _getBox().get(key); Future put(final String key, final int? value) async => value == null ? _getBox().delete(key) : _getBox().put(key, value); }