Skip to content

Commit 4f988c9

Browse files
committed
update deps
1 parent 5da7104 commit 4f988c9

8 files changed

Lines changed: 47 additions & 22 deletions
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
library protocol_handler_windows;
22

3-
export 'src/protocol_handler_helper.dart';
3+
export 'src/protocol_handler_windows_impl.dart';

packages/protocol_handler_windows/lib/src/protocol_handler_helper.dart

Lines changed: 0 additions & 3 deletions
This file was deleted.

packages/protocol_handler_windows/lib/src/protocol_handler_helper_web.dart

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import 'package:protocol_handler_platform_interface/protocol_handler_platform_interface.dart';
2+
3+
abstract class ProtocolHandlerWindowsBase extends MethodChannelProtocolHandler {
4+
Future<void> register(String scheme, {String? friendlyAppName});
5+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import 'package:protocol_handler_platform_interface/protocol_handler_platform_interface.dart';
2+
3+
import 'protocol_handler_windows_stub.dart'
4+
if (dart.library.io) 'protocol_handler_windows_ffi.dart'
5+
if (dart.library.html) 'protocol_handler_windows_web.dart';
6+
7+
class ProtocolHandlerWindows extends MethodChannelProtocolHandler {
8+
final ProtocolHandlerWindowsImpl _impl;
9+
10+
ProtocolHandlerWindows() : _impl = ProtocolHandlerWindowsImpl();
11+
12+
Future<void> register(String scheme, {String? friendlyAppName}) async {
13+
return await _impl.register(scheme);
14+
}
15+
}

packages/protocol_handler_windows/lib/src/protocol_handler_helper_ffi.dart renamed to packages/protocol_handler_windows/lib/src/protocol_handler_windows_io.dart

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
import 'dart:io';
22

33
import 'package:protocol_handler_platform_interface/protocol_handler_platform_interface.dart';
4+
import 'package:protocol_handler_windows/src/protocol_handler_windows_base.dart';
45
import 'package:win32_registry/win32_registry.dart';
56

6-
class ProtocolHandlerWindows extends MethodChannelProtocolHandler {
7+
class ProtocolHandlerWindowsImpl extends ProtocolHandlerWindowsBase {
78
/// The [ProtocolHandlerWindows] constructor.
8-
ProtocolHandlerWindows() : super();
9+
ProtocolHandlerWindowsImpl() : super();
910

10-
/// Registers this class as the default instance of [ProtocolHandlerWindows].
11+
/// Registers this class as the default instance of [ProtocolHandlerWindowsImpl].
1112
static void registerWith() {
12-
ProtocolHandlerPlatform.instance = ProtocolHandlerWindows();
13+
ProtocolHandlerPlatform.instance = ProtocolHandlerWindowsImpl();
1314
}
1415

1516
@override
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import 'package:protocol_handler_windows/src/protocol_handler_windows_base.dart';
2+
3+
class ProtocolHandlerWindowsImpl extends ProtocolHandlerWindowsBase {
4+
@override
5+
Future<void> register(String scheme, {String? friendlyAppName}) async {
6+
// Stub implementation does nothing.
7+
}
8+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import 'package:protocol_handler_windows/src/protocol_handler_windows_base.dart';
2+
3+
class ProtocolHandlerWindows extends ProtocolHandlerWindowsBase {
4+
ProtocolHandlerWindows() : super();
5+
6+
static void registerWith() {
7+
// Web implementation does nothing.
8+
}
9+
10+
Future<void> register(String scheme, {String? friendlyAppName}) async {
11+
// Web implementation does nothing.
12+
}
13+
}

0 commit comments

Comments
 (0)