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 all theme styles are respected #112

Closed
esskar opened this issue Jun 16, 2020 · 7 comments
Closed

Not all theme styles are respected #112

esskar opened this issue Jun 16, 2020 · 7 comments
Labels
bug Something isn't working

Comments

@esskar
Copy link
Contributor

esskar commented Jun 16, 2020

Hello,

first, kudos to this awesome library. it helps a lot.

I just noticed that not all theme styles are respected. I set the default font familiy to Calibri Light, but the value text is still set to .SF UI Text for Cupertino

image

@esskar
Copy link
Contributor Author

esskar commented Jun 16, 2020

ah, I am using flutter_platform_widgets and building a cupertino app for ios; so theme is not same as theme here

@codegrue
Copy link
Owner

Still the text theme should be honored. I assume this is a bug.

@codegrue codegrue added the bug Something isn't working label Jun 16, 2020
@codegrue
Copy link
Owner

Adding this to the ThemeData seems to work fine globally. Closing unless you are able to post code verifying the bug.

      return ThemeData(
        ...
        textTheme: GoogleFonts.paprikaTextTheme(),
        ...
      );

@esskar
Copy link
Contributor Author

esskar commented Jun 19, 2020

Its an issue with cupertino apps

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return CupertinoApp(
        title: 'Flutter Demo',
        theme: CupertinoThemeData(
          primaryColor: Colors.black,
          textTheme: CupertinoTextThemeData(textStyle: GoogleFonts.pacifico()),
        ),
        home: CupertinoPageScaffold(
          navigationBar: CupertinoNavigationBar(
            middle: Text("Hello World"),
          ),
          child: Form(
            child: CardSettings(
              children: [
                CardSettingsSection(
                  children: <Widget>[
                    CardSettingsText(
                      label: 'Title',
                      initialValue: "No title yet",
                    ),
                    CardSettingsSelectionPicker(
                      label: "Choose wisely",
                      options: ["Foo", "Bar"],
                      initialValue: "Foo",
                    )
                  ],
                )
              ],
            ),
          ),
        ));
  }
}

image

@esskar
Copy link
Contributor Author

esskar commented Jun 19, 2020

and the new example looks like that

image

@esskar
Copy link
Contributor Author

esskar commented Jun 19, 2020

but, i just found, that i can wrap my CupertinoApp in an Theme, like

Theme(
   data: materialThemeData,
   child: CupertinoApp(...)
)

this seems to work

@codegrue
Copy link
Owner

Either the global theme or a local theme (like your solution) should work. I verified the Cupertino controls honor the font so keeping closed. This is fixed in release 1.9.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants