RemoteCommand.fromMap constructor

RemoteCommand.fromMap(
  1. JsonMap map
)

Implementation

factory RemoteCommand.fromMap(JsonMap map) {
  return RemoteCommand(
    id: map['id'] as String? ?? '',
    type: RemoteCommandType.values.firstWhere(
      (value) => value.name == map['type'],
      orElse: () => RemoteCommandType.syncQueue,
    ),
    payload: map['payload'] != null
        ? Map<String, dynamic>.from(map['payload'] as Map)
        : null,
  );
}