Created
November 3, 2023 01:36
-
-
Save alana-mullen/e35ccd08446770580dbfba47cf97f7ea to your computer and use it in GitHub Desktop.
Flutter extension for BLoC to reset to initial state
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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