0

I'm sorry for such a generic question, but I don't know where to start:

How do I handle physical button event in Flutter/Dart?

(on a device with custom button for example)

Can you point me to a tutorial or some documentation, please.

Thank you in advance for your help

Francesco

Francesco Iapicca
  • 2,618
  • 5
  • 40
  • 85
  • 1
    Check if it results in keyboard events https://stackoverflow.com/questions/54200938/external-keyboard-in-flutter-support/54201076#54201076 – Günter Zöchbauer Jan 17 '19 at 21:32
  • thanks for your answer Gunter, my tag was deceptive, I've checked your link, but I'm trying to listen to a custom button which should return an int, it's a sort of custom device. – Francesco Iapicca Jan 18 '19 at 11:37
  • It probably is still a keyboard event. Have you tried? – Günter Zöchbauer Jan 18 '19 at 13:33
  • I'm trying and you might be right Gunter, the problem is that it's an industrial scanner, it might be able to get the data from the scanner attached to the 'key' event... any help would be great – Francesco Iapicca Jan 25 '19 at 13:21
  • What have you tried? . . – Günter Zöchbauer Jan 25 '19 at 13:26
  • yeah, I read the 'key' being pushed and released... at least it's something found a paleolithic post https://www.sencha.com/forum/showthread.php?273258-Listen-to-keyboard-input-(Barcode-Scanner) that might have solve it, wish me good luck oh... wait, do you think the sensor package can do it? – Francesco Iapicca Jan 25 '19 at 13:31
  • I didn't use the sensor package yet, but if it is a keyboard the RawKeyboardListener should do what you need. If not you might need to modify the engine or perhaps building a custom plugin might allow implement that feature which would make it easier. – Günter Zöchbauer Jan 25 '19 at 13:38
  • sensor is my plan b, can you point me at some tutorial for the keyboard event? thanks in advance – Francesco Iapicca Jan 25 '19 at 13:41
  • I only tried it once with https://github.com/flutter/flutter/issues/22905#issuecomment-456019176 I don't have more information. – Günter Zöchbauer Jan 25 '19 at 13:47
  • I needed to go for another way... this is the new post https://stackoverflow.com/questions/54423831/receiving-data-from-a-scanner-kotlin-code-and-send-it-to-flutter-via-methodcha – Francesco Iapicca Jan 29 '19 at 15:01
  • You've mentioned that you've come up with a solution on the other [post](https://stackoverflow.com/questions/54423831/receiving-data-from-a-scanner-kotlin-code-and-send-it-to-flutter-via-methodcha). It would be helpful for the community if you can share it here. – MαπμQμαπkγVπ.0 Jun 19 '23 at 21:49

0 Answers0