fix(tv): pass root menu to system

This commit is contained in:
edde746
2026-05-26 18:27:26 +02:00
parent be86a33057
commit 4eadec5b17
5 changed files with 131 additions and 6 deletions
@@ -0,0 +1,20 @@
import 'package:flutter/services.dart';
import '../utils/platform_detector.dart';
class TvosSystemNavigationService {
static const BasicMessageChannel<Object?> _channel = BasicMessageChannel<Object?>(
'flutter/tvos_system_navigation',
JSONMessageCodec(),
);
static bool? _menuPassthroughEnabled;
static Future<void> setMenuPassthroughEnabled(bool enabled) async {
if (!PlatformDetector.isAppleTV()) return;
if (_menuPassthroughEnabled == enabled) return;
_menuPassthroughEnabled = enabled;
await _channel.send({'menuPassthroughEnabled': enabled});
}
}