Api.load constructor

Api.load()

The library is loaded based on platform conventions.

Implementation

factory Api.load() {
  String? name;
  if (Platform.isLinux) name = "libacter.so";
  if (Platform.isAndroid) name = "libacter.so";
  if (Platform.isMacOS) name = "libacter.dylib";
  if (Platform.isIOS) name = "";
  if (Platform.isWindows) name = "acter.dll";
  if (name == null) {
    throw UnsupportedError("This platform is not supported.");
  }
  if (name == "") {
    return Api.loadStatic();
  } else {
    return Api.loadDynamic(name);
  }
}