36 lines
820 B
Dart
36 lines
820 B
Dart
class PresetCommand {
|
|
const PresetCommand({
|
|
required this.id,
|
|
required this.label,
|
|
required this.commandText,
|
|
});
|
|
|
|
final String id;
|
|
final String label;
|
|
final String commandText;
|
|
|
|
PresetCommand copyWith({String? id, String? label, String? commandText}) {
|
|
return PresetCommand(
|
|
id: id ?? this.id,
|
|
label: label ?? this.label,
|
|
commandText: commandText ?? this.commandText,
|
|
);
|
|
}
|
|
|
|
factory PresetCommand.fromJson(Map<String, dynamic> json) {
|
|
return PresetCommand(
|
|
id: json['id']?.toString() ?? '',
|
|
label: json['label']?.toString() ?? '',
|
|
commandText: json['commandText']?.toString() ?? '',
|
|
);
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
return <String, dynamic>{
|
|
'id': id,
|
|
'label': label,
|
|
'commandText': commandText,
|
|
};
|
|
}
|
|
}
|