SealdSsksPasswordPlugin constructor
Initialize an instance of Seald SSKS Password plugin.
ssksURL
- The URL of the SSKS Identity Key Storage to which it should connect.
appId
- The ID given by the Seald server to your app. This value is given on your Seald dashboard.
logLevel
- The minimum level of logs you want. All logs of this level or above will be displayed. -1
: Trace; 0
: Debug; 1
: Info; 2
: Warn; 3
: Error; 4
: Fatal; 5
: Panic; 6
: NoLevel; 7
: Disabled. Defaults to 0.
logNoColor
- Whether to disable colors in the log output. true
to disable colors, false
to enable colors. Defaults to false.
instanceName
- An arbitrary name to give to this Seald instance. Can be useful for debugging when multiple instances are running in parallel, as it is added to logs. Defaults to an empty string.
Implementation
SealdSsksPasswordPlugin({
required String ssksURL,
required String appId,
int logLevel = 0,
bool logNoColor = false,
String instanceName = "",
}) {
final Pointer<NativeSealdSsksPasswordPluginInitializeOptions> initOpts =
calloc<NativeSealdSsksPasswordPluginInitializeOptions>();
final String platform = "c-flutter-${Platform.operatingSystem}";
initOpts.ref
..SsksURL = ssksURL.toNativeUtf8()
..AppId = appId.toNativeUtf8()
..LogLevel = logLevel
..LogNoColor = logNoColor ? 1 : 0
..InstanceName = instanceName.toNativeUtf8()
..Platform = platform.toNativeUtf8();
final Pointer<Pointer<NativeSealdSsksPasswordPlugin>> result =
calloc<Pointer<NativeSealdSsksPasswordPlugin>>();
final Pointer<Pointer<NativeSealdError>> err =
calloc<Pointer<NativeSealdError>>();
final int resultCode =
_bindings.SealdSsksPasswordPlugin_Initialize(initOpts, result, err);
calloc.free(initOpts.ref.SsksURL);
calloc.free(initOpts.ref.AppId);
calloc.free(initOpts.ref.InstanceName);
calloc.free(initOpts.ref.Platform);
calloc.free(initOpts);
if (resultCode != 0) {
calloc.free(result);
throw SealdException._fromCPtr(err);
} else {
_ptr = _TransferablePointer<NativeSealdSsksPasswordPlugin>(result.value);
_finalizer.attach(this, _ptr.pointer() as Pointer<Void>);
calloc.free(result);
calloc.free(err);
}
}