m3_lightmeter/test/event_channel_mock.dart

10 lines
375 B
Dart

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) {},
);
}