user15578649
user15578649

Reputation: 11

How to implement the following in flutter: When Hardware Key Pressed > Do Something; when Released > Stop Doing Something

I'm trying to create a Flutter note-taking app for myself which will enable me to record and organise my voice notes.

I want the functionality to be such:

I have researched various packages and implementations (such as the HardwareKeyboard class) that can be used but I am unable to find clarity with regards to how this specific functionality can be achieved.

I don't need a very detailed response, but I'd love it if someone could point me in the right direction/resources with regards to the following queries specifically:

  1. How to launch app and startFunction( ) when volume down is long pressed
  2. How to detect when the button is released and stopFunction( ).then(nextFunction( ))

Upvotes: 1

Views: 332

Answers (0)

Related Questions