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

FluentUI incompatible with system_theme Theme #24

Closed
mytja opened this issue May 5, 2021 · 2 comments
Closed

FluentUI incompatible with system_theme Theme #24

mytja opened this issue May 5, 2021 · 2 comments
Labels
invalid This doesn't seem right

Comments

@mytja
Copy link

mytja commented May 5, 2021

When I use this code:

fluent.ThemeData(accentColor: SystemTheme.accentInstance.accent);

I get this error in VS Code:

The argument type 'Color' can't be assigned to the parameter type 'AccentColor?'.dart(argument_type_not_assignable)

Also, is there any possibility for usage like in Flutter Material UI, eg. like this:

material.ThemeData(brightness: material.Brightness.dark);

aka. using Brightness, and afterwards use it like this:

MaterialApp(theme: this.theme, darkTheme: this.darkTheme, themeMode: this.themeMode);

I know, that fluent_ui has themeMode argument, but it doesn't have theme and darkTheme args.

Is that possible?
Thanks

@bdlukaa
Copy link
Owner

bdlukaa commented May 5, 2021

On the fluent UI example app, here's how it's done:

AccentColor get systemAccentColor => AccentColor('normal', {
      'darkest': SystemTheme.accentInstance.darkest,
      'darker': SystemTheme.accentInstance.darker,
      'dark': SystemTheme.accentInstance.dark,
      'normal': SystemTheme.accentInstance.accent,
      'light': SystemTheme.accentInstance.light,
      'lighter': SystemTheme.accentInstance.lighter,
      'lightest': SystemTheme.accentInstance.lightest,
    });

I know, that fluent_ui has themeMode argument, but it doesn't have theme and darkTheme args.

It has both. Check the example app

@bdlukaa bdlukaa closed this as completed May 5, 2021
@bdlukaa bdlukaa added the invalid This doesn't seem right label May 5, 2021
@mytja
Copy link
Author

mytja commented May 6, 2021

Oh, thanks.
I have just picked the code from README in Accent color section.
However, thanks.

PS
I know you have Discord, but I think you also should enable Discussions.
They are pretty nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants