Stream Chatty added as example (#21)
* app updated * readme updated * rename base folder * update chatty's readme Co-authored-by: Neevash Ramdial <[email protected]>
This commit is contained in:
co-authored by
Neevash Ramdial
parent
c86652dcfc
commit
bd6bb66279
@@ -0,0 +1,19 @@
|
||||
import 'package:stream_chatter/domain/usecases/logout_usecase.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
|
||||
class SettingsSwitchCubit extends Cubit<bool> {
|
||||
SettingsSwitchCubit(bool state) : super(state);
|
||||
|
||||
void onChangeDarkMode(bool isDark) => emit(isDark);
|
||||
}
|
||||
|
||||
class SettingsLogoutCubit extends Cubit<void> {
|
||||
SettingsLogoutCubit(this._logoutUseCase) : super(null);
|
||||
|
||||
final LogoutUseCase _logoutUseCase;
|
||||
|
||||
void logOut() async {
|
||||
await _logoutUseCase.logout();
|
||||
emit(null);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user