takeFaceVideoOnDialog function
Future<XFile?>
takeFaceVideoOnDialog(
- BuildContext context, {
- Widget? scanWidget,
- CameraLensDirection? direction,
- ResolutionPreset? resolutionPreset,
- bool changeCamera = true,
Implementation
Future<XFile?> takeFaceVideoOnDialog(BuildContext context, {Widget? scanWidget,CameraLensDirection? direction,ResolutionPreset? resolutionPreset,bool changeCamera = true}){
return showDialog<XFile>(context: context, builder: (BuildContext context){
return Dialog(
insetPadding: EdgeInsets.zero,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20.0)), //this right here
child: SizedBox(
height: double.maxFinite,
width: double.maxFinite,
child: Camera(
cameraDirection: direction,
resolutionPreset: resolutionPreset,
filterBuilder: (context, controller) {
return Stack(
children: [
ScanFace(
changeCamera: changeCamera,
type: ScanFaceType.record,
onRecordStop: () async {
final result = await controller.stopVideoRecording();
if (context.mounted) {
Navigator.of(context).pop(result);
}
},
backTap: (){
Navigator.pop(context);
},
onRecord: () async {
await controller.startVideoRecording();
},
onChangeCamera: () {
final TakePictureState? state = context.findAncestorStateOfType<TakePictureState>();
if (state != null) {
state.changeCamera();
}
},
onFlash: (status) {
controller.setFlashMode(status);
},
onZoom: (zoomLevel) {
controller.setZoomLevel(zoomLevel);
},
),
if(scanWidget != null)
Padding(
padding: const EdgeInsets.only(bottom: 100.0),
child: scanWidget,
),
],
);
},
),
),
);
});
}