diameter/lib/models/meal_category.dart

23 lines
561 B
Dart

import 'package:diameter/main.dart';
import 'package:objectbox/objectbox.dart';
@Entity(uid: 3158200688796904913)
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);
}