GalException.fromCode constructor

GalException.fromCode({
  1. required String code,
  2. required PlatformException platformException,
  3. required StackTrace stackTrace,
})

Implementation

factory GalException.fromCode({
  required String code,
  required PlatformException platformException,
  required StackTrace stackTrace,
}) {
  final type = GalExceptionType.values.firstWhere(
    (type) => type.code == code,
    orElse: () => GalExceptionType.unexpected,
  );
  return GalException(
    type: type,
    platformException: platformException,
    stackTrace: stackTrace,
  );
}