Flutter Cupertino Icon not displaying


I am new to Flutter and I am trying to create a navigation bar with two icons on the two sides of the bar. I am using Windows Android Studio and the android emulator there.

However, currently, only the trailing icon is displaying but not the leading icon. I am not sure why is this happening (is it because I am using an android emulator?). Would appreciate some help here. Thanks!

Edited: When the bar is collapsed, the leading icon does not show as well, even though it shares the same code as the trailing icon. I have tried googling around but it seems like it is not a common problem?

enter image description here

This is my code snippet:


class HomePage extends StatelessWidget {
  Widget build(BuildContext context) {
    return CupertinoPageScaffold(
      child: NestedScrollView(
        headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
          return <Widget>[
              headingTitle: 'Ambisense',
              leadingIcon: Icon(CupertinoIcons.bars),
              trailingIcon: Icon(CupertinoIcons.gear_alt_fill),
        body: Center(
          child: Text('Home Page'),


class Heading extends StatelessWidget with ObstructingPreferredSizeWidget {
  final String headingTitle;
  final Icon leadingIcon;
  final Icon trailingIcon;

    @required this.headingTitle,
    @required this.leadingIcon,
    @required this.trailingIcon

  Widget build(BuildContext context) {
    return CupertinoSliverNavigationBar(
      largeTitle: Text(headingTitle),
      leading: this.leadingIcon,
      trailing: this.trailingIcon,

  // TODO: implement preferredSize
  Size get preferredSize => throw UnimplementedError();

  bool shouldFullyObstruct(BuildContext context) {
    // TODO: implement shouldFullyObstruct
    throw UnimplementedError();


I suspect the problem is with using the android emulator since Cupertino is designed to work on ioS. I have tried using some other CupertinoIcons, some appear and some do not. However, a workaround to the problem is to use the Icon collection from the Material class instead of CupertinoIcons.

I was looking for a Menu Icon so IconData(0xf2fb, fontFamily: 'MaterialIcons') was used instead.

Answered By – sq125

Answer Checked By – Timothy Miller (FlutterFixes Admin)

Leave a Reply

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