From f50007325b1cd7d9844ee2e9348f611ad2d62fed Mon Sep 17 00:00:00 2001 From: mpoplavkov Date: Wed, 7 Feb 2024 12:45:43 +0000 Subject: [PATCH] fix: dyn library initialization --- .../lib/ffi/mobile_wrapper.dart | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/flutter_fuelet_smart_contract_wallet/lib/ffi/mobile_wrapper.dart b/packages/flutter_fuelet_smart_contract_wallet/lib/ffi/mobile_wrapper.dart index 0f94ee5..51d8ac9 100644 --- a/packages/flutter_fuelet_smart_contract_wallet/lib/ffi/mobile_wrapper.dart +++ b/packages/flutter_fuelet_smart_contract_wallet/lib/ffi/mobile_wrapper.dart @@ -4,18 +4,19 @@ import 'dart:io'; import 'package:flutter_fuelet_smart_contract_wallet/flutter_fuelet_smart_contract_wallet_bindings_generated.dart'; import 'package:fuelet_smart_contract_wallet/fuelet_smart_contract_wallet.dart'; -const String _libName = 'flutter_fuelet_smart_contract_wallet'; +const String _base = 'fuelet_smart_contract_wallet'; +const String _flutterLibName = 'flutter_$_base'; /// The dynamic library in which the symbols for [FlutterFueletSmartContractWalletBindings] can be found. final DynamicLibrary _dylib = () { if (Platform.isMacOS || Platform.isIOS) { - return DynamicLibrary.open('$_libName.framework/$_libName'); + return DynamicLibrary.open('$_flutterLibName.framework/$_flutterLibName'); } if (Platform.isAndroid || Platform.isLinux) { - return DynamicLibrary.open('lib$_libName.so'); + return DynamicLibrary.open('lib$_base.so'); } if (Platform.isWindows) { - return DynamicLibrary.open('$_libName.dll'); + return DynamicLibrary.open('$_base.dll'); } throw UnsupportedError('Unknown platform: ${Platform.operatingSystem}'); }();