This repository has been archived on 2023-11-13. You can view files and clone it, but cannot push or open issues or pull requests.
imagini/web_native/lib/blocs/theme/bloc.dart
2021-01-23 19:28:26 -05:00

24 lines
615 B
Dart

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<ThemeEvent, ThemeState> {
//
ThemeBloc()
: super(
ThemeState(
themeData: AppThemes.appThemeData[AppTheme.lightTheme],
),
);
@override
Stream<ThemeState> mapEventToState(ThemeEvent event) async* {
if (event is ThemeEvent) {
yield ThemeState(
themeData: AppThemes.appThemeData[event.appTheme],
);
}
}
}