PlatformException class
Thrown to indicate that a platform interaction failed in the platform plugin.
See also:
- MethodCodec, which throws a PlatformException, if a received result envelope represents an error.
- MethodChannel.invokeMethod, which completes the returned future with a PlatformException, if invoking the platform plugin method results in an error envelope.
- EventChannel.receiveBroadcastStream, which emits PlatformExceptions as error events, whenever an event received from the platform plugin is wrapped in an error envelope.
- Implemented types
Constructors
- PlatformException({@required String code, String message, dynamic details })
-
Creates a PlatformException with the specified error
code
and optionalmessage
, and with the optional errordetails
which must be a valid value for the MethodCodec involved in the interaction.
Properties
- code → String
-
An error code.
final
- details → dynamic
-
Error details, possibly null.
final
- message → String
-
A human-readable error message, possibly null.
final
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Methods
-
toString(
) → String -
Returns a string representation of this object.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
Operators
-
operator ==(
dynamic other) → bool -
The equality operator. [...]
inherited