Line data Source code
1 : import 'package:flutter/services.dart';
2 : import 'package:flutter_chrome_cast/entities/cast_options.dart';
3 : import 'google_cast_context_platform_interface.dart';
4 :
5 : /// iOS-specific implementation of Google Cast context functionality.
6 : ///
7 : /// This class provides the iOS platform implementation for initializing
8 : /// and managing the Google Cast context using method channels.
9 : class FlutterIOSGoogleCastContextMethodChannel
10 : extends GoogleCastContextPlatformInterface {
11 : static const _methodChannel = MethodChannel('google_cast.context');
12 :
13 1 : @override
14 : Future<bool> setSharedInstanceWithOptions(
15 : GoogleCastOptions castOptions) async {
16 : try {
17 1 : final result = await _methodChannel.invokeMethod(
18 : 'setSharedInstanceWithOptions',
19 1 : castOptions.toMap(),
20 : );
21 1 : return result == true;
22 : } catch (e) {
23 : rethrow;
24 : }
25 : }
26 : }
|