Created
July 1, 2020 19:54
-
-
Save ialameh/22416da794c7d8c61fbca2c4c8b14837 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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