diff options
| author | mirror <mirror@localhost> | 2026-11-22 08:41:00 +0900 |
|---|---|---|
| committer | mirror <mirror@localhost> | 2026-11-22 08:41:00 +0900 |
| commit | 449d8b74bd6d9dae98a07254cdfad677b920e7b0 (patch) | |
| tree | c131c3528c4d517f56e19b854a7453fedb097d40 /lib/services/common/channel.dart | |
| download | aves-src-master.tar.gz aves-src-master.zip | |
Diffstat (limited to 'lib/services/common/channel.dart')
| -rw-r--r-- | lib/services/common/channel.dart | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/services/common/channel.dart b/lib/services/common/channel.dart new file mode 100644 index 0000000..79985b0 --- /dev/null +++ b/lib/services/common/channel.dart @@ -0,0 +1,29 @@ +import 'package:flutter/foundation.dart'; +import 'package:flutter/services.dart'; +import 'package:streams_channel/streams_channel.dart'; + +const bool debugAvesPlatformChannels = kDebugMode; + +class AvesMethodChannel extends MethodChannel { + const AvesMethodChannel(super.name); + + @override + Future<T?> invokeMethod<T>(String method, [arguments]) { + if (debugAvesPlatformChannels) { + debugPrint('$runtimeType invokeMethod name=$name method=$method arguments=$arguments'); + } + return super.invokeMethod(method, arguments); + } +} + +class AvesStreamsChannel extends StreamsChannel { + AvesStreamsChannel(super.name); + + @override + Stream receiveBroadcastStream([arguments]) { + if (debugAvesPlatformChannels) { + debugPrint('$runtimeType invokeMethod name=$name arguments=$arguments'); + } + return super.receiveBroadcastStream(arguments); + } +}
\ No newline at end of file |
