Skip to content

Commit

Permalink
fix: dyn library initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
mpoplavkov committed Feb 7, 2024
1 parent 5528e28 commit f500073
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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}');
}();
Expand Down

0 comments on commit f500073

Please sign in to comment.