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..fe1e6ab 100644 --- a/packages/protocol_handler_windows/lib/src/protocol_handler_windows.dart +++ b/packages/protocol_handler_windows/lib/src/protocol_handler_windows.dart @@ -17,20 +17,10 @@ class ProtocolHandlerWindows extends MethodChannelProtocolHandler { String appPath = Platform.resolvedExecutable; String protocolRegKey = 'Software\\Classes\\$scheme'; - RegistryValue protocolRegValue = const RegistryValue( - 'URL Protocol', - RegistryValueType.string, - '', - ); String protocolCmdRegKey = 'shell\\open\\command'; - RegistryValue protocolCmdRegValue = RegistryValue( - '', - RegistryValueType.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', RegistryValue.string('')); + regKey.create(protocolCmdRegKey).setValue('', RegistryValue.string('$appPath "%1"')); } } diff --git a/packages/protocol_handler_windows/pubspec.yaml b/packages/protocol_handler_windows/pubspec.yaml index 4d1408f..76a1051 100644 --- a/packages/protocol_handler_windows/pubspec.yaml +++ b/packages/protocol_handler_windows/pubspec.yaml @@ -4,14 +4,14 @@ version: 0.2.0 repository: https://github.com/leanflutter/protocol_handler/tree/main/packages/protocol_handler_windows environment: - sdk: ">=3.1.0 <4.0.0" + sdk: ">=3.11.0 <4.0.0" flutter: ">=3.16.0" dependencies: flutter: sdk: flutter protocol_handler_platform_interface: ^0.2.0 - win32_registry: ^1.0.2 + win32_registry: ^3.0.3 dev_dependencies: flutter_test: