fromMap static method

GrovsError? fromMap(
  1. Map map
)

Returns null when the native error code is unsupported.

Implementation

static GrovsError? fromMap(Map<dynamic, dynamic> map) {
  final code = GrovsErrorCode.fromNativeName(map['code'] as String?);
  if (code == null) return null;
  return GrovsError(code: code, message: map['message'] as String? ?? '');
}