MirrorDispatcher class Null safety

MirrorDispatcher implements Dispatcher by introspecting a class instance using dart:mirrors. dart:mirrors allows you to invoke an instance's methods by their string names.

Construct a MirrorDispatcher with a class instance. MirrorDispatcher.dispatch("someMethod") will return a Future of whatever value it returns. It's mainly a wrapper around reflect. For any method dispatched, Dispatcher returns either the return value of the method or instances of one of three "Exception" classes. Most errors will be corralled into these objects, so that runtime exceptions don't get thrown, instead are returned in an orderly manner.

Implemented types

Constructors

MirrorDispatcher(dynamic instance)
constructor

Properties

hashCode int
The hash code for this object.
read-onlyinherited
instance ↔ dynamic
the initialized class instance we will be performing methods on.
read / write
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited

Methods

dispatch(String methodName, [dynamic positionalParams, Map<String, dynamic>? namedParams]) Future
Invoke named method with parameters on an instance.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited