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

fix: Question panel dark mode color #1249

Conversation

GowthamGoush
Copy link
Contributor

@GowthamGoush GowthamGoush commented Mar 17, 2022

What

  • Fixes question panel color for dark mode.

Impacted files

  • summary_card.dart

Screenshot

Before

After

Fixes bug

Part of

@GowthamGoush GowthamGoush requested a review from a team as a code owner March 17, 2022 17:13
@M123-dev
Copy link
Member

Actually @GowthamGoush, what does it look like in darkmode

@@ -464,7 +464,7 @@ class _SummaryCardState extends State<SummaryCard> {
},
child: SmoothCard(
margin: EdgeInsets.zero,
color: const Color(0xfff5f6fa),
color: Theme.of(context).primaryColor,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we rather use Theme.of(context).colorScheme.primary in the rest of the app, could you double-check that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, let me fix that

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using color scheme produces something like below:

If this color suits well, then definitely we can switch to Theme.of(context).colorScheme.primary

Copy link
Contributor

Choose a reason for hiding this comment

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

@GowthamGoush I have no opinion regarding colors, only about code: I don't like the possible confusion. If I have a look at the current code I only see colorScheme.primary and never Theme.of(context).primaryColor. So let's definitely use colorScheme.primary (and use its value if necessary).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I definitely agree with whatever you mentioned regarding the standards that we follow. I will fix that soon. Also, thanks for the kind suggestion and feedback.

Copy link
Contributor

Choose a reason for hiding this comment

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

@M123-dev Then please decide a correct primary color and a correct secondary color. That's what they're here for.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently, I have hardcoded these colors based on the brightness of the app but I would like to receive feedback from you regarding this and change it accordingly if needed.

I have attached the screenshots of the results for this:
Theme.of(context).colorScheme.brightness == Brightness.dark ? const Color(0xff212121) : const Color(0xfff5f6fa)

Light mode

Dark mode

Copy link
Member

Choose a reason for hiding this comment

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

@GowthamGoush I think the color looks much better this way, we have several hardcoded values for colors in the app, but it would still probably be better to make them somehow centralized

Copy link
Member

Choose a reason for hiding this comment

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

Looking at #1274, it looks like the color should be good by just removing the hardcoded value

Copy link
Member

Choose a reason for hiding this comment

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

@GowthamGoush
Copy link
Contributor Author

Actually @GowthamGoush, what does it look like in darkmode

Oops.. let me add a screenshot of that.

@teolemon teolemon added darkmode Ensuring we look good in the dark 🤖 Robotoff labels Mar 17, 2022
@M123-dev
Copy link
Member

M123-dev commented Mar 28, 2022

Fixed in #1323, still thanks for your effort @GowthamGoush

@M123-dev M123-dev closed this Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
darkmode Ensuring we look good in the dark 🤖 Robotoff
Development

Successfully merging this pull request may close these issues.

Question panel doesn't look good in dark mode
4 participants