MirrorDispatcher class
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.
Constructors
- MirrorDispatcher(dynamic instance)
- constructor
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- instance ↔ dynamic
-
the initialized class instance we will be performing methods on.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
dispatch(
String methodName, [dynamic positionalParams, Map< String, dynamic> ? namedParams]) → Future - Invoke named method with parameters on an instance.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited