How I can change theme with a switch in flutter using bloc?
Yes, You can
In Switch Widget's onChanged function call updateAppTheme() function in your cubit
context.read<ThemeCubit>().updateAppTheme();
Builder(builder:(context){bool isDark= context.select( (ThemeCubit themeCubit) => themeCubit.state.themeMode)==ThemeMode.dark?true:false;return Switch(value: isDark, onChanged: (value) {context.read<ThemeCubit>().updateAppTheme();});})