MBContract.fromDictionary constructor
Initializes a contract with the dictionary returned by the MBurger APIs.
- Parameters:
dictionary
: Thedictionary
returned by the APIs.
Implementation
MBContract.fromDictionary(Map<String, dynamic> dictionary)
: id = dictionary['id'] is int ? dictionary['id'] as int : 0,
name = dictionary['name'] is String ? dictionary['name'] as String : '',
link =
dictionary['link'] is String ? dictionary['link'] as String : null,
text =
dictionary['text'] is String ? dictionary['text'] as String : null,
active =
dictionary['active'] is bool ? dictionary['active'] as bool : false;