ponshu-room-lite/lib/models/menu_settings.dart

70 lines
1.5 KiB
Dart
Raw Normal View History

import 'package:hive/hive.dart';
part 'menu_settings.g.dart';
@HiveType(typeId: 3)
class MenuSettings extends HiveObject {
@HiveField(0)
String title;
@HiveField(1)
bool includePhoto;
@HiveField(2)
bool includePoem;
@HiveField(3)
bool includeChart;
@HiveField(4)
bool includePrice;
@HiveField(5)
bool includeDate;
@HiveField(8)
bool? includeQr; // Nullable for compatibility
@HiveField(6)
String pdfSize; // 'a4', 'a5', 'b5'
@HiveField(7)
bool isMonochrome;
MenuSettings({
this.title = '',
this.includePhoto = true,
this.includePoem = true,
this.includeChart = true,
this.includePrice = true,
this.includeDate = true,
this.includeQr = false,
this.pdfSize = 'a4',
this.isMonochrome = false,
});
MenuSettings copyWith({
String? title,
bool? includePhoto,
bool? includePoem,
bool? includeChart,
bool? includePrice,
bool? includeDate,
bool? includeQr,
String? pdfSize,
bool? isMonochrome,
}) {
return MenuSettings(
title: title ?? this.title,
includePhoto: includePhoto ?? this.includePhoto,
includePoem: includePoem ?? this.includePoem,
includeChart: includeChart ?? this.includeChart,
includePrice: includePrice ?? this.includePrice,
includeDate: includeDate ?? this.includeDate,
includeQr: includeQr ?? this.includeQr,
pdfSize: pdfSize ?? this.pdfSize,
isMonochrome: isMonochrome ?? this.isMonochrome,
);
}
}