create static method

Future<BonesUIPlatform> create(
  1. BonesUICompiler bonesUICompiler, {
  2. bool showUI = false,
})

Instantiates a BonesUIPlatform.

Implementation

static Future<BonesUIPlatform> create(BonesUICompiler bonesUICompiler,
    {bool showUI = false}) async {
  final compileDirPath = bonesUICompiler.compileDir.path;

  if (compileDirPath.length < 5) {
    throw StateError("Invalid compile directory: $compileDirPath");
  }

  var browserPlatform = await BrowserPlatform.start(root: compileDirPath);
  return BonesUIPlatform(browserPlatform, bonesUICompiler, showUI: showUI);
}