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

CupertinoBar color does not update with brightness, for dark mode. #51899

Open
NiwuoDev opened this issue Mar 3, 2020 · 22 comments
Open

CupertinoBar color does not update with brightness, for dark mode. #51899

NiwuoDev opened this issue Mar 3, 2020 · 22 comments
Labels
f: cupertino flutter/packages/flutter/cupertino repository found in release: 3.3 Found to occur in 3.3 found in release: 3.7 Found to occur in 3.7 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on team-design Owned by Design Languages team triaged-design Triaged by Design Languages team

Comments

@NiwuoDev
Copy link

NiwuoDev commented Mar 3, 2020

Steps to Reproduce

  1. Run flutter create bug.
  2. Update the main.dart as follows:
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        cupertinoOverrideTheme:
            const CupertinoThemeData(brightness: Brightness.dark),
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Flutter Demo Home'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);
  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: Text(widget.title),
        ),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              Text(
                'You have pushed the button this many times:',
              ),
              Text(
                '$_counter',
                style: Theme.of(context).textTheme.display1,
              ),
            ],
          ),
        ),
        floatingActionButton: FloatingActionButton(
          onPressed: _incrementCounter,
          tooltip: 'Increment',
          child: Icon(Icons.add),
        ),
        bottomNavigationBar: CupertinoTabBar(
          items: [
            BottomNavigationBarItem(
              icon: Icon(Icons.ac_unit),
              title: Text('AC'),
            ),
            BottomNavigationBarItem(
              icon: Icon(Icons.access_alarm),
              title: Text('Alarm'),
            ),
          ],
        )
        );
  }
}

Expected results:

If brightness is Light, the status bar icons should be black or viceversa. If brightness is Black, app bar should be black.

cupertinoOverrideTheme:
            const CupertinoThemeData(brightness: Brightness.dark), 

Actual results:
Only the CupertinoTabBar is updating if overriding, if not overriding but dark theme is on it works too but no the app bar.

image

Logs

Flutter Doctor

[✓] Flutter (Channel stable, v1.12.13+hotfix.8, on Mac OS X 10.15.3 19D76, locale en-CO)
    • Flutter version 1.12.13+hotfix.8 at /Users/nicolas.villamizar/flutter
    • Framework revision 0b8abb4724 (3 weeks ago), 2020-02-11 11:44:36 -0800
    • Engine revision e1e6ced81d
    • Dart version 2.7.0

 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /Users/nicolas.villamizar/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.3.1, Build version 11C504
    • CocoaPods version 1.8.4

[✓] Android Studio (version 3.6)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 43.0.2
    • Dart plugin version 192.7761
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)

[✓] VS Code (version 1.42.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.8.1

[✓] Connected device (1 available)
    • iPhone 11 • A27B9117-A941-4F9F-8177-60DEA19279F7 • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-3 (simulator)

• No issues found!
@NiwuoDev
Copy link
Author

NiwuoDev commented Mar 3, 2020

@LongCatIsLooong the issue is ok or need more info?

@LongCatIsLooong
Copy link
Contributor

Thanks for creating this issue. The "expected results" and "actual results" sections seem to be describing 2 different issues?

CupertinoTheme only affects Cupertino widgets. To change the color of a material widget (such is the case with AppBar) please refer to the material ThemeData class, and the ThemeMode parameter in MaterialApp.

@NiwuoDev
Copy link
Author

NiwuoDev commented Mar 4, 2020

*Edit

Why I have to set color black to change it?, it should change with brightness like the bottom bar does.
image

@NiwuoDev
Copy link
Author

NiwuoDev commented Mar 4, 2020

Even if I update the appbar to CupertinoNavigationBar inside MyHomePage like the image below, it doesn't update te color when ThemeMode.dark is set.

image

@LongCatIsLooong
Copy link
Contributor

Why I have to set color black to change it?, it should change with brightness like the bottom bar does.

If I remember it correctly MaterialApp doesn't come with a default dark theme. You need to give a dark theme, for instance ThemeData.dark().

Even if I update the appbar to CupertinoNavigationBar inside MyHomePage like the image below, it doesn't update the color when ThemeMode.dark is set.

It should. I'll give it a try when I get a chance. Could you also paste the code you used to produce the screenshot in #51899 (comment)?

@NiwuoDev
Copy link
Author

NiwuoDev commented Mar 4, 2020

Thanks for the response, this is the code I used

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      themeMode: ThemeMode.dark,
      darkTheme: ThemeData(
        cupertinoOverrideTheme: CupertinoThemeData(
          brightness: Brightness.dark,
        ),
        appBarTheme: AppBarTheme(
          // color: Colors.black,
          brightness: Brightness.dark,
        ),
      ),
      theme: ThemeData(
        appBarTheme: AppBarTheme(
          brightness: Brightness.dark,
        ),
      ),
      home: MyHomePage(title: 'Flutter Home'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: CupertinoNavigationBar(
        middle: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Text(
              'You have pushed the button this many times:',
            ),
            Text(
              '$_counter',
              style: Theme.of(context).textTheme.display1,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: Icon(Icons.add),
      ),
      bottomNavigationBar: CupertinoTabBar(
        items: [
          BottomNavigationBarItem(
            icon: Icon(Icons.ac_unit),
            title: Text('AC'),
          ),
          BottomNavigationBarItem(
            icon: Icon(Icons.access_alarm),
            title: Text('Alarm'),
          ),
        ],
      ),
    );
  }
}

@LongCatIsLooong
Copy link
Contributor

With the code above the entire app is supposed to be in light mode, as the dark theme specified is actually a light theme.

The tab bar is in dark mode color because barBackgroundColor is not overridden in MaterialBasedCupertinoThemeData. That's a bug. Thanks again for reporting this issue!

@LongCatIsLooong LongCatIsLooong self-assigned this Mar 4, 2020
@LongCatIsLooong LongCatIsLooong added f: cupertino flutter/packages/flutter/cupertino repository framework flutter/packages/flutter repository. See also f: labels. labels Mar 4, 2020
@NiwuoDev
Copy link
Author

NiwuoDev commented Mar 4, 2020

Ohh ok, but you say that with the above code the app is supposed to be in light mode, why ? I set everything to black. Could you show me how to set a real dark theme please

@NiwuoDev
Copy link
Author

NiwuoDev commented Mar 4, 2020

I have to override barBackgroundColor: Color(0xF01D1D1D), the app bar changes (IMG_1), but if it's commented looks white (IMG_2)

IMG_1:
image

IMG_2:
image

@LongCatIsLooong
Copy link
Contributor

An easy way to get a dark theme is ThemeData(brightness: Brightness.dark), like you did in the previous comment.

Yes barBackgroundColor is not working properly. It should be a relatively simple fix.

@TahaTesser TahaTesser added the has reproducible steps The issue has been confirmed reproducible and is ready to work on label Apr 1, 2020
@NiwuoDev
Copy link
Author

NiwuoDev commented Jun 3, 2020

Hi, any update?

@VladyslavBondarenko
Copy link

Persists with current master 1.21.0-6.0.pre.117

flutter doctor -v
[✓] Flutter (Channel master, 1.21.0-6.0.pre.117, on Mac OS X 10.15.6 19G73, locale en-GB)
    • Flutter version 1.21.0-6.0.pre.117 at /Users/nevercode/dev/flutter
    • Framework revision 7ec2d360bc (2 hours ago), 2020-07-29 23:25:38 -0700
    • Engine revision a9910e409c
    • Dart version 2.10.0 (build 2.10.0-1.0.dev 24c7666def)

 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /Users/nevercode/Library/Android/sdk
    • Platform android-29, build-tools 29.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.6)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.6, Build version 11E708
    • CocoaPods version 1.9.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 47.1.2
    • Dart plugin version 193.7361
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] VS Code (version 1.47.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.12.2

[✓] Connected device (6 available)
    • Redmi Note 7 (mobile)       • 6345c469                                 • android-arm64  • Android 9 (API 28)
    • Nevercode’s iPhone (mobile) • b668e524315069f3db3661ac11ff1f66afafebdb • ios            • iOS 13.6
    • iPhone 11 Pro Max (mobile)  • 55C8466B-5367-492B-8EFE-EC45D980571F     • ios            • com.apple.CoreSimulator.SimRuntime.iOS-13-6 (simulator)
    • macOS (desktop)             • macos                                    • darwin-x64     • Mac OS X 10.15.6 19G73
    • Web Server (web)            • web-server                               • web-javascript • Flutter Tools
    • Chrome (web)                • chrome                                   • web-javascript • Google Chrome 84.0.4147.105

• No issues found!

@VladyslavBondarenko VladyslavBondarenko added the found in release: 1.21 Found to occur in 1.21 label Jul 30, 2020
@matthew-carroll
Copy link
Contributor

@LongCatIsLooong I think this is a legitimate bug (as far as I can tell), and if it's real, then it's pretty glaring. I'm actually surprised that this issue isn't receiving more attention given how visible the issue is.

Here is a widget tree that attempts to make both Material and Cupertino themes dark all the time. Notice in the screenshot that the CupertinoNavigationBar is still rendered light.

// Inside MyApp
return MaterialApp(
      title: 'Theming',
      theme: ThemeData(
        brightness: Brightness.dark,
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
        cupertinoOverrideTheme: CupertinoThemeData(
          brightness: Brightness.dark,
        ),
      ),
      home: MyHomePage(),
    );

// Inside MyHomePage
return CupertinoPageScaffold(
      navigationBar: CupertinoNavigationBar(
        middle: Text('Cupertino Theme'),
      ),
      child: CupertinoTabScaffold(
        tabBuilder: (context, index) {
          return _buildContent();
        },
        tabBar: CupertinoTabBar(
          items: [
            BottomNavigationBarItem(
              icon: Icon(CupertinoIcons.home),
            ),
            BottomNavigationBarItem(
              icon: Icon(CupertinoIcons.conversation_bubble),
            ),
            BottomNavigationBarItem(
              icon: Icon(CupertinoIcons.settings),
            ),
          ],
        ),
      ),
    );

Screenshot:

Screen Shot 2020-10-20 at 7 10 11 PM

Maybe the issue is happening because I'm using a MaterialApp instead of a CupertinoApp? I'm not sure, I haven't tried the alternative. But even within a MaterialApp, Cupertino widgets should at least respect the cupertinoOverrideTheme, right?

Also, the CupertinoTabBar changes brightness when the Material ThemeData changes. In other words, the CupertinoTabBar doesn't even require explicit definition of the cupertinoOverrideTheme. Therefore, to stay consistent, if the Material ThemeData is dark, I think the CupertinoNavigationBar should also be dark.

CC @xster for iOS insights

Flutter version:
Flutter 1.22.0-10.0.pre.9 • channel master • [email protected]:flutter/flutter.git
Framework • revision 8fa5c55 (7 weeks ago) • 2020-08-30 19:05:20 -0700
Engine • revision 1e302a1
Tools • Dart 2.10.0 (build 2.10.0-76.0.dev)

@matthew-carroll
Copy link
Contributor

@LongCatIsLooong @xster It also looks like the CupertinoSegmentedControl also does not respect a dark theme, yet CupertinoSlidingSegmentedControl does respect a dark theme:

Screen Shot 2020-10-20 at 7 28 24 PM

@xster
Copy link
Member

xster commented Oct 23, 2020

umm, at a glance, I can't repro in the gallery on head.

Simulator Screen Shot - iPhone 11 - 2020-10-22 at 20 47 57

I'll try your example.

@LongCatIsLooong
Copy link
Contributor

@xster if I recall correctly in ThemeData there're different colors for the bottom navigation bar and the app bar. But CupertinoThemeData.barBackgroundColor is used for both the navigation bar and the bottom tab bar, so it's a bit hard to decide which bar color we should let the MaterialBasedCupertinoThemeData take as the default from its parent ThemeData: #51955 (comment).

@xster
Copy link
Member

xster commented Oct 23, 2020

ah right that's the issue.

I can reproduce with cupertino nav bar in MaterialApps (though MaterialBasedCupertinoThemeData like Weiyu was saying).

Though I still have the same question (perhaps a question for @willlarche) I had in the PR. Is there something in the Material color spec that more or less corresponds to the iOS's nav bar? We can't take Material's primaryColor since the iOS bar is more subdued. If we can't find any, perhaps we can just let it fallback to the Cupertino defaults for dark and light, or just flip the order here

CupertinoDynamicColor.resolve(widget.backgroundColor, context) ?? CupertinoTheme.of(context).barBackgroundColor;
. But it would be nice to find something matching in the material theme.

@matthew-carroll
Copy link
Contributor

@xster in the case of dark mode, wouldn't the top nav bar match the bottom tab bar? If so, can we use whatever color the cupertino tab bar at the bottom is using?

@LongCatIsLooong
Copy link
Contributor

There's a similar problem with CupertinoThemeData.textTheme (#71590). I'll make these values default to whatever the default is in CupertinoThemeData.

@cpboyd
Copy link

cpboyd commented Sep 17, 2021

@xster So after looking into this again...

The real issue here is that the default barBackgroundColor is never actually resolved... Just cast to a Color, which results in the light color always being used.

In order to fix this, every instance of CupertinoTheme.of(context).barBackgroundColor just needs to be wrapped like so:

CupertinoDynamicColor.resolve(CupertinoTheme.of(context).barBackgroundColor), context)

Another potential issue is there's no elevated values set for barBackgroundColor...
It seems that for iOS 15 pop-overs, the background always starts out transparent (same as the background) before turning translucent with the blur after scrolling a bit (which I've raised in another issue before).

Edit: Looking deeper, it seems like the Sliver nav bar already has a resolve within _LargeTitleNavigationBarSliverDelegate when passing to _wrapWithBackground... The CupertinoNavigationBar does not, and passes the backgroundColor directly to _wrapWithBackground which has no context and assumes that the color has already been resolved.

@maheshj01
Copy link
Member

The issue still persists on stable 3.3 and master 3.7, Here are two code samples with their respective outputs.
In code sample 1 CupertinoNavigationBar should be dark
In code sample 2 the Scaffold background is should be dark

code sample 1
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Theming',
      theme: ThemeData(
        brightness: Brightness.dark,
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
        cupertinoOverrideTheme: const CupertinoThemeData(
          brightness: Brightness.dark,
        ),
      ),
      home: const MyHomePage(title: 'HomePage' ,),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key, required this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    return  CupertinoPageScaffold(
      navigationBar: const CupertinoNavigationBar(
        middle: Text('Cupertino Theme'),
      ),
      child: CupertinoTabScaffold(
        tabBuilder: (context, index) {
          return Container();
        },
        tabBar: CupertinoTabBar(
          items: const [
            BottomNavigationBarItem(
              icon: Icon(CupertinoIcons.home),
            ),
            BottomNavigationBarItem(
              icon: Icon(CupertinoIcons.conversation_bubble),
            ),
            BottomNavigationBarItem(
              icon: Icon(CupertinoIcons.settings),
            ),
          ],
        ),
      ),
    );
  }
}
code sample 2
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      themeMode: ThemeMode.dark,
      darkTheme: ThemeData(
        cupertinoOverrideTheme: const CupertinoThemeData(
          brightness: Brightness.dark,
        ),
        appBarTheme: const AppBarTheme(
          // color: Colors.black,
          systemOverlayStyle: SystemUiOverlayStyle.light,
        ),
      ),
      theme: ThemeData(
        appBarTheme: const AppBarTheme(
          systemOverlayStyle: SystemUiOverlayStyle.light,
        ),
      ),
      home:  const MyHomePage(title: 'Flutter Home'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key, required this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: CupertinoNavigationBar(
        middle: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            const Text(
              'You have pushed the button this many times:',
            ),
            Text(
              '$_counter',
              style: Theme.of(context).textTheme.headlineMedium,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: const Icon(Icons.add),
      ),
      bottomNavigationBar: CupertinoTabBar(
        items: const [
          BottomNavigationBarItem(
            icon: Icon(Icons.ac_unit),
            label: 'AC',
          ),
          BottomNavigationBarItem(
            icon: Icon(Icons.access_alarm),
            label: 'Alarm',
          ),
        ],
      ),
    );
  }
}

output

Code sample 1 Code sample 2
Simulator Screen Shot - iPhone 12 Pro - 2022-12-20 at 18 19 37 simulator_screenshot_DFE6209B-7B6F-4483-85E7-02AB26E4E5B2
flutter doctor -v (mac)
[✓] Flutter (Channel master, 3.7.0-3.0.pre.33, on macOS 12.6 21G115 darwin-arm64, locale en-IN)
    • Flutter version 3.7.0-3.0.pre.33 on channel master 
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5201856805 (38 minutes ago), 2022-12-05 18:27:21 -0800
    • Engine revision a309d239c4
    • Dart version 2.19.0 (build 2.19.0-463.0.dev)
    • DevTools version 2.20.0
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly
      to perform update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc4)
    • Android SDK at /Users/mahesh/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0-rc4
    • ANDROID_HOME = /Users/mahesh/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.0.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14A400
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)

[✓] IntelliJ IDEA Community Edition (version 2021.2.1)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 61.2.4
    • Dart plugin version 212.5080.8

[✓] VS Code (version 1.70.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.55.20221129

[✓] Connected device (3 available)
    • iPhone 12 Pro (mobile) • 026D5789-9E78-4AD5-B1B2-3F8D4E7F65E4 • ios            •
      com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator)
    • macOS (desktop)        • macos                                • darwin-arm64   • macOS 12.6 21G115 darwin-arm64
    • Chrome (web)           • chrome                               • web-javascript • Google Chrome 108.0.5359.94

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!
[✓] Flutter (Channel stable, 3.3.9, on macOS 12.6 21G115 darwin-arm, locale en-IN)
    • Flutter version 3.3.9 on channel stable at /Users/mahesh/Development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision b8f7f1f986 (24 hours ago), 2022-11-23 06:43:51 +0900
    • Engine revision 8f2221fbef
    • Dart version 2.18.5
    • DevTools version 2.15.0

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc4)
    • Android SDK at /Users/mahesh/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0-rc4
    • ANDROID_HOME = /Users/mahesh/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.0.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14A400
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)

[✓] IntelliJ IDEA Community Edition (version 2021.2.1)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 61.2.4
    • Dart plugin version 212.5080.8

[✓] VS Code (version 1.70.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.53.20221101

[✓] Connected device (3 available)
    • iPhone 12 Pro (mobile) • 026D5789-9E78-4AD5-B1B2-3F8D4E7F65E4 • ios            •
      com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator)
    • macOS (desktop)        • macos                                • darwin-arm64   • macOS 12.6 21G115 darwin-arm
    • Chrome (web)           • chrome                               • web-javascript • Google Chrome 107.0.5304.110

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

@maheshj01 maheshj01 added found in release: 3.3 Found to occur in 3.3 and removed found in release: 1.21 Found to occur in 1.21 labels Dec 20, 2022
@tiger5226
Copy link

tiger5226 commented Feb 8, 2023

Temporary Solution for others in case they just want something until this is resolved. You can still use your standard theming. The theming is "fine"(air quotes for a reason), like @cpboyd mentioned in his edit, the problem is downstream resolution where it assumes its already been resolved when there is a bug and it has not been resolved.

For now you can override this on your CupertinoNavigationBar by setting the backgroundColor to:

CupertinoDynamicColor.resolve(CupertinoTheme.of(context).barBackgroundColor, context)

This way you can fully rely on theming.

If you are using Flutter Platform Widgets just use it like this:

PlatformScaffold(
          appBar: PlatformAppBar(
            cupertino: (context, platform) => CupertinoNavigationBarData(
                backgroundColor: CupertinoDynamicColor.resolve(CupertinoTheme.of(context).barBackgroundColor, context)),

Hopefully this helps others quickly work around the problem.

@LongCatIsLooong LongCatIsLooong removed their assignment Jun 30, 2023
@flutter-triage-bot flutter-triage-bot bot added multiteam-retriage-candidate team-design Owned by Design Languages team triaged-design Triaged by Design Languages team labels Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
f: cupertino flutter/packages/flutter/cupertino repository found in release: 3.3 Found to occur in 3.3 found in release: 3.7 Found to occur in 3.7 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on team-design Owned by Design Languages team triaged-design Triaged by Design Languages team
Projects
None yet
10 participants