createNotificationFromModel static method

Future<bool> createNotificationFromModel(
  1. Map<String, dynamic> model
)

Creates a notification from a whole model map, as a push decorator does on the native platforms: the fields the app can't set (the created source and date) are kept.

Implementation

static Future<bool> createNotificationFromModel(
    Map<String, dynamic> model) async {
  final content = model[NOTIFICATION_CONTENT];
  final id = content is Map ? content[NOTIFICATION_ID] : null;
  if (id is int) _validateId(id);
  return _create(model);
}