ConversionException constructor

ConversionException({
  1. required Object? error,
  2. required Map<String, dynamic> context,
  3. StackTrace? stackTrace,
})

Creates a conversion exception with the originating error and diagnostic context.

The context map is defensively copied and made unmodifiable. If stackTrace is not provided, the current stack trace is captured.

Implementation

ConversionException({
  required this.error,
  required Map<String, dynamic> context,
  StackTrace? stackTrace,
}) : context = Map.unmodifiable(context),
     stackTrace = stackTrace ?? StackTrace.current;