Skip to content

Commit f637c73

Browse files
committed
refactor: convert to block body
1 parent c68be37 commit f637c73

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

lib/features/home/view/home_screen.dart

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,19 +101,31 @@ class _HomeScreenState extends State<HomeScreen> with SingleTickerProviderStateM
101101
RadioListTile(
102102
value: ThemeMode.system,
103103
groupValue: state.themeMode,
104-
onChanged: (value) => Future(() => context.read<AppThemeCubit>().themeChanged(value!)).then((_) => Navigator.pop(context)),
104+
onChanged: (value) async {
105+
return Future(() {
106+
context.read<AppThemeCubit>().themeChanged(value!);
107+
}).then((_) => Navigator.pop(context));
108+
},
105109
title: const Text("Default"),
106110
),
107111
RadioListTile(
108112
value: ThemeMode.light,
109113
groupValue: state.themeMode,
110-
onChanged: (value) => Future(() => context.read<AppThemeCubit>().themeChanged(value!)).then((_) => Navigator.pop(context)),
114+
onChanged: (value) async {
115+
return Future(() {
116+
context.read<AppThemeCubit>().themeChanged(value!);
117+
}).then((_) => Navigator.pop(context));
118+
},
111119
title: const Text("Terang"),
112120
),
113121
RadioListTile(
114122
value: ThemeMode.dark,
115123
groupValue: state.themeMode,
116-
onChanged: (value) => Future(() => context.read<AppThemeCubit>().themeChanged(value!)).then((_) => Navigator.pop(context)),
124+
onChanged: (value) async {
125+
return Future(() {
126+
context.read<AppThemeCubit>().themeChanged(value!);
127+
}).then((_) => Navigator.pop(context));
128+
},
117129
title: const Text("Gelap"),
118130
),
119131
],

0 commit comments

Comments
 (0)