Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#38 Implement a dark mode #241

Merged
merged 14 commits into from
Oct 20, 2023
Merged

#38 Implement a dark mode #241

merged 14 commits into from
Oct 20, 2023

Conversation

apomalyn
Copy link
Contributor

@apomalyn apomalyn commented Oct 3, 2023

📜 Description

  • Implement a dark theme
  • Introduce the ThemeMode system to determine which theme to use

Closes #38

Light mode (no changes) Screenshot 2023-10-03 at 10 36 52 AM
Dark mode 🌙 Screenshot 2023-10-03 at 10 53 06 AM

💡 Motivation and Context

The package is currently stuck to light mode by default and needs the developers to implement their own dark mode which will not be perfect (the control panel will stay light). This PR fixes it!

By default, a dark mode will be provided and the developers can customize it and also control the [ThemeMode]!

💚 How did you test it?

Added some golden tests to check the dark mode

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • I updated the docs if needed
  • All tests passing
  • No breaking changes

🔮 Next steps

@apomalyn apomalyn requested a review from ueman as a code owner October 3, 2023 14:56
@ueman
Copy link
Owner

ueman commented Oct 3, 2023

Thanks! This is awesome! I'll try to give a review tomorrow.

@apomalyn
Copy link
Contributor Author

apomalyn commented Oct 3, 2023

I updated my branch to get the latest changes, the workflow should pass now 😄

@codecov
Copy link

codecov bot commented Oct 3, 2023

Codecov Report

Attention: 16 lines in your changes are missing coverage. Please review.

Comparison is base (1fa9054) 85.87% compared to head (63cd12d) 84.10%.
Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #241      +/-   ##
==========================================
- Coverage   85.87%   84.10%   -1.78%     
==========================================
  Files          20       20              
  Lines         616      648      +32     
==========================================
+ Hits          529      545      +16     
- Misses         87      103      +16     
Files Coverage Δ
feedback/lib/src/better_feedback.dart 97.95% <100.00%> (+0.18%) ⬆️
feedback/lib/src/feedback_bottom_sheet.dart 82.25% <100.00%> (+0.29%) ⬆️
feedback/lib/src/feedback_controller.dart 100.00% <ø> (ø)
feedback/lib/src/l18n/localization.dart 91.66% <100.00%> (-0.65%) ⬇️
feedback/lib/src/theme/feedback_theme.dart 86.95% <100.00%> (+11.95%) ⬆️
feedback/lib/src/utilities/feedback_app.dart 90.47% <90.90%> (-9.53%) ⬇️
...ack/lib/src/utilities/media_query_from_window.dart 0.00% <0.00%> (-63.64%) ⬇️
feedback/lib/src/feedback_widget.dart 91.25% <82.27%> (+0.34%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@apomalyn
Copy link
Contributor Author

apomalyn commented Oct 3, 2023

👋 @ueman
I'm going to check this evening to improve the code coverage.
For the builds failing it seems like it's not related to my PR, but I can check to fix it if you want

Copy link
Owner

@ueman ueman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again. The current CI failures are indeed unrelated to this PR

feedback/lib/src/better_feedback.dart Outdated Show resolved Hide resolved
feedback/lib/src/better_feedback.dart Outdated Show resolved Hide resolved
feedback/lib/src/better_feedback.dart Outdated Show resolved Hide resolved
Comment on lines 141 to 143
colorScheme: feedbackThemeData.brightness == Brightness.dark
? ColorScheme.dark(background: feedbackThemeData.background)
: ColorScheme.light(background: feedbackThemeData.background));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably go into the theme

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried a different approach for this one, let me hear your thoughts! 😄

feedback/lib/src/theme/feedback_theme.dart Outdated Show resolved Hide resolved
feedback/lib/src/theme/feedback_theme.dart Show resolved Hide resolved
feedback/lib/src/feedback_widget.dart Show resolved Hide resolved
@ueman
Copy link
Owner

ueman commented Oct 20, 2023

Hey, thanks again, this is a great improvement. Sorry for the delay 😓

@ueman ueman merged commit 0670a0c into ueman:master Oct 20, 2023
3 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a default darkmode theme
2 participants