Mercury constructor
Mercury({
- Key? key,
- MercuryBundle? bundle,
- OnControllerCreated? onControllerCreated,
- LoadHandler? onLoad,
- MercuryMethodChannel? javaScriptChannel,
- DevToolsService? devToolsService,
- HttpClientInterceptor? httpClientInterceptor,
- UriParser? uriParser,
- LoadErrorHandler? onLoadError,
- JSErrorHandler? onJSError,
Implementation
Mercury({
Key? key,
this.bundle,
this.onControllerCreated,
this.onLoad,
this.javaScriptChannel,
this.devToolsService,
// mercury's http client interceptor.
this.httpClientInterceptor,
this.uriParser,
// Callback functions when loading Javascript scripts failed.
this.onLoadError,
this.onJSError
}) {
controller = MercuryController(shortHash(this),
entrypoint: bundle,
onLoad: onLoad,
onLoadError: onLoadError,
onJSError: onJSError,
methodChannel: javaScriptChannel,
devToolsService: devToolsService,
httpClientInterceptor: httpClientInterceptor,
uriParser: uriParser);
if (onControllerCreated != null) {
onControllerCreated!(controller!);
}
}