Skip to content

Instantly share code, notes, and snippets.

@alana-mullen
Created November 3, 2023 01:36
Show Gist options
  • Save alana-mullen/e35ccd08446770580dbfba47cf97f7ea to your computer and use it in GitHub Desktop.
Save alana-mullen/e35ccd08446770580dbfba47cf97f7ea to your computer and use it in GitHub Desktop.
Flutter extension for BLoC to reset to initial state
import 'package:flutter_bloc/flutter_bloc.dart';
extension BlocReset on Bloc {
void reset(dynamic initialState) {
emit(initialState);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment