2
votes

I need to detect, if an app is running on an iOS or Android emulator to skip an QR code scan method and just return a scanned code.

Q: How do I detect

  • on which device type - iOS or Android - an app is running and
  • if an app is running on an emulator?
1
Why not having a configuration that skips QRcode; and use that configuration on emulators ? - Rémi Rousselet
A little bit of searching could have provided you the answer: stackoverflow.com/questions/45300661/…. The package mentioned there provides a way to check whether you are running on a physical device - Ruud Kobes
@RuudKobes Sorry, did search. But failed to find a solution reasonably quick. - SteAp
@RémiRousselet I'd like to decide dynamically. Besides the emulator/real device question, I do need other details too. - SteAp

1 Answers

1
votes

Just found this plugin, which prints various details:

https://pub.dartlang.org/packages/device_info#-readme-tab-

Output on Android emulator [see last line]:

enter image description here