ofType<T extends AuthController> static method

T ofType<T extends AuthController>(
  1. BuildContext context
)

Implementation

static T ofType<T extends AuthController>(BuildContext context) {
  final ctrl = context
      .dependOnInheritedWidgetOfExactType<AuthControllerProvider>()
      ?.ctrl;

  if (ctrl == null || ctrl is! T) {
    throw Exception(
      'No controller of type $T found. '
      'Make sure to wrap your code with AuthFlowBuilder<$T>',
    );
  }

  return ctrl;
}