AppThemeBloc constructor

AppThemeBloc()

Implementation

AppThemeBloc() : super(AppThemeColor._light) {
  //get the data from user and emit value
  on<AppThemeChangeEvent>((event, emit) async {
    // Initialized the value of light theme

    final lightTheme = AppThemeColor._light;

    // Initialized the value of dark theme
    final darkTheme = AppThemeColor._dark;

    /// here we handle the on change event and provide the theme
    emit(state.brightness == Brightness.dark ? lightTheme : darkTheme);
  });
}