From cf80abed1e2db6c5d344d2619ed258bdc6feafc6 Mon Sep 17 00:00:00 2001 From: feimeng Date: Thu, 10 Apr 2025 14:59:10 +0800 Subject: [PATCH 1/2] Update plugin to use win32_registry version 2.1.0 --- .../lib/src/protocol_handler_windows.dart | 6 ++---- packages/protocol_handler_windows/pubspec.yaml | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/protocol_handler_windows/lib/src/protocol_handler_windows.dart b/packages/protocol_handler_windows/lib/src/protocol_handler_windows.dart index 609831c..d033cec 100644 --- a/packages/protocol_handler_windows/lib/src/protocol_handler_windows.dart +++ b/packages/protocol_handler_windows/lib/src/protocol_handler_windows.dart @@ -17,15 +17,13 @@ class ProtocolHandlerWindows extends MethodChannelProtocolHandler { String appPath = Platform.resolvedExecutable; String protocolRegKey = 'Software\\Classes\\$scheme'; - RegistryValue protocolRegValue = const RegistryValue( + RegistryValue protocolRegValue = RegistryValue.string( 'URL Protocol', - RegistryValueType.string, '', ); String protocolCmdRegKey = 'shell\\open\\command'; - RegistryValue protocolCmdRegValue = RegistryValue( + RegistryValue protocolCmdRegValue = RegistryValue.string( '', - RegistryValueType.string, '$appPath "%1"', ); diff --git a/packages/protocol_handler_windows/pubspec.yaml b/packages/protocol_handler_windows/pubspec.yaml index 4d1408f..db1bfc3 100644 --- a/packages/protocol_handler_windows/pubspec.yaml +++ b/packages/protocol_handler_windows/pubspec.yaml @@ -11,7 +11,7 @@ dependencies: flutter: sdk: flutter protocol_handler_platform_interface: ^0.2.0 - win32_registry: ^1.0.2 + win32_registry: ^2.1.0 dev_dependencies: flutter_test: From 1fdee316a42515c2f25d61d89d24676a57b51533 Mon Sep 17 00:00:00 2001 From: feimeng Date: Sat, 9 May 2026 22:55:04 +0800 Subject: [PATCH 2/2] Update plugin to use win32_registry version 3.0.3 --- .../lib/src/protocol_handler_windows.dart | 16 +++++----------- packages/protocol_handler_windows/pubspec.yaml | 2 +- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/packages/protocol_handler_windows/lib/src/protocol_handler_windows.dart b/packages/protocol_handler_windows/lib/src/protocol_handler_windows.dart index d033cec..123cbce 100644 --- a/packages/protocol_handler_windows/lib/src/protocol_handler_windows.dart +++ b/packages/protocol_handler_windows/lib/src/protocol_handler_windows.dart @@ -17,18 +17,12 @@ class ProtocolHandlerWindows extends MethodChannelProtocolHandler { String appPath = Platform.resolvedExecutable; String protocolRegKey = 'Software\\Classes\\$scheme'; - RegistryValue protocolRegValue = RegistryValue.string( - 'URL Protocol', - '', - ); + RegistryValue protocolRegValue = RegistryValue.string(''); String protocolCmdRegKey = 'shell\\open\\command'; - RegistryValue protocolCmdRegValue = RegistryValue.string( - '', - '$appPath "%1"', - ); + RegistryValue protocolCmdRegValue = RegistryValue.string('$appPath "%1"'); - final regKey = Registry.currentUser.createKey(protocolRegKey); - regKey.createValue(protocolRegValue); - regKey.createKey(protocolCmdRegKey).createValue(protocolCmdRegValue); + final regKey = CURRENT_USER.create(protocolRegKey); + regKey.setValue('URL Protocol', protocolRegValue); + regKey.setValue(protocolCmdRegKey, protocolCmdRegValue); } } diff --git a/packages/protocol_handler_windows/pubspec.yaml b/packages/protocol_handler_windows/pubspec.yaml index db1bfc3..a4f5acd 100644 --- a/packages/protocol_handler_windows/pubspec.yaml +++ b/packages/protocol_handler_windows/pubspec.yaml @@ -11,7 +11,7 @@ dependencies: flutter: sdk: flutter protocol_handler_platform_interface: ^0.2.0 - win32_registry: ^2.1.0 + win32_registry: ^3.0.3 dev_dependencies: flutter_test: