Skip to content

Commit

Permalink
Merge pull request #101 from SuchitaSri18/feature-brightness-button
Browse files Browse the repository at this point in the history
Feature brightness button
  • Loading branch information
sapatevaibhav authored May 19, 2024
2 parents c3478fe + 22e3346 commit e2cce4b
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions lib/pages/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,23 @@ class _MyHomePageState extends State<MyHomePage> {
style: TextStyle(fontWeight: FontWeight.bold),
),
actions: [
IconButton(
icon: Icon(
_isDarkTheme ? Icons.dark_mode : Icons.light_mode,
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);
},
),
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 e2cce4b

Please sign in to comment.