m3_lightmeter/test/event_channel_mock.dart

11 lines
375 B
Dart
Raw Permalink Normal View History

import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
Future<void> sendMockVolumeAction(String channelName, int keyCode) async {
await TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger.handlePlatformMessage(
channelName,
const StandardMethodCodec().encodeSuccessEnvelope(keyCode),
(ByteData? data) {},
);
}