diff options
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 |
