Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

haptics? #343

Open
2x2xplz opened this issue Nov 12, 2023 · 0 comments
Open

haptics? #343

2x2xplz opened this issue Nov 12, 2023 · 0 comments

Comments

@2x2xplz
Copy link

2x2xplz commented Nov 12, 2023

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);
         },
      ),
   ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant