# enrollWidget method

Widget enrollWidget({

1. required bool withGlasses,
2. required dynamic onPercentageChanged(
   1. dynamic
   ),
3. required dynamic onCountdownStarted(
   1. dynamic
   ),
4. required dynamic onPushing(
   1. dynamic
   ),
5. required dynamic onCompleted(
   1. dynamic
   ),
6. required dynamic onFailed(
   1. dynamic
   ),
7. required Widget customPermissionBuilder(
   1. dynamic
   ),
8. required Widget onLoadingWidget,
9. required Widget faceMaskOverlay,
10. required Stack builder(
    1. Widget,
    2. FlutterSmartfacePlatformCameraController
    ),

})

Creates a widget for enrolling with various callbacks and customizations.

This widget is used for the enrollment process, providing several callback functions to handle different stages and events during the process. It also allows customization of the permission request UI and loading widget.

Parameters:

- `withGlasses` (required): A boolean indicating whether the user is wearing glasses.
- `onPercentageChanged` (required): A callback function that is triggered when the enrollment percentage changes.
- `onCountdownStarted` (required): A callback function that is triggered when the countdown starts.
- `onPushing` (required): A callback function that is triggered when data is being pushed to the server.
- `onCompleted` (required): A callback function that is triggered when the enrollment process is completed.
- `onFailed` (required): A callback function that is triggered when the enrollment process fails.
- `customPermissionBuilder` (required): A function that returns a custom widget for the permission request UI.
- `onLoadingWidget` (required): A widget to display while the enrollment process is loading.
- `faceMaskOverlay` (required): A widget to overlay on the camera view during the enrollment process.
- `builder` (required): A function that returns a `Stack` widget, given a widget and a `FlutterSmartfacePlatformCameraController`.

Returns: A widget configured for the enrollment process.

## Implementation

    Widget enrollWidget({
      required bool withGlasses,
      required Function(dynamic) onPercentageChanged,
      required Function(dynamic) onCountdownStarted,
      required Function(dynamic) onPushing,
      required Function(dynamic) onCompleted,
      required Function(dynamic) onFailed,
      required Widget Function(dynamic) customPermissionBuilder,
      required Widget onLoadingWidget,
      required Widget faceMaskOverlay,
      required Stack Function(Widget, FlutterSmartfacePlatformCameraController) builder,
    }) {
      return platformViewLink(
        creationParams: {
          'withGlasses': withGlasses,
          'withoutServerPushing': false,
          'counter': 3,
        },
        onPercentageChanged: onPercentageChanged,
        onCountdownStarted: onCountdownStarted,
        onPushing: onPushing,
        onCompleted: onCompleted,
        onFailed: onFailed,
        customPermissionBuilder: customPermissionBuilder,
        onLoadingWidget: onLoadingWidget,
        faceMaskOverlay: faceMaskOverlay,
        builder: builder,
        viewType: 'enroll_finish_view',
      );
    }