27 lines
539 B
Dart
27 lines
539 B
Dart
import 'package:manager_app/Models/menuSection.dart';
|
|
|
|
class Menu {
|
|
String title;
|
|
List<MenuSection>? sections;
|
|
|
|
Menu({required this.title, this.sections});
|
|
|
|
factory Menu.fromJson(Map<String, dynamic> json) {
|
|
return new Menu(
|
|
title: json['title'] as String,
|
|
sections: json['sections'] as List<MenuSection>,
|
|
);
|
|
}
|
|
|
|
Map<String, dynamic> toMap() {
|
|
return {
|
|
'title': title,
|
|
'sections': sections
|
|
};
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return '{title: $title, sections: $sections}';
|
|
}
|
|
} |