Home > Mobile >  Where is the themeMode property in CupertinoApp
Where is the themeMode property in CupertinoApp

Time:04-05

In MaterialApp I can use themeMode to explicitly set the theme of the app.

themeMode: ThemeMode.dark,

I couldn't find a similar one in CupertinoApp.

CodePudding user response:

You can use brightness property in the CupertinoThemeData for it.

  @override
  Widget build(BuildContext context) {
    return const CupertinoApp(
      theme: CupertinoThemeData(
         brightness: Brightness.light,
      ),
      title: _title,
      home: MyStatefulWidget(),
    );
  }
  • Related