import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:imagini/blocs/theme/events.dart'; import 'package:imagini/blocs/theme/state.dart'; import 'package:imagini/settings/app_themes.dart'; class ThemeBloc extends Bloc { // ThemeBloc() : super( ThemeState( themeData: AppThemes.appThemeData[AppTheme.lightTheme], ), ); @override Stream mapEventToState(ThemeEvent event) async* { if (event is ThemeEvent) { yield ThemeState( themeData: AppThemes.appThemeData[event.appTheme], ); } } }