cameraAvailable static method

Future<bool> cameraAvailable()

Check if any camera's are available

Implementation

static Future<bool> cameraAvailable() async {
  final sources =
      await html.window.navigator.mediaDevices!.enumerateDevices();
  for (final e in sources) {
    // TODO:
    // ignore: avoid_dynamic_calls
    if (e.kind == 'videoinput') {
      return true;
    }
  }
  return false;
}