identifyWidget method
Widget
identifyWidget({
- required dynamic onIdentify(
- dynamic
- required Widget customPermissionBuilder(
- dynamic
- dynamic onFps(
- dynamic
- required Center onLoadingWidget,
- required Widget faceMaskOverlay,
- required Stack builder(),
- double? securityLevel,
- double? livenessThreshold,
- bool livenessEnabled = false,
- bool saveImage = false,
- bool keepIdentification = false,
- Duration identifyTimeout = const Duration(seconds: 5),
- SmartfaceCameraPosition? cameraPosition = SmartfaceCameraPosition.front,
- bool enableCheckImageQuality = false,
Creates a widget for identifying faces with various customization options.
The identifyWidget method returns a widget that integrates face identification functionality with customizable components.
Parameters:
onIdentify
: A required callback function that is triggered when a face is identified.customPermissionBuilder
: A required builder function that returns a widget for custom permission handling.onFps
: An optional callback function that is triggered with the current frames per second (FPS).onLoadingWidget
: A required widget that is displayed while the identification process is loading.faceMaskOverlay
: A required widget that overlays the face mask on the camera view.builder
: A required builder function that returns a stack widget containing the camera view and the controller.
Returns:
- A widget that integrates face identification with the provided customization options.
Implementation
Widget identifyWidget({
required Function(dynamic) onIdentify,
required Widget Function(dynamic) customPermissionBuilder,
Function(dynamic)? onFps,
required Center onLoadingWidget,
required Widget faceMaskOverlay,
required Stack Function(Widget, FlutterSmartfacePlatformCameraController)
builder,
double? securityLevel,
double? livenessThreshold,
bool livenessEnabled = false,
bool saveImage = false,
bool keepIdentification = false,
Duration identifyTimeout = const Duration(seconds: 5),
SmartfaceCameraPosition? cameraPosition = SmartfaceCameraPosition.front,
bool enableCheckImageQuality = false,
}) {
return platformViewLink(
cameraPosition: cameraPosition,
onFps: onFps,
onIdentify: onIdentify,
customPermissionBuilder: customPermissionBuilder,
onLoadingWidget: onLoadingWidget,
faceMaskOverlay: faceMaskOverlay,
builder: builder,
viewType: 'identify_view',
creationParams: {
'livenessEnabled': livenessEnabled,
'livenessThreshold': livenessThreshold,
'securityLevel': securityLevel,
'saveImage': saveImage,
'keepIdentification': keepIdentification,
'identifyTimeout': identifyTimeout.inMilliseconds,
'enableCheckImageQuality': enableCheckImageQuality,
},
);
}