fromMap method
Parses the input mapData
into a new NotificationLocalization instance.
The mapData
parameter is a Map that represents the data to be parsed.
This method returns a NotificationLocalization instance that contains
the parsed data. If the mapData
parameter is null, empty or invalid,
this method will return null
.
Implementation
@override
NotificationLocalization? fromMap(Map<String, dynamic> mapData) {
if (mapData.isEmpty) return null;
title =
AwesomeAssertUtils.extractValue<String>(NOTIFICATION_TITLE, mapData);
body = AwesomeAssertUtils.extractValue<String>(NOTIFICATION_BODY, mapData);
summary =
AwesomeAssertUtils.extractValue<String>(NOTIFICATION_SUMMARY, mapData);
largeIcon = AwesomeAssertUtils.extractValue<String>(
NOTIFICATION_LARGE_ICON, mapData);
bigPicture = AwesomeAssertUtils.extractValue<String>(
NOTIFICATION_BIG_PICTURE, mapData);
buttonLabels = mapData[NOTIFICATION_BUTTON_LABELS] is Map
? {
for (MapEntry entry
in (mapData[NOTIFICATION_BUTTON_LABELS] as Map).entries)
entry.key.toString(): entry.value.toString()
}
: null;
return this;
}