Repository navigation
CupertinoSliverNavigationBar: expanded state should have transparent background #60411
Copy link
Copy link
Closed
Closed
Copy link
Labels
found in release: 3.3Found to occur in 3.3Found to occur in 3.3found in release: 3.7Found to occur in 3.7Found to occur in 3.7frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: cupertino_uicupertino_ui package in flutter/packagescupertino_ui package in flutter/packagesteam-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team
Description
Steps to Reproduce
- Run
flutter create bug. - Create app with
CupertinoSliverNavigationBar
Expected results:
Per iOS 13's native apps, the expanded titles have a transparent background (black in dark mode).
Actual results:
Flutter's CupertinoSliverNavigationBar still uses the translucent blur background on the expanded title.
Logs
[✓] Flutter (Channel stable, v1.17.4, on Mac OS X 10.15.5 19F101, locale en-US)
• Flutter version 1.17.4 at /Users/chris/dev/flutter
• Framework revision 1ad9baa8b9 (9 days ago), 2020-06-17 14:41:16 -0700
• Engine revision ee76268252
• Dart version 2.8.4
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /Users/chris/Library/Android/sdk
• Platform android-29, build-tools 29.0.3
• Java binary at: /Users/chris/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/193.6514223/Android
Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.5, Build version 11E608c
• CocoaPods version 1.9.3
[✓] Android Studio (version 4.0)
• Android Studio at /Users/chris/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/193.6514223/Android Studio.app/Contents
• Flutter plugin version 46.0.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[!] IntelliJ IDEA Ultimate Edition (version 2020.1.2)
• IntelliJ at /Users/chris/Applications/JetBrains Toolbox/IntelliJ IDEA Ultimate.app
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
• For information about installing plugins, see
https://flutter.dev/intellij-setup/#installing-the-plugins
[✓] VS Code (version 1.46.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.12.0
[✓] Connected device (1 available)
• iPhone SE (2nd generation) • 4FA4B478-6343-403F-8F67-4CC377D4BF4B • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-5 (simulator)
! Doctor found issues in 2 categories.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
found in release: 3.3Found to occur in 3.3Found to occur in 3.3found in release: 3.7Found to occur in 3.7Found to occur in 3.7frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: cupertino_uicupertino_ui package in flutter/packagescupertino_ui package in flutter/packagesteam-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team
Type
Projects
- StatusShow more project fieldsEngineer reviewed
Activity
iapicca commentedon Jun 29, 2020
Hi @cpboyd
I can see the translucent effect in this code sample
(using a .5 opacity to make it easy to spot) with the latest master
cpboyd commentedon Jun 29, 2020
@iapicca Exactly. However, the translucent header should only be in the compact mode as seen in iOS 13 Podcasts (and other Apple apps):
Note how the background in the expanded state is fully black (no translucent effect), to match the list content:
The expanded header should probably have a different setting. I'd initially suggested transparent to match the underlying content.
cpboyd commentedon Jun 29, 2020
@iapicca Here's how to achieve the behavior I'm specifying:
cpboyd@8f71088
Although, perhaps since
Colors.transparentwill still trigger the blur effect, maybe it should be an opaque white or black depending on the theme.If opaque, it'd also need a configurable parameter in case people have their list color different from defaults.
Hixie commentedon Feb 28, 2022
@cpboyd did some initial work on this here: #61242
If anyone would like to continue that work that's probably a good place to start from. Please don't hesitate to reach out to us on the #hackers-new channel on Discord (see the contributing docs for details) if you would like help picking this up.
maheshj01 commentedon Dec 24, 2022
Reproduces on stable 3.3 and master 3.7
expanded
collapsed
code sample
flutter doctor -v (mac)
proxiti commentedon Aug 15, 2023
I found a temporary solution:
Define a SpecialColor
Use it like
The reason is that the CupertinoSliderNavigationBar will determine alpha==0xFF, and if it is true, there will be no blur effect attached.
If you want to achieve full transparency when expanding and semi transparency when collapsing, try the following code:
Use it like:
It should be noted that this is only a temporary solution, and a final and complete solution requires submission of a PR.
Cupertino transparent navigation bars (#149102)
Cupertino transparent navigation bars (flutter#149102)
victorsanni commentedon Aug 12, 2024
@veloce does #149102 fix this issue?
github-actions commentedon Sep 4, 2024
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.