PHAlbum.fromCodecMessage constructor

PHAlbum.fromCodecMessage(
  1. Map<String, dynamic> message
)

Factory constructor from platform codec message

Implementation

factory PHAlbum.fromCodecMessage(Map<String, dynamic> message) {
  final id = message[Keys.id] as String;
  final title = message[Keys.title] as String;
  final items = message[Keys.items];
  final photos =
      List<String>.unmodifiable(items).map((e) => PHItem.fromId(e)).toList();

  return PHAlbum(id: id, title: title, items: photos);
}