RemoteCommand.fromMap constructor
- 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,
);
}