1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-25 14:29:22 +00:00

Add like button on group page

This commit is contained in:
Pierre HUBERT 2020-04-15 19:23:08 +02:00
parent dde909457d
commit f8a70faf28
3 changed files with 22 additions and 8 deletions

View File

@ -210,7 +210,7 @@ class GroupsHelper {
timeCreate: map["time_create"],
description: map["description"],
url: map["url"],
numberLikes: map["number_likes"],
isLiking: map["is_liking"],
likes: map["number_likes"],
userLike: map["is_liking"],
);
}

View File

@ -1,3 +1,5 @@
import 'package:comunic/enums/likes_type.dart';
import 'package:comunic/models/like_element.dart';
import 'package:flutter/material.dart';
import 'group.dart';
@ -6,12 +8,12 @@ import 'group.dart';
///
/// @author Pierre Hubert
class AdvancedGroupInfo extends Group {
class AdvancedGroupInfo extends Group implements LikeElement {
final int timeCreate;
final String description;
final String url;
final int numberLikes;
final bool isLiking;
int likes;
bool userLike;
AdvancedGroupInfo({
@required int id,
@ -27,8 +29,8 @@ class AdvancedGroupInfo extends Group {
@required this.timeCreate,
@required this.description,
@required this.url,
@required this.numberLikes,
@required this.isLiking,
@required this.likes,
@required this.userLike,
}) : super(
id: id,
name: name,
@ -40,4 +42,7 @@ class AdvancedGroupInfo extends Group {
postCreationLevel: postCreationLevel,
virtualDirectory: virtualDirectory,
following: following);
@override
LikesType likeType = LikesType.GROUP;
}

View File

@ -2,6 +2,7 @@ import 'package:comunic/models/advanced_group_info.dart';
import 'package:comunic/ui/widgets/group_following_widget.dart';
import 'package:comunic/ui/widgets/group_icon_widget.dart';
import 'package:comunic/ui/widgets/group_membership_widget.dart';
import 'package:comunic/ui/widgets/like_widget.dart';
import 'package:flutter/material.dart';
/// Authorized group page screen
@ -57,11 +58,19 @@ class _AuthorizedGroupPageScreenState extends State<AuthorizedGroupPageScreen> {
group: _group,
onUpdated: () => widget.needRefresh(),
),
Container(height: 10,),
Container(
height: 4,
),
GroupFollowingWidget(
group: _group,
onUpdated: () => widget.needRefresh(),
),
Container(
height: 2,
),
LikeWidget(
likeElement: _group,
)
],
)
],