From d420f16520992140b7c782674085a10d951ef73a Mon Sep 17 00:00:00 2001 From: otsmr Date: Sat, 21 Jun 2025 18:40:03 +0200 Subject: [PATCH] fix #218 --- lib/src/views/settings/help/contact_us.view.dart | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/src/views/settings/help/contact_us.view.dart b/lib/src/views/settings/help/contact_us.view.dart index b6078a1..98eb1ff 100644 --- a/lib/src/views/settings/help/contact_us.view.dart +++ b/lib/src/views/settings/help/contact_us.view.dart @@ -13,9 +13,13 @@ class ContactUsView extends StatefulWidget { class _ContactUsState extends State { final TextEditingController _controller = TextEditingController(); + bool isLoading = false; Future _submitFeedback() async { final String feedback = _controller.text; + setState(() { + isLoading = true; + }); if (feedback.isEmpty) { // Show a message if the text field is empty @@ -40,6 +44,9 @@ class _ContactUsState extends State { }, ); if (!mounted) return; + setState(() { + isLoading = false; + }); if (response.statusCode == 200) { // Handle successful response @@ -90,7 +97,7 @@ class _ContactUsState extends State { ), ), ElevatedButton( - onPressed: _submitFeedback, + onPressed: (isLoading) ? null : _submitFeedback, child: Text('Submit'), ), ],