Skip to content

Commit

Permalink
Update-styling of brightness button
Browse files Browse the repository at this point in the history
  • Loading branch information
SuchitaSri18 committed May 19, 2024
1 parent aade8c6 commit 9482bb6
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions lib/pages/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,20 @@ class _MyHomePageState extends State<MyHomePage> {
style: TextStyle(fontWeight: FontWeight.bold),
),
actions: [
Padding(
padding: const EdgeInsets.only(right: 16, top:1),
child: IconButton(
icon: Icon(
_isDarkTheme ? Icons.dark_mode : Icons.light_mode,
),
onPressed: () {
setState(() {
_isDarkTheme = !_isDarkTheme;
});
final themeMode =
Theme.of(context).brightness == Brightness.dark
? AdaptiveThemeMode.light
: AdaptiveThemeMode.dark;
AdaptiveTheme.of(context).setThemeMode(themeMode);
},
IconButton(
icon: Icon(
_isDarkTheme ? Icons.dark_mode : Icons.light_mode,
),
onPressed: () {
setState(() {
_isDarkTheme = !_isDarkTheme;
});
final themeMode =
Theme.of(context).brightness == Brightness.dark
? AdaptiveThemeMode.light
: AdaptiveThemeMode.dark;
AdaptiveTheme.of(context).setThemeMode(themeMode);
},
),
],
),
Expand Down

0 comments on commit 9482bb6

Please sign in to comment.