From 20ea2c0222a0265cfa5d75da9058baa4477dfbe9 Mon Sep 17 00:00:00 2001 From: Moe Date: Tue, 17 May 2022 15:33:00 +0700 Subject: [PATCH] Fix subscribe --- lib/components/newsletter.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/components/newsletter.dart b/lib/components/newsletter.dart index fc85581..6c1d529 100644 --- a/lib/components/newsletter.dart +++ b/lib/components/newsletter.dart @@ -83,8 +83,8 @@ class _NewsletterState extends State { )), onPressed: () { if (emailController.text.isNotEmpty) { - subscribe(emailController.text).then((status) { - emailController.clear(); + var emailQuery = emailController.text; + subscribe(emailQuery).then((status) { if (status == 200) { return showDialog( context: context, @@ -114,6 +114,8 @@ class _NewsletterState extends State { } ); } + + emailController.clear(); }); } },