enrollWithoutServerPushingWidget method
Widget
enrollWithoutServerPushingWidget({
- required bool withGlasses,
- required dynamic onPercentageChanged(
- dynamic
- required dynamic onCountdownStarted(
- dynamic
- required dynamic onCompleted(),
- required dynamic onFailed(
- dynamic
- required Widget customPermissionBuilder(
- dynamic
- required Widget onLoadingWidget,
- required Widget faceMaskOverlay,
- required Stack builder(),
- SmartfaceCameraPosition? cameraPosition = SmartfaceCameraPosition.front,
Creates a widget for enrolling without server pushing.
This widget handles the enrollment process with various callbacks and customizations.
Parameters:
withGlasses
(required): A boolean indicating if the user is wearing glasses.onPercentageChanged
(required): A callback function that is triggered when the percentage changes.onCountdownStarted
(required): A callback function that is triggered when the countdown starts.onCompleted
(required): A callback function that is triggered when the enrollment is completed. It receives a map of string to dynamic values.onFailed
(required): A callback function that is triggered when the enrollment fails.customPermissionBuilder
(required): A function that returns a widget for custom permission handling.onLoadingWidget
(required): A widget to display while loading.faceMaskOverlay
(required): A widget to overlay on the face mask.builder
(required): A function that returns a stack of widgets and a camera controller.
Returns: A widget that handles the enrollment process.
Implementation
Widget enrollWithoutServerPushingWidget({
required bool withGlasses,
required Function(dynamic) onPercentageChanged,
required Function(dynamic) onCountdownStarted,
required Function(Map<String, dynamic>) onCompleted,
required Function(dynamic) onFailed,
required Widget Function(dynamic) customPermissionBuilder,
required Widget onLoadingWidget,
required Widget faceMaskOverlay,
required Stack Function(Widget, FlutterSmartfacePlatformCameraController)
builder,
SmartfaceCameraPosition? cameraPosition = SmartfaceCameraPosition.front,
}) {
return platformViewLink(
cameraPosition: cameraPosition,
creationParams: {
'withGlasses': withGlasses,
'withoutServerPushing': true,
'counter': 3,
},
onPercentageChanged: onPercentageChanged,
onCountdownStarted: onCountdownStarted,
onCompleted: (arguments) {
final Map<String, dynamic> args = jsonDecode(arguments);
onCompleted(args);
},
onFailed: onFailed,
customPermissionBuilder: customPermissionBuilder,
onLoadingWidget: onLoadingWidget,
faceMaskOverlay: faceMaskOverlay,
builder: builder,
viewType: 'enroll_finish_view',
);
}