MBImage constructor

MBImage({
  1. required Map<String, dynamic> dictionary,
})

Initializes an image with the dictionary returned by the MBurger APIs.

  • Parameters:
    • dictionary: The dictionary returned by the APIs.

Implementation

MBImage({required Map<String, dynamic> dictionary})
    : id = dictionary['id'] is int ? dictionary['id'] as int : 0,
      uuid = dictionary['uuid'] is String ? dictionary['uuid'] as String : '',
      url = dictionary['url'] is String ? dictionary['url'] as String : '',
      size = dictionary['size'] is int ? dictionary['size'] as int : 0,
      mimeType = dictionary['mime_type'] is String
          ? dictionary['mime_type'] as String
          : '';