clear textfield after submit

This commit is contained in:
Moe Poi ~ 2022-05-16 21:03:50 +07:00
parent 6393d1a053
commit 2d3de88fc6
2 changed files with 2 additions and 2 deletions

View file

@ -84,6 +84,7 @@ class _NewsletterState extends State<Newsletter> {
onPressed: () {
if (emailController.text.isNotEmpty) {
subscribe(emailController.text).then((status) {
emailController.clear();
if (status == 200) {
return showDialog(
context: context,
@ -112,8 +113,6 @@ class _NewsletterState extends State<Newsletter> {
);
}
);
} else {
}
});
}

View file

@ -58,6 +58,7 @@ class _SearchFormState extends State<SearchForm> {
MaterialPageRoute(
builder: (context) =>
SearchPage(query: searchController.text)));
searchController.clear();
},
child: const Text('Search'),
),