28 lines
618 B
Dart
28 lines
618 B
Dart
class MenuSection {
|
|
String type;
|
|
int menuId;
|
|
List<MenuSection> subMenu;
|
|
|
|
MenuSection({required this.type, required this.menuId, required this.subMenu});
|
|
|
|
factory MenuSection.fromJson(Map<String, dynamic> json) {
|
|
return new MenuSection(
|
|
type: json['type'] as String,
|
|
menuId: json['menuId'] as int,
|
|
subMenu: json['subMenu'] as List<MenuSection>,
|
|
);
|
|
}
|
|
|
|
Map<String, dynamic> toMap() {
|
|
return {
|
|
'type': type,
|
|
'menuId': menuId,
|
|
'subMenu': subMenu
|
|
};
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return '{type: $type, menuId: $menuId, subMenu: $subMenu}';
|
|
}
|
|
} |