From fbf1c3b39d3f3b3e51962ee58887764c8014ff5e Mon Sep 17 00:00:00 2001 From: Garrit Franke Date: Mon, 15 Feb 2021 12:55:02 +0100 Subject: [PATCH] feat: dismissable items --- lib/views/unread_view.dart | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/views/unread_view.dart b/lib/views/unread_view.dart index cda6aaf..55f6bbc 100644 --- a/lib/views/unread_view.dart +++ b/lib/views/unread_view.dart @@ -69,14 +69,22 @@ class _UnreadViewState extends State { key: UniqueKey(), itemBuilder: (BuildContext context, int index) { FeedEntry entry = unreadPosts[index]; - return InkWell( + return Dismissible( + key: UniqueKey(), + direction: DismissDirection.horizontal, + onDismissed: (direction) { + setState(() { + unreadPosts.removeAt(index); + }); + MinifluxApi.instance.markAsRead(entry.id); + }, child: Card( child: ListTile( key: UniqueKey(), title: Text(entry.title), + onTap: () => _readArticle(entry), ), ), - onTap: () => _readArticle(entry), ); }, ), -- 2.45.2