decodeError method

Map<String, dynamic> decodeError(
  1. PlatformException error
)

Mapping communication error structure.

Implementation

Map<String, dynamic> decodeError(PlatformException error) {
  if (error.details != null && error.details is Map<dynamic, dynamic>) {
    final mapped = error.details.cast<String, dynamic>();
    return mapped;
  }
  return {};
}