18 lines
493 B
Dart
18 lines
493 B
Dart
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
import 'package:equatable/equatable.dart';
|
|
|
|
part 'theme_events.dart';
|
|
part 'theme_state.dart';
|
|
|
|
class ThemeBloc extends Bloc<ThemeEvent, ThemeState> {
|
|
final AppTheme initialAppTheme;
|
|
ThemeBloc({required this.initialAppTheme})
|
|
: super(
|
|
ThemeState(status: ThemeStatus.success, appTheme: initialAppTheme),
|
|
) {
|
|
on<ChangeThemeEvent>((event, emit) async {
|
|
emit(state.copyWith(appTheme: event.appTheme));
|
|
});
|
|
}
|
|
}
|