Please help i have a video recording app which starts with a tap and a timer is also started with the same tap and after another tap it stops and timer reset . I want to stop and reset timer when the timer reaches 15 second how to do this please help
GestureDetector(
onTap:
() async {
if (isRecoring) {
stop();
XFile videopath =
await _cameraController.stopVideoRecording();
setState(() {
isRecoring = false;
Navigator.push(
context,
MaterialPageRoute(
builder: (builder) => VideoViewPage(
path: videopath.path,
)));
}
);
} else {
startTime();
await _cameraController.startVideoRecording();
setState(() {
isRecoring = true;
// ignore: use_build_context_synchronously
});
}
},`
i tried adding logical or like this ` if (isRecoring || timer == '15') {stop} but didnt work. create a diffrent function with a if condition for stop even that didnt work