How to change the color of the back button in a CupertinoNavigationBar in Flutter

Issue

I would like to change the color of the back button in my flutter app.

Here is what I have at the moment: Screenshoot

I would like to change the color from light blu to white. I have searched online but found nothing. Here is my code (note my button is create automatically)

@override
  Widget build(BuildContext context) {
    return CupertinoPageScaffold(
      navigationBar: CupertinoNavigationBar(
        heroTag: 'menupage',
        transitionBetweenRoutes: false,
        middle: Text(
          'Menu Page',
          style: kSendButtonTextStyle,
        ),
      ),

Many thanks in advance !

Solution

I resolved with setting the CupertinoTextThemeData…

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return CupertinoApp(
      theme: CupertinoThemeData(
        primaryColor:
            Colors.white, //change color of the BOTTOM navbar icons when selected
        textTheme: CupertinoTextThemeData(
          primaryColor:
              Colors.white, //change color of the TOP navbar icon

Thanks Lucas for pointing me in the right direction

Answered By – M4trix Dev

Answer Checked By – Jay B. (FlutterFixes Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *