Make the theme switcher icon change depending on the theme.
This commit is contained in:
parent
402de821a0
commit
fb0dbef158
@ -1,6 +1,6 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<application
|
<application
|
||||||
android:label="calodiary"
|
android:label="Calodiary"
|
||||||
android:name="${applicationName}"
|
android:name="${applicationName}"
|
||||||
android:icon="@mipmap/ic_launcher">
|
android:icon="@mipmap/ic_launcher">
|
||||||
<activity
|
<activity
|
||||||
|
@ -41,12 +41,18 @@ class _PerDateWidgetState extends State<PerDateWidget> {
|
|||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: Text(formattedDate),
|
title: Text(formattedDate),
|
||||||
actions: [
|
actions: [
|
||||||
IconButton(
|
BlocBuilder<ThemeDataBloc, ThemeState>(builder: (context, state) {
|
||||||
icon: const Icon(Icons.lightbulb),
|
var icon = const Icon(Icons.light_mode);
|
||||||
|
if (state.brightness == 'light') {
|
||||||
|
icon = const Icon(Icons.dark_mode);
|
||||||
|
}
|
||||||
|
return IconButton(
|
||||||
|
icon: icon,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
context.read<ThemeDataBloc>().add(ThemeToggleEvent());
|
context.read<ThemeDataBloc>().add(ThemeToggleEvent());
|
||||||
},
|
},
|
||||||
),
|
);
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
drawer: const AppDrawer(),
|
drawer: const AppDrawer(),
|
||||||
|
Loading…
Reference in New Issue
Block a user