of<T extends Bloc> static method

T of<T extends Bloc>(
  1. BuildContext context, [
  2. bool attachContext = true
])

Whenever you want to get your BloC, you can decide wether to attach the context of your widget to the InheritedWidget or not. In order to control this behavior, the static method of has an optional boolean argument (which is true by default) which determines wether your context will be attached or not. Basically, if you don't provide it or you just set it to true, dependOnInheritedWidgetOfExactType will be used. If you set

Implementation

static T of<T extends Bloc>(BuildContext context,
        [bool attachContext = true]) =>
    _BlocProvider.of(context, attachContext);