Skip to content

[Android] Avoid hidden navigation bar icons #105716

@camsim99

Description

@camsim99

On Android APIs 26-28, when the navigation bar is set to be transparent and the navigation bar icons brightness is set to dark, the icons become invisible. This cannot be avoided by setting the systemNavigationBarContrastEnforced since this is not available until API 29 (see documentation). See the following reproduction:

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

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      title: 'Disappearing NavBar Icons Example',
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return const Scaffold(
        body: AnnotatedRegion(
            value: SystemUiOverlayStyle(
              systemNavigationBarColor: Colors.transparent,
              systemNavigationBarContrastEnforced: true, //Has no effect API 26-28, allowing this issue
              systemNavigationBarIconBrightness: Brightness.light,
            ),
            child: Center(child: Text('Disappearing NavBar Icons Example'))
        )
    );
  }
}

Original issue: #90098.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: error messageError messages from the Flutter frameworka: qualityA truly polished experienceframeworkflutter/packages/flutter repository. See also f: labels.platform-androidAndroid applications specificallyteam-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