refactored the emailView

This commit is contained in:
Juan Marulanda De Los Rios 2025-05-18 20:52:40 -04:00
parent ceadc0b73d
commit 6feb357a39

View File

@ -5,7 +5,7 @@ import 'structs.dart';
class EmailListScreen extends StatelessWidget {
final List<GetThreadResponse> emails;
final Future<String> Function(List<String>, String) getEmailContent;
final Future<List<String>> Function(List<String>, String) getEmailContent;
final String folder;
EmailListScreen(
@ -29,11 +29,14 @@ class EmailListScreen extends StatelessWidget {
),
trailing: Text(email.date.toString()),
onTap: () async {
String emailContent =
List<String> emailContent = // list of the html
await getEmailContent(email.messages, folder);
List<String> emailIds = email.messages;
print(email.messages); //email ids of the thread
Navigator.push(
context,
MaterialPageRoute(
MaterialPageRoute( // could call collapsable and inside collable each calls email view?
builder: (context) => EmailView(
emailContent: emailContent,
from: email.from_address,
@ -42,6 +45,7 @@ class EmailListScreen extends StatelessWidget {
subject: email.subject,
date: email.date.toString(),
id: email.id.toString(), //i think this is thread id?
messages: email.messages,
),
),
);
@ -91,8 +95,6 @@ class EmailPageState extends State<EmailPage> {
_fetchEmails();
}
// String getPage() => widget.page.toString();
void updatePagenation(String option) {
if (option == "next") {
setState(() {