bloc<C extends Cubit<Object>> method

  1. @Deprecated('Use context.read or context.watch instead. Will be removed in v7.0.0')
C bloc<C extends Cubit<Object>>()
@Deprecated('Use context.read or context.watch instead. Will be removed in v7.0.0')

Performs a lookup using the BuildContext to obtain the nearest ancestor Cubit of type C.

Calling this method is equivalent to calling:

BlocProvider.of<C>(context)

Implementation

@Deprecated(
  'Use context.read or context.watch instead. Will be removed in v7.0.0',
)
C bloc<C extends Cubit<Object>>() => BlocProvider.of<C>(this);