~garritfra/FlutterFlux

fbf1c3b39d3f3b3e51962ee58887764c8014ff5e — Garrit Franke 3 years ago 493c89b
feat: dismissable items
1 files changed, 10 insertions(+), 2 deletions(-)

M lib/views/unread_view.dart
M lib/views/unread_view.dart => lib/views/unread_view.dart +10 -2
@@ 69,14 69,22 @@ class _UnreadViewState extends State<UnreadView> {
            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),
              );
            },
          ),