PersistentBottomNavBar
PersistentBottomNavBar copied to clipboard
haptics?
My PersistentTabView with 5 buttons has a PersistentTabController, 3 of the buttons change screens (defined in the screens: attribute), the other 2 raise modals. For the modal buttons, I can insert a haptic feedback instruction within the onPressed() block. However, the buttons which change the active screen (via the TabController) do not use onPressed()
Is there a way to insert haptic feedback when these buttons are pressed?
PersistentTabView(context,
controller: _controller,
screens: [ MyFirstScreen(), AnotherScreen(), ThirdScreen(), Container(), Container() ],
items: [
PersistentBottomNavBarItem(
... // no onPressed()
),
PersistentBottomNavBarItem(
... // no onPressed()
),
PersistentBottomNavBarItem(
... // no onPressed()
),
PersistentBottomNavBarItem(
...
onPressed: (BuildContext? _context) {
Gaimon.medium(); // haptics (Gaimon library)
showMyModal(context);
},
),
PersistentBottomNavBarItem(
...
onPressed: (BuildContext? _context) {
Gaimon.medium();
showAnotherModal(context);
},
),
]