PersistentBottomNavBarItem(
onPressed: _openRatingsLayer,
icon: Icon(
Icons.add,
color: Colors.white,
size: 35,
),
title: ("Add"),
activeColorPrimary: Colors.orange.shade800,
inactiveColorPrimary: Colors.grey,
),
void _openRatingsLayer() {
showModalBottomSheet(
elevation: 0,
backgroundColor: Colors.white,
isDismissible: true,
isScrollControlled: true,
context: context,
builder: (ctx) {
return Padding(
padding:
EdgeInsets.only(bottom: MediaQuery.of(ctx).viewInsets.bottom),
child: const DummyScreen(),
);
},
);
}
I’m expecting that when i click on the add navbar item, it shows me modalbottomsheet and not take me to a new screen… that’s why i tried to use the onPressed function of the persistentNavBarItem but it gave an error