Skip to content

[Android] showCupertinoSheet change navigation theme on android #164134

@PrzemyslawPluszowy

Description

@PrzemyslawPluszowy

Steps to reproduce

When using showCupertinoSheet on Android, the bottom navigation bar's theme changes. To fix this in the implementation, follow these steps:

1️⃣ Locate line 232 (or search for this entry):

SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.light);
2️⃣ Modify it as follows to apply the style only on iOS:

if (Platform.isIOS) {
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.light);
}

Expected results

Don't change color

Actual results

on light theme nav bar change to black

Code sample

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

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      themeMode: ThemeMode.light,
      darkTheme: ThemeData.dark(),
      theme: ThemeData.light(),
      home: TestWidget(),
    );
  }
}

class TestWidget extends StatelessWidget {
  const TestWidget({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Flutter Demo')),
      body: Center(
        child: OutlinedButton(
          child: const Text('Show Cupertino Dialog'),
          onPressed: () {
            showCupertinoSheet(
              context: context,
              pageBuilder:
                  (context) => Scaffold(
                    body: Center(
                      child: CupertinoButton(
                        child: const Text('Close Dialog'),
                        onPressed: () {
                          Navigator.of(context).pop();
                        },
                      ),
                    ),
                  ),
            );
          },
        ),
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[Paste your output here]

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listf: cupertinoflutter/packages/flutter/cupertino repositoryfound in release: 3.29Found to occur in 3.29found in release: 3.30Found to occur in 3.30frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions