fromPath static method

Future<WebFramework> fromPath(
  1. String configPath
)

Create WebFramework

configPath Path to *.json config

Implementation

static Future<WebFramework> fromPath(String configPath) async {
  DllHandler handler = await DllHandler.create();

  configPath = "${handler.assetsPath}/$configPath";

  Pointer<Pointer<Void>> exception = WebFrameworkException.createException();
  Pointer<Utf8> data = configPath.toNativeUtf8();
  CreateWebFrameworkFromPath function = handler.instance
      .lookupFunction<CreateWebFrameworkFromPath, CreateWebFrameworkFromPath>(
          "createWebFrameworkFromPath");

  Pointer<Void> implementation = function.call(data, exception);

  malloc.free(data);

  WebFrameworkException.checkException(exception, handler);

  return WebFramework._constructor(implementation, handler);
}