Skip to content

Overstretching SliverAppBar causes navigation bar color to reset #65626

@Zazo032

Description

@Zazo032

Steps to reproduce

Run the sample code provided and overscroll until the navigation bar turns black. Depending on screen size, you may need to keep your first finger always touching the screen and use a second finger to scroll. The color change is done when SliverAppBar size is ~50% of the screen.

Sample code

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

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

class SampleApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    SystemChrome.setSystemUIOverlayStyle(
      const SystemUiOverlayStyle(
        statusBarColor: Colors.transparent,
        statusBarIconBrightness: Brightness.dark,
        systemNavigationBarColor: Colors.white,
        systemNavigationBarIconBrightness: Brightness.dark,
      ),
    );
    return const MaterialApp(
      home: Scaffold(
        body: CustomScrollView(
          physics: BouncingScrollPhysics(),
          slivers: <Widget>[
            SliverAppBar(
              stretch: true,
            ),
            SliverFillRemaining(
              child: Placeholder(),
            ),
          ],
        ),
      ),
    );
  }
}

Expected results: After overscrolling, navigation bar is still white

Actual results: Navigation bar is set to black

This was tested and reproduced on:

  • Oneplus 5 running Android 10
  • Pixel 3 XL running Android 11
Logs
[ +231 ms] D/PhoneWindow( 7561): setNavigationBarColor: ffffffff
[+9886 ms] D/PhoneWindow( 7561): setNavigationBarColor: ff000000
Flutter 1.22.0-10.0.pre.137 • channel master • https://github.com/flutter/flutter.git
Framework • revision 37e2013774 (3 hours ago) • 2020-09-11 04:05:02 -0400
Engine • revision bdaac368f8
Tools • Dart 2.10.0 (build 2.10.0-115.0.dev)

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: layoutSystemChrome and Framework's Layout Issuesa: qualityA truly polished experiencef: material designflutter/packages/flutter/material repository.found in release: 1.22Found to occur in 1.22frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specifically

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions