untilDoneLoading function
Returns a future that finishes when the bloc is done loading (i.e. isLoading turns false).
If the state is already not loading, the future completes instantly.
Implementation
FutureOr<void> untilDoneLoading(BaseResourceBloc bloc) =>
untilState(bloc, (state) => !state.isLoading);