mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-29 04:49:51 +00:00
fix linux runtime issues
This commit is contained in:
parent
c1d53e014e
commit
3df598d69d
6 changed files with 72 additions and 0 deletions
61
lib/di.dart
61
lib/di.dart
|
@ -112,6 +112,8 @@ import 'package:cake_wallet/src/screens/support_chat/support_chat_page.dart';
|
||||||
import 'package:cake_wallet/src/screens/support_other_links/support_other_links_page.dart';
|
import 'package:cake_wallet/src/screens/support_other_links/support_other_links_page.dart';
|
||||||
import 'package:cake_wallet/src/screens/wallet/wallet_edit_page.dart';
|
import 'package:cake_wallet/src/screens/wallet/wallet_edit_page.dart';
|
||||||
import 'package:cake_wallet/src/screens/wallet_connect/wc_connections_listing_view.dart';
|
import 'package:cake_wallet/src/screens/wallet_connect/wc_connections_listing_view.dart';
|
||||||
|
import 'package:cake_wallet/src/screens/wallet_unlock/wallet_unlock_arguments.dart';
|
||||||
|
import 'package:cake_wallet/src/screens/wallet_unlock/wallet_unlock_page.dart';
|
||||||
import 'package:cake_wallet/themes/theme_list.dart';
|
import 'package:cake_wallet/themes/theme_list.dart';
|
||||||
import 'package:cake_wallet/utils/device_info.dart';
|
import 'package:cake_wallet/utils/device_info.dart';
|
||||||
import 'package:cake_wallet/store/anonpay/anonpay_transactions_store.dart';
|
import 'package:cake_wallet/store/anonpay/anonpay_transactions_store.dart';
|
||||||
|
@ -357,6 +359,65 @@ Future<void> setup({
|
||||||
getIt.get<AdvancedPrivacySettingsViewModel>(param1: type),
|
getIt.get<AdvancedPrivacySettingsViewModel>(param1: type),
|
||||||
type: type));
|
type: type));
|
||||||
|
|
||||||
|
getIt.registerFactoryParam<WalletUnlockPage, WalletUnlockArguments, bool>((args, closable) {
|
||||||
|
return WalletUnlockPage(
|
||||||
|
getIt.get<WalletUnlockLoadableViewModel>(param1: args),
|
||||||
|
args.callback,
|
||||||
|
args.authPasswordHandler,
|
||||||
|
closable: closable);
|
||||||
|
}, instanceName: 'wallet_unlock_loadable');
|
||||||
|
|
||||||
|
getIt.registerFactory<WalletUnlockPage>(
|
||||||
|
() => getIt.get<WalletUnlockPage>(
|
||||||
|
param1: WalletUnlockArguments(
|
||||||
|
callback: (bool successful, _) {
|
||||||
|
if (successful) {
|
||||||
|
final authStore = getIt.get<AuthenticationStore>();
|
||||||
|
authStore.allowed();
|
||||||
|
}}),
|
||||||
|
param2: false,
|
||||||
|
instanceName: 'wallet_unlock_loadable'),
|
||||||
|
instanceName: 'wallet_password_login');
|
||||||
|
|
||||||
|
getIt.registerFactoryParam<WalletUnlockPage, WalletUnlockArguments, bool>((args, closable) {
|
||||||
|
return WalletUnlockPage(
|
||||||
|
getIt.get<WalletUnlockVerifiableViewModel>(param1: args),
|
||||||
|
args.callback,
|
||||||
|
args.authPasswordHandler,
|
||||||
|
closable: closable);
|
||||||
|
}, instanceName: 'wallet_unlock_verifiable');
|
||||||
|
|
||||||
|
getIt.registerFactoryParam<WalletUnlockLoadableViewModel, WalletUnlockArguments, void>((args, _) {
|
||||||
|
final currentWalletName = getIt
|
||||||
|
.get<SharedPreferences>()
|
||||||
|
.getString(PreferencesKey.currentWalletName) ?? '';
|
||||||
|
final currentWalletTypeRaw =
|
||||||
|
getIt.get<SharedPreferences>()
|
||||||
|
.getInt(PreferencesKey.currentWalletType) ?? 0;
|
||||||
|
final currentWalletType = deserializeFromInt(currentWalletTypeRaw);
|
||||||
|
|
||||||
|
return WalletUnlockLoadableViewModel(
|
||||||
|
getIt.get<AppStore>(),
|
||||||
|
getIt.get<WalletLoadingService>(),
|
||||||
|
walletName: args.walletName ?? currentWalletName,
|
||||||
|
walletType: args.walletType ?? currentWalletType);
|
||||||
|
});
|
||||||
|
|
||||||
|
getIt.registerFactoryParam<WalletUnlockVerifiableViewModel, WalletUnlockArguments, void>((args, _) {
|
||||||
|
final currentWalletName = getIt
|
||||||
|
.get<SharedPreferences>()
|
||||||
|
.getString(PreferencesKey.currentWalletName) ?? '';
|
||||||
|
final currentWalletTypeRaw =
|
||||||
|
getIt.get<SharedPreferences>()
|
||||||
|
.getInt(PreferencesKey.currentWalletType) ?? 0;
|
||||||
|
final currentWalletType = deserializeFromInt(currentWalletTypeRaw);
|
||||||
|
|
||||||
|
return WalletUnlockVerifiableViewModel(
|
||||||
|
getIt.get<AppStore>(),
|
||||||
|
walletName: args.walletName ?? currentWalletName,
|
||||||
|
walletType: args.walletType ?? currentWalletType);
|
||||||
|
});
|
||||||
|
|
||||||
getIt.registerFactoryParam<WalletRestorationFromQRVM, WalletType, void>((WalletType type, _) {
|
getIt.registerFactoryParam<WalletRestorationFromQRVM, WalletType, void>((WalletType type, _) {
|
||||||
return WalletRestorationFromQRVM(getIt.get<AppStore>(),
|
return WalletRestorationFromQRVM(getIt.get<AppStore>(),
|
||||||
getIt.get<WalletCreationService>(param1: type), _walletInfoSource, type);
|
getIt.get<WalletCreationService>(param1: type), _walletInfoSource, type);
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
#include <devicelocale/devicelocale_plugin.h>
|
#include <devicelocale/devicelocale_plugin.h>
|
||||||
#include <flutter_local_authentication/flutter_local_authentication_plugin.h>
|
#include <flutter_local_authentication/flutter_local_authentication_plugin.h>
|
||||||
|
#include <flutter_secure_storage_linux/flutter_secure_storage_linux_plugin.h>
|
||||||
#include <url_launcher_linux/url_launcher_plugin.h>
|
#include <url_launcher_linux/url_launcher_plugin.h>
|
||||||
|
|
||||||
void fl_register_plugins(FlPluginRegistry* registry) {
|
void fl_register_plugins(FlPluginRegistry* registry) {
|
||||||
|
@ -17,6 +18,9 @@ void fl_register_plugins(FlPluginRegistry* registry) {
|
||||||
g_autoptr(FlPluginRegistrar) flutter_local_authentication_registrar =
|
g_autoptr(FlPluginRegistrar) flutter_local_authentication_registrar =
|
||||||
fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterLocalAuthenticationPlugin");
|
fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterLocalAuthenticationPlugin");
|
||||||
flutter_local_authentication_plugin_register_with_registrar(flutter_local_authentication_registrar);
|
flutter_local_authentication_plugin_register_with_registrar(flutter_local_authentication_registrar);
|
||||||
|
g_autoptr(FlPluginRegistrar) flutter_secure_storage_linux_registrar =
|
||||||
|
fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterSecureStorageLinuxPlugin");
|
||||||
|
flutter_secure_storage_linux_plugin_register_with_registrar(flutter_secure_storage_linux_registrar);
|
||||||
g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
|
g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
|
||||||
fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
|
fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
|
||||||
url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
|
url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
list(APPEND FLUTTER_PLUGIN_LIST
|
list(APPEND FLUTTER_PLUGIN_LIST
|
||||||
devicelocale
|
devicelocale
|
||||||
flutter_local_authentication
|
flutter_local_authentication
|
||||||
|
flutter_secure_storage_linux
|
||||||
url_launcher_linux
|
url_launcher_linux
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@ import device_info_plus
|
||||||
import devicelocale
|
import devicelocale
|
||||||
import flutter_inappwebview_macos
|
import flutter_inappwebview_macos
|
||||||
import flutter_local_authentication
|
import flutter_local_authentication
|
||||||
|
import flutter_secure_storage_macos
|
||||||
import in_app_review
|
import in_app_review
|
||||||
import package_info_plus
|
import package_info_plus
|
||||||
import path_provider_foundation
|
import path_provider_foundation
|
||||||
|
@ -24,6 +25,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||||
DevicelocalePlugin.register(with: registry.registrar(forPlugin: "DevicelocalePlugin"))
|
DevicelocalePlugin.register(with: registry.registrar(forPlugin: "DevicelocalePlugin"))
|
||||||
InAppWebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "InAppWebViewFlutterPlugin"))
|
InAppWebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "InAppWebViewFlutterPlugin"))
|
||||||
FlutterLocalAuthenticationPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalAuthenticationPlugin"))
|
FlutterLocalAuthenticationPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalAuthenticationPlugin"))
|
||||||
|
FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin"))
|
||||||
InAppReviewPlugin.register(with: registry.registrar(forPlugin: "InAppReviewPlugin"))
|
InAppReviewPlugin.register(with: registry.registrar(forPlugin: "InAppReviewPlugin"))
|
||||||
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
|
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
|
||||||
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
#include <connectivity_plus/connectivity_plus_windows_plugin.h>
|
#include <connectivity_plus/connectivity_plus_windows_plugin.h>
|
||||||
#include <flutter_local_authentication/flutter_local_authentication_plugin_c_api.h>
|
#include <flutter_local_authentication/flutter_local_authentication_plugin_c_api.h>
|
||||||
|
#include <flutter_secure_storage_windows/flutter_secure_storage_windows_plugin.h>
|
||||||
#include <permission_handler_windows/permission_handler_windows_plugin.h>
|
#include <permission_handler_windows/permission_handler_windows_plugin.h>
|
||||||
#include <url_launcher_windows/url_launcher_windows.h>
|
#include <url_launcher_windows/url_launcher_windows.h>
|
||||||
|
|
||||||
|
@ -16,6 +17,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {
|
||||||
registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin"));
|
registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin"));
|
||||||
FlutterLocalAuthenticationPluginCApiRegisterWithRegistrar(
|
FlutterLocalAuthenticationPluginCApiRegisterWithRegistrar(
|
||||||
registry->GetRegistrarForPlugin("FlutterLocalAuthenticationPluginCApi"));
|
registry->GetRegistrarForPlugin("FlutterLocalAuthenticationPluginCApi"));
|
||||||
|
FlutterSecureStorageWindowsPluginRegisterWithRegistrar(
|
||||||
|
registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin"));
|
||||||
PermissionHandlerWindowsPluginRegisterWithRegistrar(
|
PermissionHandlerWindowsPluginRegisterWithRegistrar(
|
||||||
registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin"));
|
registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin"));
|
||||||
UrlLauncherWindowsRegisterWithRegistrar(
|
UrlLauncherWindowsRegisterWithRegistrar(
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
list(APPEND FLUTTER_PLUGIN_LIST
|
list(APPEND FLUTTER_PLUGIN_LIST
|
||||||
connectivity_plus
|
connectivity_plus
|
||||||
flutter_local_authentication
|
flutter_local_authentication
|
||||||
|
flutter_secure_storage_windows
|
||||||
permission_handler_windows
|
permission_handler_windows
|
||||||
url_launcher_windows
|
url_launcher_windows
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue