Repository: flutter
Issue: [camera] setExposurePoint and setFocusPoint doesn't follow mirrored preview of the Frontal camera
Labels: p: camera,package,team-ecosystem,has reproducible steps,P2,found in release: 3.0,found in release: 3.1,triaged-ecosystem

## Steps to Reproduce

1. Execute `flutter run` on the iOS [camera/example](https://pub.dev/packages/camera/example) or copy code below.
2. Select the front camera (the image will be mirrored, which is normal behavior for a front camera).
3. Try to setExposurePoint(offset) or setFocusPoint(offset) by tapping on the preview.

**Expected results:**
I expect it to flip my offset according to the camera preview and focus/exposure according to the TapDownDetails.

**Actual results:**
It focuses on the opposite side of the X-axis because the preview is flipped and the offset is not.

**Quick Fix**
I was able to achieve the expected result with this simple function that flips the X-axis, but I still think this is an important issue to report.
<details>
<summary>An example of a workaround</summary>
I'm not sure how reliable this is, but it does the job for me on iOS.

```dart
    Offset flippableOffset() {
      ///If frontal camera is selected inverting offset X to match the camera preview which is mirrored for frontal camera.
      if (cameraController.description.lensDirection ==
          CameraLensDirection.front) {
        return Offset(
          1 - (details.localPosition.dx / constraints.maxWidth),
          details.localPosition.dy / constraints.maxHeight,
        );
      } else {
        return Offset(
          details.localPosition.dx / constraints.maxWidth,
          details.localPosition.dy / constraints.maxHeight,
        );
      }
    }

```
</details>

<details>
<summary>Code sample</summary>

```dart
import 'package:camera/camera.dart';
import 'package:flutter/material.dart';

//Don't forget to add this into ios/Runner/Info.plist:
//<key>NSCameraUsageDescription</key>
//<string>your usage description here</string>

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: MyHomePage(title: 'Frontal Camera'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key, required this.title}) : super(key: key);
  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  CameraController? controller;

  Widget _cameraPreviewWidget() {
    final CameraController? cameraController = controller;

    if (cameraController == null || !cameraController.value.isInitialized) {
      return const Center(
        child: Text('Tap on Floating Button'),
      );
    } else {
      return CameraPreview(controller!, child: LayoutBuilder(
        builder: (BuildContext context, BoxConstraints constraints) {
          return GestureDetector(
            behavior: HitTestBehavior.opaque,
            onTapDown: (TapDownDetails details) {
              _setFocusAndExposure(details, constraints);
            },
          );
        },
      ));
    }
  }

  _cameraPressed() async {
    final CameraController cameraController = CameraController(
      (await availableCameras()).firstWhere(
          (element) => element.lensDirection == CameraLensDirection.front),
      ResolutionPreset.medium,
      enableAudio: false,
      imageFormatGroup: ImageFormatGroup.jpeg,
    );

    controller = cameraController;

    cameraController.addListener(() {
      if (mounted) setState(() {});
    });

    await cameraController.initialize();
  }

  _setFocusAndExposure(TapDownDetails details, BoxConstraints constraints) {
    final Offset offset = Offset(
      details.localPosition.dx / constraints.maxWidth,
      details.localPosition.dy / constraints.maxHeight,
    );
    controller?.setExposurePoint(offset);
    controller?.setFocusPoint(offset);
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: _cameraPreviewWidget(),
      floatingActionButton: FloatingActionButton(
        onPressed: _cameraPressed,
        child: const Icon(Icons.camera),
      ),
    );
  }
}

```
</details>