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

Maintaining theme after close #26

Open
DanielSmith1239 opened this issue Sep 11, 2019 · 1 comment
Open

Maintaining theme after close #26

DanielSmith1239 opened this issue Sep 11, 2019 · 1 comment

Comments

@DanielSmith1239
Copy link

Hello,
I'm confused about how we're supposed to maintain the theme after the app is closed. Right now, here is my code for creating the app:

return DynamicTheme(
  defaultBrightness: Brightness.light,
  data: (brightness) => DynamicTheme.of(context)?.data ?? Themes.light.getThemeData(context),
  themedWidgetBuilder: (context, theme) {
    return MaterialApp(
      theme: theme,
      debugShowCheckedModeBanner: false,
      title: 'Is It Raining?',
      home: DataContainerView()
    );
  }
);

This doesn't seem to be working for me. DynamicTheme.of(context) always returns null.

@Norbert515
Copy link
Owner

Dynamic Theme only persists the brightness.

data: (brightness) => ...

contains the brightness which you can use. There you can construct your usual theme using that brightness.

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

2 participants