cameraPermission static method

Future<StreamSubscription<void>> cameraPermission()

Requests the permission to use a camera and holds it until unsubscribed.

Implementation

static Future<StreamSubscription<void>> cameraPermission() async {
  try {
    await Permission.camera.request();
  } catch (_) {
    // No-op.
  }

  return (const Stream.empty()).listen((_) {});
}