Hi everyone,
Currently looking to prevent the same bottom sheet to open multiple times if the user spams with his finger the button. Right now, if he's fast enough and if the server's overloaded, the same bottom sheet can open a second, third time.
Hi everyone,
Currently looking to prevent the same bottom sheet to open multiple times if the user spams with his finger the button. Right now, if he's fast enough and if the server's overloaded, the same bottom sheet can open a second, third time.
I tried to implement this custom action generated by Claude and placed it at the very first of the action chain, but without success.
// Automatic FlutterFlow imports
import '/backend/backend.dart';
import '/backend/schema/structs/index.dart';
import '/backend/supabase/supabase.dart';
import '/actions/actions.dart' as action_blocks;
import '/flutter_flow/flutter_flow_theme.dart';
import '/flutter_flow/flutter_flow_util.dart';
import '/custom_code/actions/index.dart'; // Imports other custom actions
import '/flutter_flow/custom_functions.dart'; // Imports custom functions
import 'package:flutter/material.dart';
// Begin custom action code
// DO NOT REMOVE OR MODIFY THE CODE ABOVE!
import '/custom_code/actions/index.dart';
import '/flutter_flow/custom_functions.dart';
class BottomSheetSpamBlocker {
static bool _isOpening = false;
static bool get isOpening => _isOpening;
static set isOpening(bool value) => _isOpening = value;
}
Future preventSpamBottomSheet() async {
if (BottomSheetSpamBlocker.isOpening) {
return;
}
BottomSheetSpamBlocker.isOpening = true;
await Future.delayed(const Duration(milliseconds: 500), () {
BottomSheetSpamBlocker.isOpening = false;
});
}