From 2677625b5461d8ed718e59d5bd805da4d6017250 Mon Sep 17 00:00:00 2001 From: juan Date: Thu, 8 May 2025 01:06:53 -0400 Subject: [PATCH] fixed issue that at rebuild it would go in a roulete of fetching emails every time --- lib/email.dart | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/email.dart b/lib/email.dart index 5a4c396..12b9b83 100644 --- a/lib/email.dart +++ b/lib/email.dart @@ -41,7 +41,7 @@ class EmailListScreen extends StatelessWidget { to: email.to.toString(), subject: email.subject, date: email.date.toString(), - id: email.id.toString(), + id: email.id.toString(), //i think this is thread id? ), ), ); @@ -77,6 +77,7 @@ class EmailPageState extends State { super.initState(); widget.page = page; isBackDisabled = true; + _fetchEmails(); } String getPage() => widget.page.toString(); @@ -91,7 +92,6 @@ class EmailPageState extends State { } // String getPage() => widget.page.toString(); - void updatePagenation(String option) { if (option == "next") { @@ -108,7 +108,7 @@ class EmailPageState extends State { currentPageNotifier.value = widget.page; if (widget.page == 1) { isBackDisabled = true; - print("back dis"); + print("back disabled"); } }); } @@ -118,7 +118,6 @@ class EmailPageState extends State { } void _fetchEmails() async { - // print(selectedFolder) try { List fetchedEmails = await apiService .fetchEmailsFromFolder(widget.selectedFolder, widget.offset); @@ -134,7 +133,6 @@ class EmailPageState extends State { @override Widget build(BuildContext context) { - _fetchEmails(); return Scaffold( body: EmailListScreen( emails: emails,