prevent double taps on new weird exam popup

This commit is contained in:
Kima 2024-06-19 21:35:49 +02:00
parent 52c2f3090d
commit 320499a466

View File

@ -31,8 +31,18 @@ class ExamViewable extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (Provider.of<SettingsProvider>(context).newPopups) { if (Provider.of<SettingsProvider>(context).newPopups) {
bool pressed = false;
return GestureDetector( return GestureDetector(
onTap: () => ExamPopup.show(context: context, exam: exam), onTap: () {
// prevent double tap things
if (pressed) return;
pressed = true;
ExamPopup.show(context: context, exam: exam);
Future.delayed(const Duration(seconds: 2), () {
pressed = false;
});
},
child: ExamTile( child: ExamTile(
exam, exam,
showSubject: showSubject, showSubject: showSubject,