1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-21 20:39:22 +00:00

Show post visibility levels

This commit is contained in:
Pierre HUBERT 2019-05-20 09:35:03 +02:00
parent 59c3e47419
commit 57cf1d5da1
2 changed files with 19 additions and 0 deletions

View File

@ -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
};

View File

@ -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<PostTile> {
),
),
PopupMenuButton(
child: Icon(
PostVisibilityLevelsMapIcons[widget.post.visibilityLevel],
color: Colors.grey,
),
itemBuilder: (c) => [],
),
PopupMenuButton<_PostActions>(
itemBuilder: (c) => [
// Update post content