question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

themeMode with custom theme

See original GitHub issue

Hi!

I’m trying to use a different color for the arrow icon when the themeMode is set. When the themeMode is set to dark, I want to have a white icon; when it is set to light, I want to have black icon.

Here is the code I have but it doesn’t seem to be working correctly; the background changes nicely between white and black but the arrow icon always remains white.

Any help is appreciated since I’m struggling a bit to understand how this works.

Bram

Here is the piece of code I’m using:

//This is the theme where I make a distinction between dark and light in the control. 
const theme = deepMerge(grommet, 
  {
    global: { 
      colors: {
        brand: '#26547C',
        focus: 'transparent', // added focus color,
        control: {
          dark: "#ffffff",
          light: "#000000"
        }
      }
    },
    formField: {
      label: {
        size: 'small'
      }
    }
  });

//Here is where I embed the menu inside of a Grommet component
   <Grommet full={true} theme={theme} themeMode="dark">
      <Menu label={title.pageTitle || 'Page Title Placeholder'} items={[{ label: 'logout' }]} />
    </Grommet>

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

4reactions
brampurnotcommented, Oct 1, 2020

Thanks all for this amazing framework!

1reaction
brampurnotcommented, Oct 1, 2020

Woow awesome information and thank you for the quick reply. Now it makes more sense.

Bram

Read more comments on GitHub >

github_iconTop Results From Across the Web

Flutter Dynamic Theme: Dark Mode & Custom Themes - Medium
In MyApp class, assign your custom Dark and Light theme to 'darkTheme' and 'theme' attributes. Set 'themeMode' value as 'themeNotifier.getThemeMode()'.
Read more >
How to Setup a Custom Theme in Flutter for a Light ... - YouTube
In this tutorial, we will learn how to setup or create light and dark flutter theme and a custom theme in flutter 2022....
Read more >
App Theming in Flutter — Dark Mode/ Light Mode - ITNEXT
In this article, we will see how to Theme our apps in Flutter. ... a new file named “AppTheme.dart” and create two themes...
Read more >
How to use Theme in Flutter - Dark and Custom Theme
In flutter, we can easily create and customize themes. We can play with default themes, design custom swatches, or use our own created...
Read more >
Change Dynamically Theme In Flutter | by Shaiq khan
ThemeMode grants us the following states: Themes.light — We will create a new Themes() class and add ThemeData.light() with background color, button color, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found