init method
Initializes the platform interface with id
.
This method is called when the plugin is first initialized.
Implementation
@override
Future<void> init(int id) {
MethodChannel? channel;
if (!_channels.containsKey(id)) {
channel = MethodChannel('smart_dev_flutter_cast/chromeCast_$id');
channel.setMethodCallHandler((call) => _handleMethodCall(call, id));
_channels[id] = channel;
}
return channel!.invokeMethod<void>('chromeCast#wait');
}