diff options
-rw-r--r-- | midtrans.dart | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/midtrans.dart b/midtrans.dart index 3fa0ea8..4476477 100644 --- a/midtrans.dart +++ b/midtrans.dart @@ -23,13 +23,10 @@ typedef MidtransChargeBanktransfer Array<Pointer<Utf8>>); class Midtrans { - DynamicLibrary dylib; + final dylib = Platform.isAndroid ? DynamicLibrary.open('libmidtrans.so') + : DynamicLibrary.process();; Midtrans(String apiKey, String pem) { - dylib = Platform.isAndroid - ? DynamicLibrary.open('libmidtrans.so') - : DynamicLibrary.process(); - final apiKeyUtf8 = apiKey.toNativeUtf8(); final pemUtf8 = pem.toNativeUtf8(); final midtrans_init = dylib.lookupFunction |