PlatformException constructor Null safety

PlatformException(
  1. {required String code,
  2. String? message,
  3. dynamic details,
  4. String? stacktrace}
)

Creates a PlatformException with the specified error code and optional message, and with the optional error details which must be a valid value for the MethodCodec involved in the interaction.

Implementation

PlatformException({
  required this.code,
  this.message,
  this.details,
  this.stacktrace,
}) : assert(code != null);