When I am used BottomNavigationBarItem
, I can’t showing my navigation icons.
I am trying this code:
import 'package:flutter/material.dart';
import 'package:task_manager/style/style.dart';
BottomNavigationBar AppBottomNav(currentIndex, OnItemTapped) {
return BottomNavigationBar(
items: const [
BottomNavigationBarItem(
icon: Icon(Icons.list_alt),
label: "New",
),
BottomNavigationBarItem(
icon: Icon(Icons.access_time_rounded),
label: "Progress",
),
BottomNavigationBarItem(
icon: Icon(Icons.check_circle_outlined),
label: "Completed",
),
BottomNavigationBarItem(
icon: Icon(Icons.cancel),
label: "Canceled",
),
],
selectedItemColor: colorGreen,
unselectedItemColor: colorLightGray,
currentIndex: currentIndex,
showSelectedLabels: true,
showUnselectedLabels: true,
onTap: OnItemTapped,
type: BottomNavigationBarType.shifting,
);
}
2
Answers
You need to set
uses-material-design: true
in pubspec.yamlLike Alejandro Cumpa said, you need to add
uses-material-design: true
in yourpubspec.yaml
.You need to add this to the bottom: