Fix subscribe

This commit is contained in:
Moe Poi ~ 2022-05-17 15:33:00 +07:00
parent cea5544c40
commit 20ea2c0222

View file

@ -83,8 +83,8 @@ class _NewsletterState extends State<Newsletter> {
)), )),
onPressed: () { onPressed: () {
if (emailController.text.isNotEmpty) { if (emailController.text.isNotEmpty) {
subscribe(emailController.text).then((status) { var emailQuery = emailController.text;
emailController.clear(); subscribe(emailQuery).then((status) {
if (status == 200) { if (status == 200) {
return showDialog( return showDialog(
context: context, context: context,
@ -114,6 +114,8 @@ class _NewsletterState extends State<Newsletter> {
} }
); );
} }
emailController.clear();
}); });
} }
}, },