-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
a: layoutSystemChrome and Framework's Layout IssuesSystemChrome and Framework's Layout Issuesc: regressionIt was better in the past than it is nowIt was better in the past than it is nowf: cupertinoflutter/packages/flutter/cupertino repositoryflutter/packages/flutter/cupertino repositoryfound 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 onr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionworkaround availableThere is a workaround available to overcome the issueThere is a workaround available to overcome the issue
Description
Steps to Reproduce
- Execute
flutter runon the code sample, Run CupertinoApp by default - System navigation bar cannot be displayed translucent
- Remove lines of CupertinoNavigationBar, stop run, Execute
flutter run - System navigation bar can be displayed translucent
- Change
runApp(const MyApp());torunApp(const MyApp2());, stop run, Executeflutter run, will be run MaterialApp - System navigation bar can be displayed translucent
| CupertinoApp | no navigationBar | MaterialApp |
|---|---|---|
![]() |
![]() |
![]() |
Expected results:
System navigation bar can be displayed translucent in CupertinoPageScaffold when CupertinoNavigationBar exists
Actual results:
When CupertinoPageScaffold exists CupertinoNavigationBar, the system navigation bar background color will become black and cannot be translucent. In Flutter 3.3, there is no such problem.
Code sample
main.dart
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
void main() {
SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(
systemNavigationBarColor: Colors.transparent,
systemNavigationBarDividerColor: Colors.transparent,
statusBarColor: Colors.transparent,
));
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return const CupertinoApp(
title: 'CupertinoApp Demo',
home: CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
middle: Text('CupertinoApp'),
),
child: ColorList(),
),
);
}
}
class MyApp2 extends StatelessWidget {
const MyApp2({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'MaterialApp Demo',
home: Scaffold(
appBar: AppBar(
title: const Text('MaterialApp'),
),
body: const ColorList(),
),
theme: ThemeData(
primarySwatch: Colors.blue,
useMaterial3: true,
));
}
}
class ColorList extends StatelessWidget {
const ColorList({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
// color: Colors.blue[100],
alignment: Alignment.center,
child: ListView(
children: [
for (var i = 0; i < 100; i++)
Container(
height: 50,
color: Colors.primaries[i % Colors.primaries.length],
child: Text('Item $i'),
),
],
),
);
}
}
MainActivity.kt
import io.flutter.embedding.android.FlutterActivity
import androidx.core.view.WindowCompat
import android.os.Bundle
class MainActivity: FlutterActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
WindowCompat.setDecorFitsSystemWindows(getWindow(), false)
super.onCreate(savedInstanceState)
}
}flutter doctor -v
[✓] Flutter (Channel stable, 3.7.0, on macOS 13.2 22D49 darwin-arm64, locale zh-Hans-CN)
• Flutter version 3.7.0 on channel stable at /Users/honjow/development/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision b06b8b2710 (3 天前), 2023-01-23 16:55:55 -0800
• Engine revision b24591ed32
• Dart version 2.19.0
• DevTools version 2.20.1
• Pub download mirror https://pub.flutter-io.cn
• Flutter download mirror https://storage.flutter-io.cn
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
• Android SDK at /Users/honjow/androidSdk
• Platform android-33, build-tools 33.0.1
• ANDROID_SDK_ROOT = /Users/honjow/androidSdk
• Java binary at: /Users/honjow/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/213.7172.25.2113.9123335/Android
Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14C18
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.3)
• 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.13+0-b1751.21-8125866)
[✓] Android Studio (version 2021.3)
• Android Studio at /Users/honjow/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/213.7172.25.2113.9123335/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.13+0-b1751.21-8125866)
[✓] Android Studio (version 2021.3)
• Android Studio at /Users/honjow/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/213.7172.25.2113.9014738/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.13+0-b1751.21-8125866)
[✓] IntelliJ IDEA Ultimate Edition (version 2022.3.1)
• IntelliJ at /Users/honjow/Applications/JetBrains Toolbox/IntelliJ IDEA Ultimate.app
• Flutter plugin version 71.3.6
• Dart plugin version 223.8214.16
[✓] IntelliJ IDEA Community Edition (version 2022.3.1)
• IntelliJ at /Users/honjow/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/223.8214.52/IntelliJ IDEA CE.app
• 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
[✓] IntelliJ IDEA Community Edition (version 2022.3)
• IntelliJ at /Users/honjow/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/223.7571.182/IntelliJ IDEA CE.app
• 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
[✓] IntelliJ IDEA Ultimate Edition (version 2022.3.1)
• IntelliJ at /Users/honjow/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/223.8214.52/IntelliJ IDEA.app
• 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
[✓] VS Code (version 1.74.3)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.58.0
[✓] Connected device (3 available)
• sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64 • Android 13 (API 33) (emulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 13.2 22D49 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 109.0.5414.87
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
Aasiz and masewo
Metadata
Metadata
Assignees
Labels
a: layoutSystemChrome and Framework's Layout IssuesSystemChrome and Framework's Layout Issuesc: regressionIt was better in the past than it is nowIt was better in the past than it is nowf: cupertinoflutter/packages/flutter/cupertino repositoryflutter/packages/flutter/cupertino repositoryfound 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 onr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionworkaround availableThere is a workaround available to overcome the issueThere is a workaround available to overcome the issue
Type
Projects
Status
Done (PR merged)


