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

refactor: theme checks accross application replaced with central Theme #402

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

SGI-CAPP-AT2
Copy link
Contributor

@SGI-CAPP-AT2 SGI-CAPP-AT2 commented Dec 16, 2024

Description

The theme was being managed by checks at each elements local scope to avoid those redundant checks This PR has refactored it with ThemeExtensions with ThemeData for dark theme and light theme
These color schemes can be accessed through Theme.of(context).extensions<TaskwarriorThemeColors>().

For future color related changes:
Custom Colors to be added inside TaskwarriorThemeColors class with common attribute for light and dark.
After doing such changes also add colors for corresponding attribute specific to Dark Theme and Light Theme inside TaskwarriorColors class.

Also fixed following problems:

  1. Search bar bg and color was having white n black color irrespective of theme
  2. Constant color scheme was not being used for DatePicker and TimePicker ( refer Date Picker appearing in white even in dark mode, when editing due date in edit task. #411 )
  3. Color of tags in filter drawer was BnW scheme irrespective of theme

Fixes #400

closes: #400
closes: #411

Currently Across application there are multiple theme checks being done for every widget build.
Replace issue_no with the issue number which is fixed in this PR

Screenshots

image
image

Checklist

  • Tests have been added or updated to cover the changes
  • Documentation has been updated to reflect the changes
  • Code follows the established coding style guidelines
  • All tests are passing

@SGI-CAPP-AT2
Copy link
Contributor Author

@BrawlerXull PR is ready to review, let me know if you find any flaw

@BrawlerXull
Copy link
Collaborator

Good one @SGI-CAPP-AT2 I'll test it locally and let you know

@BrawlerXull
Copy link
Collaborator

Yet there are many instances where old logic is used please refactor it too

@SGI-CAPP-AT2
Copy link
Contributor Author

SGI-CAPP-AT2 commented Dec 17, 2024

@BrawlerXull , Yes I think We'll need extension to ThemeDatas,
Let me do that changes.
Once done I'll mention you.
Thanks for pointing out

@SGI-CAPP-AT2 SGI-CAPP-AT2 force-pushed the theme-refactor branch 2 times, most recently from 6431d80 to a7efea0 Compare December 18, 2024 10:36
@SGI-CAPP-AT2
Copy link
Contributor Author

@BrawlerXull , Now you can review and test
I refactored all of the checks with ThemeExtensions.

@SGI-CAPP-AT2 SGI-CAPP-AT2 changed the title refactor: theme checks accross application replaced with Central Theme refactor: theme checks accross application replaced with central Theme Dec 18, 2024
@SGI-CAPP-AT2 SGI-CAPP-AT2 force-pushed the theme-refactor branch 3 times, most recently from 2f74612 to 50511f3 Compare December 19, 2024 09:51
@linuxcaffe
Copy link

Will this change also apply to the widget?? ( see #415 )

@SGI-CAPP-AT2
Copy link
Contributor Author

Hey @linuxcaffe ,
I think no.
Since widgets are handled with native framework we must find some workaround to apply themes on widget.

@Pavel401
Copy link
Member

@SGI-CAPP-AT2
Copy link
Contributor Author

@Pavel401 Thanks for sharing,
Let me try that as well

@SGI-CAPP-AT2
Copy link
Contributor Author

Update: Some of Unexpected changes are fixed now, This PR is ready to test and merge

@Pavel401
Copy link
Member

Screenshot 2024-12-27 at 10 34 11 PM Screenshot 2024-12-27 at 10 35 38 PM Screenshot 2024-12-27 at 10 36 42 PM > Screenshot 2024-12-27 at 10 40 37 PM
  1. **Update the button colors to align with the design specifications.
  2. Correct the onselect theme for the AM/PM indicator.
  3. Fix the snackbar appearing completely white in dark mode on the task details page.
  4. Perform thorough testing of all UI components in both dark and light modes to ensure consistency.**

@Pavel401
Copy link
Member

Screenshot 2024-12-27 at 10 47 49 PM Keep the old floating button theme

@SGI-CAPP-AT2
Copy link
Contributor Author

Hey thanks for testing,
I will fix all issues and will check If there are any areas where issues exists.

@Pavel401
Copy link
Member

@SGI-CAPP-AT2 Can you also fix the calendar theme in the task details page , right now in the dark mode it shows the light theme of the calendar.

@SGI-CAPP-AT2
Copy link
Contributor Author

@SGI-CAPP-AT2 Can you also fix the calendar theme in the task details page , right now in the dark mode it shows the light theme of the calendar.

Oh I was using same color scheme for all of the pickers, so I thought it's fixed

Let me do that as well

Fixes:
1. TimePicker themeData
2. Floating action button theme and animation
3. profile page elevated buttons
@SGI-CAPP-AT2
Copy link
Contributor Author

SGI-CAPP-AT2 commented Jan 2, 2025

update: fixes made as per #402 (comment)
also tested all use cases of application known to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
4 participants