of static method

Gets the QuickRTCController instance and listens for changes.

The widget calling this will rebuild whenever the controller's state changes. Prefer using QuickRTCBuilder or QuickRTCConsumer for more control.

Example:

final controller = QuickRTCProvider.of(context);

Implementation

static QuickRTCController of(BuildContext context) {
  final provider =
      context.dependOnInheritedWidgetOfExactType<QuickRTCProvider>();
  if (provider == null) {
    throw FlutterError(
      'QuickRTCProvider.of() called with a context that does not contain a QuickRTCProvider.\n'
      'Make sure to wrap your widget tree with QuickRTCProvider.',
    );
  }
  return provider.controller;
}