Future<Box<T>> getBox<T>(String name) async { if (Hive.isBoxOpen(name)) { return Hive.box<T>(name); } else { return Hive.openBox<T>(name); } }