forked from firka/student-legacy
prevent double taps on new weird exam popup
This commit is contained in:
parent
52c2f3090d
commit
320499a466
@ -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,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user