mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-01-15 12:48:41 +00:00
fix #218
This commit is contained in:
parent
1a1b02b92b
commit
d420f16520
1 changed files with 8 additions and 1 deletions
|
|
@ -13,9 +13,13 @@ class ContactUsView extends StatefulWidget {
|
||||||
|
|
||||||
class _ContactUsState extends State<ContactUsView> {
|
class _ContactUsState extends State<ContactUsView> {
|
||||||
final TextEditingController _controller = TextEditingController();
|
final TextEditingController _controller = TextEditingController();
|
||||||
|
bool isLoading = false;
|
||||||
|
|
||||||
Future<void> _submitFeedback() async {
|
Future<void> _submitFeedback() async {
|
||||||
final String feedback = _controller.text;
|
final String feedback = _controller.text;
|
||||||
|
setState(() {
|
||||||
|
isLoading = true;
|
||||||
|
});
|
||||||
|
|
||||||
if (feedback.isEmpty) {
|
if (feedback.isEmpty) {
|
||||||
// Show a message if the text field is empty
|
// Show a message if the text field is empty
|
||||||
|
|
@ -40,6 +44,9 @@ class _ContactUsState extends State<ContactUsView> {
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
if (!mounted) return;
|
if (!mounted) return;
|
||||||
|
setState(() {
|
||||||
|
isLoading = false;
|
||||||
|
});
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
// Handle successful response
|
// Handle successful response
|
||||||
|
|
@ -90,7 +97,7 @@ class _ContactUsState extends State<ContactUsView> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
ElevatedButton(
|
ElevatedButton(
|
||||||
onPressed: _submitFeedback,
|
onPressed: (isLoading) ? null : _submitFeedback,
|
||||||
child: Text('Submit'),
|
child: Text('Submit'),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue