getState method

InitializedPayState? getState(
  1. BuildContext context
)

Implementation

InitializedPayState? getState(BuildContext context) {
  try {
    var bloc = BlocProvider.of<PayBloc>(context);
    var state = bloc.state;
    if (state is InitializedPayState) {
      return state;
    }
  } catch (_) {}
  return null;
}