Title: Cupetino navigation bar middle title not showing
Tags: flutter
Question: Hello i am trying to give title to the app bar for cupertinonavigationbar middle widget but the text is not showing up.I tried to change the middle title text color still not showing up.What am i missing here?
```static buildAppBar(
      {bool isIOS,
      Function onPressedShoppingSearch,
      String heroTag,
      String middleTitle}) {
    return (isIOS == true)
        ? CupertinoNavigationBar(
            middle: (middleTitle != null)
                ? Text(
                    middleTitle,
                    style: TextStyle(color: Colors.grey, fontSize: 18),
                  )
                : Text(''),
            transitionBetweenRoutes: false,
            automaticallyImplyMiddle: true,
            automaticallyImplyLeading: true,
            heroTag: heroTag,
            backgroundColor: Colors.white,
            trailing: Row(
              mainAxisAlignment: MainAxisAlignment.end,
              children: [
                GestureDetector(
                  child: Icon(
                    FrinoIcons.f_search_classic,
                    color: Colors.red,
                    size: 23,
                  ),
                  onTap: onPressedShoppingSearch,
                ),
                const SizedBox(width: 6),
                const Icon(
                  FrinoIcons.f_cart,
                  color: Colors.red,
                  size: 23,
                ),
              ],
            ),

      )
```


Here is the accepted answer: I've just had a similar problem and found that the ```middle``` widget wasn't being displayed because my ```trailing``` widget was deemed (somehow) to be too large for that section of the navigation bar.
There are a few people that seem to be having similar issues due to ```leading``` and ```trailing``` widgets requiring a smaller size: https://github.com/flutter/flutter/issues/36689
Here's the code that I used in order to get it working (both old &amp; new).
ORIGINAL CODE (Which wasn't working):
```@override
Widget build(BuildContext context) {
  return CupertinoPageScaffold(
    navigationBar: CupertinoNavigationBar(
      leading: Container(),
      middle: Text(
        'Filters'.tr,
      ),
      trailing: _closeButton(),
    ),
    backgroundColor: Colors.white,
    child: SafeArea(
      child: Stack(
        children: [_closeButton()],
      ),
    ),
  );
}

Widget _closeButton() {
  return Align(
    alignment: Alignment.topRight,
    child: Padding(
      padding: EdgeInsets.fromLTRB(0, 0, 0, 0),
      child: Container(
        height: 32,
        width: 32,
        child: TextButton(
          onPressed: () =&gt; _closeView(),
          child: Image(
            color: Colors.black,
            image: AssetImage(SignalAsset.imagePath('icon_cross')),
          )),
      ),
    ),
  );
}
```
NEW CODE (Which works):
```@override
Widget build(BuildContext context) {
  return CupertinoPageScaffold(
    navigationBar: CupertinoNavigationBar(
      leading: Container(),
      middle: Text(
        'Filters'.tr,
      ),
      trailing: GestureDetector(
        child: Image(
          color: Colors.black,
          image: AssetImage(SignalAsset.imagePath('icon_cross')),
        ),
        onTap: () =&gt; _closeView(),
      ),
    ),
    backgroundColor: Colors.white,
    child: SafeArea(
      child: Stack(
        children: [_closeButton()],
      ),
    ),
  );
}
```



{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2020:00:06/22/20', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<flutter>', 'Title': 'Cupetino navigation bar middle title not showing', 'ViewCount': 342, 'id': 62520133, 'user_AboutMe': None, 'user_AccountId': 5916945.0, 'user_DisplayName': 'e.T55', 'user_Reputation': 381.0, 'user_Views': 109.0, 'user_id': 4655450.0}}