diff --git a/lib/helpers/groups_helper.dart b/lib/helpers/groups_helper.dart index 5404ac9..fdcbd0e 100644 --- a/lib/helpers/groups_helper.dart +++ b/lib/helpers/groups_helper.dart @@ -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"], ); } diff --git a/lib/models/advanced_group_info.dart b/lib/models/advanced_group_info.dart index 2db177d..0e8c6b3 100644 --- a/lib/models/advanced_group_info.dart +++ b/lib/models/advanced_group_info.dart @@ -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; } diff --git a/lib/ui/screens/authorized_group_page_screen.dart b/lib/ui/screens/authorized_group_page_screen.dart index 3f7acd1..3b1213d 100644 --- a/lib/ui/screens/authorized_group_page_screen.dart +++ b/lib/ui/screens/authorized_group_page_screen.dart @@ -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 { group: _group, onUpdated: () => widget.needRefresh(), ), - Container(height: 10,), + Container( + height: 4, + ), GroupFollowingWidget( group: _group, onUpdated: () => widget.needRefresh(), ), + Container( + height: 2, + ), + LikeWidget( + likeElement: _group, + ) ], ) ],