diff --git a/lib/enums/post_visibility_level.dart b/lib/enums/post_visibility_level.dart index e122ac3..58f9d2c 100644 --- a/lib/enums/post_visibility_level.dart +++ b/lib/enums/post_visibility_level.dart @@ -1,5 +1,15 @@ +import 'package:flutter/material.dart'; + /// Post visibility level /// /// @author Pierre HUBERT enum PostVisibilityLevel { PUBLIC, FRIENDS, USER, GROUP_MEMBERS } + +/// Post visibility levels mapping with material icons +const PostVisibilityLevelsMapIcons = { + PostVisibilityLevel.USER: Icons.lock, + PostVisibilityLevel.FRIENDS: Icons.group, + PostVisibilityLevel.GROUP_MEMBERS: Icons.group, + PostVisibilityLevel.PUBLIC: Icons.public +}; diff --git a/lib/ui/tiles/post_tile.dart b/lib/ui/tiles/post_tile.dart index 2d8c7c8..80790ae 100644 --- a/lib/ui/tiles/post_tile.dart +++ b/lib/ui/tiles/post_tile.dart @@ -2,6 +2,7 @@ import 'dart:io'; import 'package:comunic/enums/likes_type.dart'; import 'package:comunic/enums/post_kind.dart'; +import 'package:comunic/enums/post_visibility_level.dart'; import 'package:comunic/helpers/comments_helper.dart'; import 'package:comunic/helpers/likes_helper.dart'; import 'package:comunic/helpers/posts_helper.dart'; @@ -97,6 +98,14 @@ class _PostTileState extends State { ), ), + PopupMenuButton( + child: Icon( + PostVisibilityLevelsMapIcons[widget.post.visibilityLevel], + color: Colors.grey, + ), + itemBuilder: (c) => [], + ), + PopupMenuButton<_PostActions>( itemBuilder: (c) => [ // Update post content