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

Not sure how to apply theme extension with CupertinoApp #2

Closed
rikbrown opened this issue Jun 16, 2022 · 3 comments
Closed

Not sure how to apply theme extension with CupertinoApp #2

rikbrown opened this issue Jun 16, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@rikbrown
Copy link

Hi,

The example for customizing the theme seems to apply to Material but not to CupertinoApps:

ThemeData(
  ...,
  extensions: [
    PullDownButtonTheme(
      backgroundColor: Colors.grey,
      iconSize: 24,
      dividerColor: Colors.black,
    ),
  ],
),

This won't work for my CupertinoApp because it expects a CupertinoThemeData, which doesn't have an extensions property.

Am I being stupid, or is there a different way to handle this?

Cheers,
Rik.

@notDmDrl notDmDrl added the enhancement New feature or request label Jun 16, 2022
@notDmDrl
Copy link
Owner

Hi @rikbrown

CupertinoThemeData indeed does not have a way of defining extensions.

I have just published update that introduces PullDownButtonInheritedTheme as a additional way of defining global PullDownButtonTheme (ex. in CupertinoApp).

Consider this example:

CupertinoApp(
  builder: (context, child) => PullDownButtonInheritedTheme(
    data: const PullDownButtonTheme(
      backgroundColor: Colors.grey,
      iconSize: 24,
      dividerColor: Colors.black,
    ),
    child: child!,
  ),
  home: ...,
)

@rikbrown
Copy link
Author

Perfect, this looks exactly what I wanted. Thank you so much for that fast update! I'll try it shortly.

@rikbrown
Copy link
Author

Seems to work great from initial testing. Thank you again. I'll close this issue.

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

No branches or pull requests

2 participants