diameter/lib/models/meal_category.dart

23 lines
537 B
Dart
Raw Normal View History

import 'package:diameter/main.dart';
import 'package:objectbox/objectbox.dart';
2021-10-22 23:08:09 +00:00
@Entity()
2021-10-22 23:08:09 +00:00
class MealCategory {
static final Box<MealCategory> box = objectBox.store.box<MealCategory>();
int id;
String value;
String? notes;
MealCategory({
this.id = 0,
this.value = '',
this.notes,
});
static MealCategory? get(int id) => box.get(id);
static List<MealCategory> getAll() => box.getAll();
static void put(MealCategory mealCategory) => box.put(mealCategory);
static void remove(int id) => box.remove(id);
2021-10-22 23:08:09 +00:00
}