removed deprecated uses, fmt

This commit is contained in:
Deven Joshi
2021-05-17 14:40:50 +05:30
parent 0303e18945
commit 1ba92a8676
24 changed files with 208 additions and 96 deletions
@@ -16,7 +16,8 @@ class SettingsView extends StatelessWidget {
return MultiBlocProvider(
providers: [
BlocProvider(
create: (_) => SettingsSwitchCubit(context.read<AppThemeCubit>().isDark),
create: (_) =>
SettingsSwitchCubit(context.read<AppThemeCubit>().isDark),
),
BlocProvider(
create: (_) => SettingsLogoutCubit(context.read()),
@@ -75,11 +76,14 @@ class SettingsView extends StatelessWidget {
),
),
Spacer(),
BlocBuilder<SettingsSwitchCubit, bool>(builder: (context, snapshot) {
BlocBuilder<SettingsSwitchCubit, bool>(
builder: (context, snapshot) {
return Switch(
value: snapshot,
onChanged: (val) {
context.read<SettingsSwitchCubit>().onChangeDarkMode(val);
context
.read<SettingsSwitchCubit>()
.onChangeDarkMode(val);
context.read<AppThemeCubit>().updateTheme(val);
},
);