class MenuSection { String name; String type; int menuId; List subMenu; MenuSection({required this.name, required this.type, required this.menuId, required this.subMenu}); factory MenuSection.fromJson(Map json) { return new MenuSection( name: json['name'] as String, type: json['type'] as String, menuId: json['menuId'] as int, subMenu: json['subMenu'] as List, ); } Map toMap() { return { 'name': name, 'type': type, 'menuId': menuId, 'subMenu': subMenu }; } @override String toString() { return '{name: $name, type: $type, menuId: $menuId, subMenu: $subMenu}'; } }