of static method

Use this method to get the current MessageSearchBlocState instance

Implementation

static MessageSearchBlocState of(BuildContext context) {
  MessageSearchBlocState? state;

  state = context.findAncestorStateOfType<MessageSearchBlocState>();

  assert(
    state != null,
    'You must have a MessageSearchBloc widget as ancestor',
  );

  return state!;
}