Created
September 1, 2020 08:05
-
-
Save magicleon94/df7f336222e45bf7f4db7d290b27f83c to your computer and use it in GitHub Desktop.
Closable Bloc
This file contains hidden or 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/material.dart'; | |
import 'package:flutter_bloc/flutter_bloc.dart'; | |
abstract class ClosableBloc<E, S> extends Bloc<E, S> { | |
var closed = false; | |
ClosableBloc(S initialState) : super(initialState); | |
@override | |
@mustCallSuper | |
Future<void> close() { | |
closed = true; | |
return super.close(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment