23 lines
537 B
Dart
23 lines
537 B
Dart
import 'package:diameter/main.dart';
|
|
import 'package:objectbox/objectbox.dart';
|
|
|
|
@Entity()
|
|
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);
|
|
}
|