fix(tv): pass root menu to system
This commit is contained in:
@@ -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});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user