Skip to content

Shifting BottomNavigationBarItems aren't showing up. #15280

Description

@pranjalsatija

Description

Shifting BottomNavigationBar widgets don't seem to be rendering properly:

tab bar

If you manually set the type to fixed, it looks the way it should. At first, I thought it was because I had too many items in the bar, but it also doesn't work with just two. I also tried setting the fixedColor property on the bar, and the backgroundColor properties on the items themselves, but it doesn't change the outcome. I'm not that experienced with Flutter (I've just been playing with it for the last few days), but I'd love to try submitting a PR to fix this if someone could help me out.

For reference, here's the code:

import 'package:flutter/material.dart';

void main() => runApp(new App());

class App extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'Tab Bar Test',
      theme: new ThemeData(primarySwatch: Colors.blue),
      home: new Scaffold(
        appBar: new AppBar(title: new Text('Flutter Issue')),
        bottomNavigationBar: new BottomNavigationBar(
          type: BottomNavigationBarType.fixed,
          items: [
            new BottomNavigationBarItem(
              icon: new Icon(Icons.favorite),
              title: new Text('FAVORITES')
            ),
            new BottomNavigationBarItem(
              icon: new Icon(Icons.people),
              title: new Text('CONTACTS')
            ),
            new BottomNavigationBarItem(
              icon: new Icon(Icons.phone),
              title: new Text('PHONE')
            ),
            new BottomNavigationBarItem(
              icon: new Icon(Icons.voicemail),
              title: new Text('VOICEMAIL')
            )
          ]
        ),
      )
    );
  }
}

Steps to Reproduce

  • Run the attached code on an iPhone running iOS 11.2.6.
  • Observe the incorrect appearance of the BottomNavigationBar.

Logs

flutter run:

Launching lib/main.dart on Pranjal's iPhone in debug mode...
Found saved certificate choice "***". To clear, use "flutter config".
Signing iOS app for device deployment using developer identity: "***"
Running Xcode clean...                                1.7s
Starting Xcode build...                                   
 ├─Building Dart code...                       7.1s
 ├─Assembling Flutter resources...             6.5s
 └─Compiling, linking and signing...           8.8s
Xcode build done                                     24.4s
Installing and launching...                          12.6s
Syncing files to device Pranjal's iPhone...           3.4s

🔥  To hot reload your app on the fly, press "r". To restart the app entirely, press "R".
An Observatory debugger and profiler on Pranjal's iPhone is available at: http://127.0.0.1:8101/
For a more detailed help message, press "h". To quit, press "q".

flutter analyze:

No issues found!
Ran in 5.6s

Flutter Doctor


[✓] Flutter (Channel beta, v0.1.5, on Mac OS X 10.13.3 17D102, locale en-US)
    • Flutter version 0.1.5 at /Users/pranjalsatija/flutter
    • Framework revision 3ea4d06340 (13 days ago), 2018-02-22 11:12:39 -0800
    • Engine revision ead227f118
    • Dart version 2.0.0-dev.28.0.flutter-0b4f01f759

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at /Users/pranjalsatija/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-27, build-tools 27.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)

[✓] iOS toolchain - develop for iOS devices (Xcode 9.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 9.2, Build version 9C40b
    • ios-deploy 1.9.2
    • CocoaPods version 1.3.1

[✓] Android Studio (version 3.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)

[✓] IntelliJ IDEA Ultimate Edition (version 2017.2.6)
    • Flutter plugin version 21.2.2
    • Dart plugin version 172.4343.25

[✓] Connected devices (1 available)
    • Pranjal's iPhone • XXX • ios • iOS 11.2.6

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions