Flutter CupertinoTabBar and CupertinoNavigationBar not blurring as well as native tab bar blur when scrolling
Just an observation I’d like to share. I was using my native iOS photos app & I noticed when you scroll, the bottom bar blurs nicely, it’s noticeable but not abusive & it’s glossy & well balanced. It’s pleasant it feels very ios
When Flutter was early before Stable it had a good well balanced blur effect in the Cupertino bottom tab bar widgets and the top Navigation bar widgets for Cupertino but I have just realised they are kind of dimmed out now ....they are not as well balanced or glossy as the native iOS apps...
It would be nice if they could be as similar/close to the native implementation they seem almost white & the blur is barely noticeable...
I remember sometime back when I was starting out my Cupertino navigation bar was clearly blurry together with the Cupertino bottom bar when scrolling content so I changed the background to white for the top bar I have decided to revert to the old native iOS feel and removed the background color & just seen/realized how barely noticeable the blur effect has become..
Hi @Chimba123
Can you please provide your flutter doctor -v and a minimal complete reproducible code sample.
Thank you
@TahaTesser
flutter doctor -v
[✓] Flutter (Channel stable, v1.17.3, on Mac OS X 10.15.5 19F101, locale en-ZM)
• Flutter version 1.17.3 at /Users/apple/Desktop/flutter
• Framework revision b041144f83 (5 days ago), 2020-06-04 09:26:11 -0700
• Engine revision ee76268252
• Dart version 2.8.4
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/apple/Library/Android/sdk
• Platform android-29, build-tools 28.0.3
• Java binary at: /Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/bin/java
• Java version Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
• All Android licenses accepted.
[✓] 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 (not installed)
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
[✓] VS Code (version 1.45.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.11.0
[!] Connected device
! No devices available
! Doctor found issues in 2 categories.
@TahaTesser
code sample
Widget build(BuildContext context) {
return Scaffold(
body: CupertinoTabScaffold(
tabBar: CupertinoTabBar(
inactiveColor: CupertinoColors.black,
items: <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: GestureDetector(
onLongPress: (){
_platformSpecificCodeRun();
//_buildNavigator1();
},
child: Icon(
Icons.language,
size: 22.0,
),
),
),
BottomNavigationBarItem(
icon: Icon(
IconData(0xe900, fontFamily: 'user2'),
size: 19.5,
),
),
BottomNavigationBarItem(
icon: GestureDetector(
onLongPress: _buildNavigator2,
child: Icon(
Icons.camera_alt,
size: 24.0,
),
),
),
BottomNavigationBarItem(
icon: Badge(
badgeContent: Text(
'3',
style: TextStyle(color: Colors.white),
),
child: Icon(
IconData(0xe900, fontFamily: 'np_bellCircle1'),
size: 21.5,
),
),
),
BottomNavigationBarItem(
icon: GestureDetector(
onLongPress: _buildNavigator3,
child: Icon(
Icons.monetization_on,
size: 23.0,
),
),
)
],
),
tabBuilder: (BuildContext context, int index) {
return CupertinoTabView(
builder: (BuildContext context) {
var currentIndex = index;
switch (index) {
case 0:
return BlocProvider(
create: (context) => SocialsFeedBloc(
socialsRepository: widget.socialsRepository),
child: SocialsFeed(
currentIndex: currentIndex,
text:
"Flutter is Google’s mobile UI framework for crafting high-quality native interfaces on iOS and Android in record time. Flutter works with existing code, is used by developers and organizations around the world, and is free and open source"),
);
break;
case 1:
return ProfilePage(
markethubProfileRepository:widget.markethubProfileRepository,
socialsProfileRepository: widget.socialsProfileRepository,
videohubProfileRepository: widget.videohubProfileRepository,
);
break;
case 2:
return BlocProvider(
create: (context)=>VideohubFeedBloc(videoHubRepository: widget.videoHubRepository),
child: VideoPlayerScreen(currentIndex: currentIndex)
);
break;
case 3:
return Notifications();
break;
case 4:
return MarketHubFeed(
currentIndex: currentIndex,
);
break;
}
return null;
},
);
},
),
);
}
_buildNavigator1() => Navigator.of(context).push(CupertinoPageRoute<void>(
builder: (BuildContext context) => SocialsPosting()
));
_buildNavigator2() => Navigator.of(context).push(CupertinoPageRoute<void>(
builder: (BuildContext context) => VideoHubPosting()
));
_buildNavigator3() => Navigator.of(context).push(CupertinoPageRoute<void>(
builder: (BuildContext context) => MarketHubPosting()
));
}
Not as blurry as native BottomNavigationBar in Cupertino widget
Code Sample
import 'package:flutter/cupertino.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return CupertinoApp(
title: 'Cupertino App',
theme: CupertinoThemeData(brightness: Brightness.dark),
home: CupertinoTabScaffold(
tabBar: CupertinoTabBar(items: [
BottomNavigationBarItem(icon: Icon(CupertinoIcons.heart)),
BottomNavigationBarItem(icon: Icon(CupertinoIcons.heart)),
BottomNavigationBarItem(icon: Icon(CupertinoIcons.heart))
]),
tabBuilder: (BuildContext context, int index) {
return CupertinoTabView(
builder: (_) {
return SingleChildScrollView(
child: Column(
children: [
Image.network('https://i.imgur.com/QCNbOAo.png',
height: 200),
Image.network('https://i.imgur.com/QCNbOAo.png',
height: 200),
Image.network('https://i.imgur.com/QCNbOAo.png',
height: 200),
Image.network('https://i.imgur.com/QCNbOAo.png',
height: 200),
Image.network('https://i.imgur.com/QCNbOAo.png',
height: 200),
Image.network('https://i.imgur.com/QCNbOAo.png',
height: 200),
Image.network('https://i.imgur.com/QCNbOAo.png',
height: 200),
Image.network('https://i.imgur.com/QCNbOAo.png',
height: 200),
Image.network('https://i.imgur.com/QCNbOAo.png',
height: 200),
Image.network('https://i.imgur.com/QCNbOAo.png',
height: 200),
Image.network('https://i.imgur.com/QCNbOAo.png',
height: 200),
Image.network('https://i.imgur.com/QCNbOAo.png',
height: 200),
Image.network('https://i.imgur.com/QCNbOAo.png',
height: 200),
Image.network('https://i.imgur.com/QCNbOAo.png',
height: 200),
],
),
);
},
);
},
),
);
}
}
flutter doctor -v
[✓] Flutter (Channel dev, 1.19.0-5.0.pre, on Mac OS X 10.15.5 19F101, locale
en-GB)
• Flutter version 1.19.0-5.0.pre at /Users/tahatesser/Code/flutter_dev
• Framework revision c264b70ec3 (2 days ago), 2020-06-08 09:27:34 -0700
• Engine revision c7f9725521
• Dart version 2.9.0 (build 2.9.0-13.0.dev 87c5e3612b)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /Users/tahatesser/Code/sdk
• Platform android-29, build-tools 29.0.3
• ANDROID_HOME = /Users/tahatesser/Code/sdk
• 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.5)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.5, Build version 11E608c
• CocoaPods version 1.9.3
[✓] 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 46.0.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build
1.8.0_242-release-1644-b3-6222593)
[✓] VS Code (version 1.45.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.11.0
[✓] Connected device (4 available)
• iPhone 11 • 0EC80516-8F99-4A0C-89ED-2273579862F9 • ios •
com.apple.CoreSimulator.SimRuntime.iOS-13-5 (simulator)
• macOS • macOS • darwin-x64 • Mac
OS X 10.15.5 19F101
• Web Server • web-server • web-javascript •
Flutter Tools
• Chrome • chrome • web-javascript •
Google Chrome 83.0.4103.97
• No issues found!
flutter doctor -v
[✓] Flutter (Channel stable, 1.22.5, on macOS 11.1 20C69 darwin-x64, locale en-GB)
• Flutter version 1.22.5 at /Users/tahatesser/Code/flutter_stable
• Framework revision 7891006299 (6 weeks ago), 2020-12-10 11:54:40 -0800
• Engine revision ae90085a84
• Dart version 2.10.4
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Volumes/Extreme/SDK
• Platform android-30, build-tools 30.0.3
• ANDROID_HOME = /Volumes/Extreme/SDK
• 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-6915495)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 12.3)
• Xcode at /Volumes/Extreme/Xcode.app/Contents/Developer
• Xcode 12.3, Build version 12C33
• CocoaPods version 1.10.1
[!] Android Studio (version 4.1)
• Android Studio at /Applications/Android Studio.app/Contents
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
[✓] VS Code (version 1.52.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.18.1
[✓] Connected device (1 available)
• Taha’s iPad (mobile) • 00008020-000255113EE8402E • ios • iOS 14.3
! Device emulator-5554 is offline.
! Doctor found issues in 1 category.
[✓] Flutter (Channel master, 1.26.0-2.0.pre.402, on macOS 11.1 20C69 darwin-x64, locale en-GB)
• Flutter version 1.26.0-2.0.pre.402 at /Users/tahatesser/Code/flutter_master
• Framework revision 2a188eeca3 (33 hours ago), 2021-01-17 19:27:00 -0800
• Engine revision 609036f2bf
• Dart version 2.12.0 (build 2.12.0-236.0.dev)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Volumes/Extreme/SDK
• Platform android-30, build-tools 30.0.3
• ANDROID_HOME = /Volumes/Extreme/SDK
• 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-6915495)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Volumes/Extreme/Xcode.app/Contents/Developer
• Xcode 12.3, Build version 12C33
• CocoaPods version 1.10.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.1)
• 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 1.8.0_242-release-1644-b3-6915495)
[✓] VS Code (version 1.52.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.18.1
[✓] Connected device (4 available)
• Android SDK built for x86 (mobile) • emulator-5554 • android-x86 • Android 10 (API 29) (emulator)
• Taha’s iPad (mobile) • 00008020-000255113EE8402E • ios • iOS 14.3
• macOS (desktop) • macos • darwin-x64 • macOS 11.1 20C69 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 87.0.4280.141
• No issues found!
Hi @Chimba123, I verified the issue on stable 3.3 and master 3.7 and it seems to show the blur effect on the tab bar, I am unsure what was the reported behavior, Do you still see the bug now?
https://user-images.githubusercontent.com/31410839/206529110-75c4ccac-5284-4cf3-9059-eca09bc73028.mov
code sample
import 'package:flutter/cupertino.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return CupertinoApp(
title: 'Cupertino App',
theme: const CupertinoThemeData(brightness: Brightness.dark),
home: CupertinoTabScaffold(
tabBar: CupertinoTabBar(items: const [
BottomNavigationBarItem(icon: Icon(CupertinoIcons.heart)),
BottomNavigationBarItem(icon: Icon(CupertinoIcons.heart)),
BottomNavigationBarItem(icon: Icon(CupertinoIcons.heart))
]),
tabBuilder: (BuildContext context, int index) {
return CupertinoTabView(
builder: (_) {
return SingleChildScrollView(
child: Column(
children: [
for(var i = 0; i < 10; i++)
Image.network('https://i.imgur.com/QCNbOAo.png',
height: 200),
],
),
);
},
);
},
),
);
}
}
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!
Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. If you find this problem please file a new issue with the same description, what happens, logs and the output of 'flutter doctor -v'. All system setups can be slightly different so it's always better to open new issues and reference the related ones. Thanks for your contribution.
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 -v and a minimal reproduction of the issue.