Skip to content

Instantly share code, notes, and snippets.

@ialameh
Created July 1, 2020 19:54
Show Gist options
  • Save ialameh/22416da794c7d8c61fbca2c4c8b14837 to your computer and use it in GitHub Desktop.
Save ialameh/22416da794c7d8c61fbca2c4c8b14837 to your computer and use it in GitHub Desktop.
void main() {
Map<Calc, List<Calc>> map = {};
}
class SelectionItem {
SelectionItem(
{@required this.name, @required this.max, @required this.description});
final String name;
final int max;
final String description;
factory SelectionItem.fromMap(Map<String, dynamic> data) {
if (data == null) {
return null;
}
final String name = data['name'];
final int max = data['max'];
final String description = data['description'];
return SelectionItem(name: name, max: max, description: description);
}
Map<String, dynamic> toMap() {
return {
'name': name,
'max': max,
'description': description,
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment