moves the selected threads of folder
This commit is contained in:
parent
ab0adf62e4
commit
5dc749eaec
@ -91,6 +91,20 @@ class _EmailListScreenState extends State<EmailListScreen>
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool moveOfSelected(String destinyFolder) {
|
||||||
|
//this should be called from a widget
|
||||||
|
print("move of folder");
|
||||||
|
setState(() {
|
||||||
|
for (int email = 0; email < selectedEmails.length; email++) {
|
||||||
|
ApiService().moveEmail(
|
||||||
|
widget.folder, selectedEmails[email].id.toString(), destinyFolder);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Widget moveOfFolderWidget()
|
||||||
|
|
||||||
List<GetThreadResponse> listOfSelectedThreads() {
|
List<GetThreadResponse> listOfSelectedThreads() {
|
||||||
return selectedEmails;
|
return selectedEmails;
|
||||||
}
|
}
|
||||||
@ -153,7 +167,7 @@ class _EmailListScreenState extends State<EmailListScreen>
|
|||||||
IconButton(
|
IconButton(
|
||||||
icon: Icon(Icons.mark_email_read_outlined),
|
icon: Icon(Icons.mark_email_read_outlined),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
//mark email as read
|
// mark email as read
|
||||||
setState(() {
|
setState(() {
|
||||||
widget.emails[index].seen = true;
|
widget.emails[index].seen = true;
|
||||||
ApiService().markAsSeen(email.id);
|
ApiService().markAsSeen(email.id);
|
||||||
@ -163,7 +177,8 @@ class _EmailListScreenState extends State<EmailListScreen>
|
|||||||
IconButton(
|
IconButton(
|
||||||
icon: Icon(Icons.delete_outline),
|
icon: Icon(Icons.delete_outline),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
//delete email
|
// delete email
|
||||||
|
ApiService().deleteEmail(widget.folder, email.id);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -297,8 +312,13 @@ class EmailPageState extends State<EmailPage> {
|
|||||||
return selectionType;
|
return selectionType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool moveSelectedOfFolder(String folder) {
|
||||||
|
emailListKey.currentState?.moveOfSelected(folder);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
List<GetThreadResponse> getListOfSelected() {
|
List<GetThreadResponse> getListOfSelected() {
|
||||||
return emailListKey.currentState!.listOfSelectedThreads() ?? [];
|
return emailListKey.currentState!.listOfSelectedThreads();
|
||||||
}
|
}
|
||||||
// return [GetThreadResponse(id: 1, messages: [], subject: "subject", date: DateTime(2025), from_name: "from_name", from_address: "from_address", to: [], seen: false)];
|
// return [GetThreadResponse(id: 1, messages: [], subject: "subject", date: DateTime(2025), from_name: "from_name", from_address: "from_address", to: [], seen: false)];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user