# livenessWidget method

Widget livenessWidget({

1. required dynamic onLiveness(
   1. dynamic
   ),
2. required dynamic onFps(
   1. dynamic
   ),
3. required double livenessThreshold,
4. required Widget customPermissionBuilder(
   1. dynamic
   ),
5. required Widget onLoadingWidget,
6. required Widget faceMaskOverlay,
7. required Stack builder(
   1. Widget,
   2. FlutterSmartfacePlatformCameraController
   ),

})

Creates a widget for liveness detection with various customizable parameters.

The widget is built using a platform view link and provides the following parameters:

- `onLiveness`: A required callback function that is triggered with liveness data.
- `onFps`: A required callback function that is triggered with FPS data.
- `livenessThreshold`: A required double value that sets the threshold for liveness detection.
- `customPermissionBuilder`: A required function that returns a widget for custom permission handling.
- `onLoadingWidget`: A required widget that is displayed while the liveness detection is loading.
- `faceMaskOverlay`: A required widget that serves as an overlay for the face mask.
- `builder`: A required function that returns a stack of widgets, including the camera controller.

Returns a widget configured for liveness detection.

## Implementation

    Widget livenessWidget({
      required Function(dynamic) onLiveness,
      required Function(dynamic) onFps,
      required double livenessThreshold,
      required Widget Function(dynamic) customPermissionBuilder,
      required Widget onLoadingWidget,
      required Widget faceMaskOverlay,
      required Stack Function(Widget, FlutterSmartfacePlatformCameraController) builder,
    }) {
      return platformViewLink(
        onLiveness: onLiveness,
        onFps: onFps,
        creationParams: {
          'livenessThreshold': livenessThreshold,
        },
        customPermissionBuilder: customPermissionBuilder,
        onLoadingWidget: onLoadingWidget,
        faceMaskOverlay: faceMaskOverlay,
        builder: builder,
        viewType: 'liveness_detect_view',
      );
    }