MBContract.fromDictionary constructor

MBContract.fromDictionary(
  1. Map<String, dynamic> dictionary
)

Initializes a contract with the dictionary returned by the MBurger APIs.

  • Parameters:
    • dictionary: The dictionary 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;