import 'package:flutter/services.dart'; import '../../application/application.dart'; final class MethodChannelSessionNotificationGateway implements SessionNotificationGateway { const MethodChannelSessionNotificationGateway({ MethodChannel methodChannel = const MethodChannel(_methodChannelName), }) : _methodChannel = methodChannel; static const _methodChannelName = 'gametime.session_notification/methods'; final MethodChannel _methodChannel; @override Future show(SessionNotificationContent content) { return _invokeIgnoringMissingPlugin('show', content.toJson()); } @override Future clear() { return _invokeIgnoringMissingPlugin('clear'); } Future _invokeIgnoringMissingPlugin( String method, [ Object? arguments, ]) { return _methodChannel .invokeMethod(method, arguments) .onError((_, _) {}); } }