onTap method
Implementation
Future<void> onTap() async {
if(countbling>3){
await takePicture();
if (_faceDetectorService.faceDetected) {
// print("users1234567");
FaceData2? user = await _mlService.predict();
if(user?.facedata?.isEmpty ?? true){
var bottomSheetController = scaffoldKey.currentState!
.showBottomSheet((context) => signInSheet(user: user));
// bottomSheetController.closed.whenComplete(_reload);
bottomSheetController.closed.whenComplete(
_onBackPressed
);
}else {
Fluttertoast.showToast(msg: "User already register",
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.CENTER);
var json={
"msg":"User already register",
"image":"${_cameraService.imagePath}",
"name":_userTextEditingController.text
};
if (context.mounted) Navigator.of(context).pop(json);
// Navigator.of(context).pop(json);
// Navigator.of(context).pop("{'msg':'User already register','image':'${_cameraService.imagePath}','name':'${_userTextEditingController.text.trim()}'}");
// Navigator.of(context).pop("User already register");
// naviagteUser(context);
}
}
}else{
Fluttertoast.showToast(msg: "Blink you eyes ${4 - countbling} more time",
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.CENTER);
// print("leftEyeOpenProbability $countbling");
}
}