Skip to content

A bug about statusbar‘s height in the multi window on Xiaomi phone #132831

Closed

Description

@AWarmHug

Is there an existing issue for this?

Steps to reproduce

on Xiaomi Phone

1.change from full screen to multi screen

Expected results

statusbar’s height is not 0

on Xiaomi phone,when app in multi window,the captionBar.top is not 0 and statusbar.top is 0,but FlutterView only used statusBar,this may cause bugs!

from full screen to multi screen
app in multi window

Actual results

statusbar’s height is 0,the line in statusbar shade appbar

Code sample

Code sample
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: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        useMaterial3: true,
        appBarTheme: const AppBarTheme(
          centerTitle: true
        )
      ),
      home: const MyHomePage(title: 'Flutter示例'),
    );
  }
}

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

  final String title;

  @override
  State<MyHomePage> 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>[
            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),
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration
device-2023-08-18-155512.mp4

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[!] Flutter (Channel stable, 3.10.6, on macOS 12.6.1 21G217 darwin-arm64, locale zh-Hans-CN)
    • Flutter version 3.10.6 on channel stable at /Users/bin_ren/.fvm/versions/3.10.6
    ! Warning: `dart` on your path resolves to /opt/homebrew/Cellar/dart/2.19.1/libexec/bin/dart, which is not inside your current Flutter SDK checkout at /Users/bin_ren/.fvm/versions/3.10.6. Consider adding /Users/bin_ren/.fvm/versions/3.10.6/bin to the front of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f468f3366c (5 weeks ago), 2023-07-12 15:19:05 -0700
    • Engine revision cdbeda788a
    • Dart version 3.0.6
    • DevTools version 2.23.1
    • Flutter download mirror https://storage.flutter-io.cn
    • 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.2)
    • Android SDK at /Users/bin_ren/Library/Android/sdk
    • Platform android-33, build-tools 33.0.2
    • ANDROID_HOME = /Users/bin_ren/Library/Android/sdk
    • Java binary at: /Applications/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.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14B47b
    • CocoaPods version 1.12.1

[✓] 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)

[✓] IntelliJ IDEA Community Edition (version 2022.3)
    • IntelliJ at /Applications/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

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

[✓] Connected device (3 available)
    • M2101K9C (mobile) • a0f0e393 • android-arm64  • Android 13 (API 33)
    • macOS (desktop)   • macos    • darwin-arm64   • macOS 12.6.1 21G217 darwin-arm64
    • Chrome (web)      • chrome   • web-javascript • Google Chrome 115.0.5790.170

Activity

  1. AWarmHug commented on Aug 18, 2023

    @AWarmHug
    Author

    image

  2. added
    in triagePresently being triaged by the triage team
    on Aug 21, 2023
  3. huycozy commented on Aug 21, 2023

    @huycozy
    Member

    Hi @AWarmHug
    I don't have a Xiaomi phone but a Realme one (Realme 6, Android 11). It displays as expected in Floating window mode:

    Demo

    I wonder if the multiple window mode on Xiaomi is similar to Floating window mode in Realme?

    Screenshot 2023-08-21 at 12 53 37

    Also, can you share the device info (OS, model)? And please confirm this on the latest Flutter master channel as well. Thanks!

  4. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Aug 21, 2023
  5. AWarmHug commented on Aug 21, 2023

    @AWarmHug
    Author

    Hi @AWarmHug I don't have a Xiaomi phone but a Realme one (Realme 6, Android 11). It displays as expected in Floating window mode:

    Demo
    I wonder if the multiple window mode on Xiaomi is similar to Floating window mode in Realme?

    Screenshot 2023-08-21 at 12 53 37

    Also, can you share the device info (OS, model)? And please confirm this on the latest Flutter master channel as well. Thanks!

    Yes!,is Floating window,I tested other phones and they all displayed as expected.

    device info:
    image

  6. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Aug 21, 2023
  7. huycozy commented on Aug 22, 2023

    @huycozy
    Member

    Thanks for the information. Unfortunately, I don't have such a device to check this. Labeling the issue as a device-specific issue.

  8. added
    platform-androidAndroid applications specifically
    frameworkflutter/packages/flutter repository. See also f: labels.
    engineflutter/engine related. See also e: labels.
    a: layoutSystemChrome and Framework's Layout Issues
    team-androidOwned by Android platform team
    and removed
    in triagePresently being triaged by the triage team
    on Aug 22, 2023
  9. 17 remaining items

  10. added
    ⏳Bot is counting down the days until it unassigns the issue
    on Aug 23, 2024
  11. flutter-triage-bot commented on Nov 8, 2024

    @flutter-triage-bot

    This issue was assigned to @yaakovschectman but has had no status updates in a long time. To remove any ambiguity about whether the issue is being worked on, the assignee was removed.

  12. removed
    ⏳Bot is counting down the days until it unassigns the issue
    on Nov 8, 2024
  13. added
    P1High-priority issues at the top of the work list
    triaged-androidTriaged by Android platform team
    and removed
    P2Important issues not at the top of the work list
    on Nov 12, 2024
  14. gmackall commented on Nov 12, 2024

    @gmackall
    Member

    From Android triage:
    go/android_insiders_25_notes

    We believe this would be fixed by changing from using
    https://developer.android.com/reference/android/view/WindowInsets.Type#statusBars()
    to using
    https://developer.android.com/reference/android/view/WindowInsets.Type#systemBars()

  15. added a commit that references this issue on Jan 15, 2025
    d832220
  16. added
    r: fixedIssue is closed as already fixed in a newer version
    on Jan 15, 2025
  17. added a commit that references this issue on Jan 15, 2025
    41e1400
  18. github-actions commented on Jan 29, 2025

    @github-actions

    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.

  19. locked as resolved and limited conversation to collaborators on Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work lista: layoutSystemChrome and Framework's Layout Issuese: device-specificOnly manifests on certain devicesengineflutter/engine related. See also e: labels.frameworkflutter/packages/flutter repository. See also f: labels.platform-androidAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer versionteam-androidOwned by Android platform teamtriaged-androidTriaged by Android platform team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions