From d462440e74357b9f83dded67bec9cb20b786b8d6 Mon Sep 17 00:00:00 2001 From: Bernhard Frenking Date: Sun, 4 Apr 2021 13:22:18 +0200 Subject: [PATCH 1/2] :bug: getter darkTheme always return darkTheme and added getter lightTheme --- PULL_REQUEST_TEMPLATE.md | 18 ++++++++---------- lib/src/adaptive_theme.dart | 5 ++++- lib/src/adaptive_theme_manager.dart | 7 +++++-- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md index a335680..5684b5c 100644 --- a/PULL_REQUEST_TEMPLATE.md +++ b/PULL_REQUEST_TEMPLATE.md @@ -7,25 +7,25 @@ ### Alternate Designs - + ### Why Should This Be In Core? - + ### Benefits - + ### Possible Drawbacks - + ### Verification Process @@ -33,14 +33,12 @@ We must be able to understand the design of your change from this description. I What process did you follow to verify that your change has the desired effects? -- How did you verify that all new functionality works as expected? -- How did you verify that all changed functionality works as expected? -- How did you verify that the change has not introduced any regressions? +- manual test with example -Describe the actions you performed (e.g., buttons you clicked, text you typed, commands you ran, etc.), and describe the results you observed. +manually compared the themes from getter lightTheme and darkTheme --> ### Applicable Issues - + diff --git a/lib/src/adaptive_theme.dart b/lib/src/adaptive_theme.dart index 9ffd2bf..8eae512 100644 --- a/lib/src/adaptive_theme.dart +++ b/lib/src/adaptive_theme.dart @@ -118,7 +118,10 @@ class _AdaptiveThemeState extends State ThemeData get theme => _preferences.mode.isDark ? _darkTheme : _theme; @override - ThemeData get darkTheme => _preferences.mode.isLight ? _theme : _darkTheme; + ThemeData get lightTheme => _theme; + + @override + ThemeData get darkTheme => _darkTheme; @override AdaptiveThemeMode get mode => _preferences.mode; diff --git a/lib/src/adaptive_theme_manager.dart b/lib/src/adaptive_theme_manager.dart index 96d89d4..6235b6a 100644 --- a/lib/src/adaptive_theme_manager.dart +++ b/lib/src/adaptive_theme_manager.dart @@ -20,10 +20,13 @@ part of adaptive_theme; /// from [AdaptiveTheme]. /// An instance of this can be retrieved by calling [AdaptiveTheme.of]. abstract class AdaptiveThemeManager { - /// provides current the light theme + /// provides current theme ThemeData get theme; - /// provides the dart theme + /// provides the light theme + ThemeData get lightTheme; + + /// provides the dark theme ThemeData get darkTheme; /// Returns current theme mode From 9e0cab7a135a3364dea6803df5616469093fc7f0 Mon Sep 17 00:00:00 2001 From: Bernhard Frenking Date: Mon, 5 Apr 2021 08:05:07 +0200 Subject: [PATCH 2/2] revert PULL_REQUEST_TEMPLATE.md --- PULL_REQUEST_TEMPLATE.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md index 5684b5c..a335680 100644 --- a/PULL_REQUEST_TEMPLATE.md +++ b/PULL_REQUEST_TEMPLATE.md @@ -7,25 +7,25 @@ ### Alternate Designs - + ### Why Should This Be In Core? - + ### Benefits - + ### Possible Drawbacks - + ### Verification Process @@ -33,12 +33,14 @@ adding an additional getter lightTheme and changing the getter darkTheme to alwa What process did you follow to verify that your change has the desired effects? -- manual test with example +- How did you verify that all new functionality works as expected? +- How did you verify that all changed functionality works as expected? +- How did you verify that the change has not introduced any regressions? -manually compared the themes from getter lightTheme and darkTheme +Describe the actions you performed (e.g., buttons you clicked, text you typed, commands you ran, etc.), and describe the results you observed. --> ### Applicable Issues - +