1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2025-06-19 16:25:17 +00:00

Start to create group page tabs

This commit is contained in:
2021-03-16 18:27:02 +01:00
parent 0920a36cef
commit cc553e803d
3 changed files with 151 additions and 67 deletions

View File

@ -12,10 +12,16 @@ import 'package:flutter/material.dart';
class GroupFollowingWidget extends StatefulWidget {
final Group group;
final Function() onUpdated;
final Color inactiveColor;
final Color activeColor;
const GroupFollowingWidget(
{Key key, @required this.group, @required this.onUpdated})
: assert(group != null),
const GroupFollowingWidget({
Key key,
@required this.group,
@required this.onUpdated,
this.activeColor,
this.inactiveColor,
}) : assert(group != null),
assert(onUpdated != null),
super(key: key);
@ -31,9 +37,17 @@ class _GroupFollowingWidgetState extends SafeState<GroupFollowingWidget> {
if (!_group.isAtLeastMember) return Container();
return InkWell(
child: Text(
_group.following ? tr("Following") : tr("Follow"),
style: TextStyle(color: Colors.blue),
child: RichText(
text: TextSpan(children: [
WidgetSpan(
child: Icon(
Icons.notifications,
size: 16.0,
color: _group.following ? widget.activeColor : widget.inactiveColor,
)),
TextSpan(
text: " " + (_group.following ? tr("Following") : tr("Follow"))),
]),
),
onTap: () => _toggleFollowing(),
);

View File

@ -16,12 +16,16 @@ typedef UpdatedLikingCallBack = Function(int, bool);
class LikeWidget extends StatefulWidget {
final LikeElement likeElement;
final double buttonIconSize;
final Color activeColor;
final Color inativeColor;
const LikeWidget({
Key key,
@required this.likeElement,
this.buttonIconSize = 15.0,
}) : assert(likeElement != null),
const LikeWidget(
{Key key,
@required this.likeElement,
this.buttonIconSize = 15.0,
this.activeColor,
this.inativeColor})
: assert(likeElement != null),
super(key: key);
@override
@ -54,7 +58,9 @@ class _LikeWidgetState extends SafeState<LikeWidget> {
children: <Widget>[
Icon(
Icons.thumb_up,
color: elem.userLike ? Colors.blue : null,
color: elem.userLike
? (widget.activeColor ?? Colors.blue)
: widget.inativeColor,
size: widget.buttonIconSize,
),
SizedBox(