setGlobalOption<T> function
Global options: https://github.com/wang-bin/mdk-sdk/wiki/Global-Options
Implementation
void setGlobalOption<T>(String name, T value) {
final k = name.toNativeUtf8();
if (value is String) {
// T == String
final v = value.toNativeUtf8();
Libmdk.instance.MDK_setGlobalOptionString(k.cast(), v.cast());
malloc.free(v);
} else if (value is int) {
Libmdk.instance.MDK_setGlobalOptionInt32(k.cast(), value);
} else if (value is bool) {
Libmdk.instance.MDK_setGlobalOptionInt32(k.cast(), value ? 1 : 0);
} else if (value is LogLevel) {
Libmdk.instance.MDK_setGlobalOptionInt32(k.cast(), value.rawValue);
}
malloc.free(k);
}