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

Multiple issues with this plugin #50

Open
dancb10 opened this issue Feb 1, 2021 · 0 comments
Open

Multiple issues with this plugin #50

dancb10 opened this issue Feb 1, 2021 · 0 comments

Comments

@dancb10
Copy link

dancb10 commented Feb 1, 2021

Seems like there are some bugs with this plugin, as follows:
I'm trying to use it to for a two color theme in my app. The problem si that if you either change the primary or secondary color, the other is changed automatically. This is something that's not desired, each color must be changed regards of the other:

void changeColor() {
    DynamicTheme.of(context).setThemeData(
      new ThemeData(primaryColor: _mainColor, accentColor: _accentColor),
    );
  }

this is the way I change the colors. I load the settings upon reboot and the _mainColor and _accentColor are automatically populated when the app starts so in case you don't change a color, it will retain the old color value.
So the problem is that if you change the primaryColor, the plugin will automatically change the accentColor which it's a bug

      child: DynamicTheme(
        defaultBrightness: Brightness.light,
        data: (brightness) => new ThemeData(
          primaryColor: themeSettings != null
              ? Color(themeSettings.mainColor)
              : Colors.teal,
          accentColor: themeSettings != null
              ? Color(themeSettings.accentColor)
              : Colors.grey,
          brightness: brightness,
          fontFamily: 'Georgia',
          textTheme: TextTheme(
            headline1: TextStyle(
              fontSize: 20.0,
              fontWeight: FontWeight.normal,
            ),
            bodyText2: TextStyle(
              fontSize: 15.0,
              color: Colors.black,
            ),
            bodyText1: TextStyle(
              fontSize: 10.0,
              fontStyle: FontStyle.italic,
            ),
          ),
        ),

The second problem is that if you change either the primary or the secondary color, the AppBar text gets broken (the font is changed and increased in size). So these is the screen before I change the color:
Screen Shot 2021-02-01 at 11 59 52 AM

And after changing it (check out the AppBar text):
Screen Shot 2021-02-01 at 12 00 53 PM

If I close and reopen the screen, the font goes back to normal.
The AppBar takes the text font from the Dynamic Theme:

    appBar: AppBar(
        title: Text(
          'Theme',
          style: Theme.of(context).textTheme.headline1,
        ),

This is another bug with this plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant