mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-11-25 22:39:22 +00:00
Can click on user account image for posts to open user page
This commit is contained in:
parent
f26e6139cd
commit
972cee0a18
@ -19,6 +19,7 @@ import 'package:comunic/ui/widgets/network_image_widget.dart';
|
||||
import 'package:comunic/utils/date_utils.dart';
|
||||
import 'package:comunic/utils/files_utils.dart';
|
||||
import 'package:comunic/utils/intl_utils.dart';
|
||||
import 'package:comunic/utils/navigation_utils.dart';
|
||||
import 'package:comunic/utils/post_utils.dart';
|
||||
import 'package:comunic/utils/ui_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@ -42,6 +43,7 @@ class PostTile extends StatefulWidget {
|
||||
final GroupsList groupsInfo;
|
||||
final void Function(Post) onDeletedPost;
|
||||
final bool showPostTarget;
|
||||
final bool userNamesClickable;
|
||||
|
||||
const PostTile({
|
||||
Key key,
|
||||
@ -50,11 +52,13 @@ class PostTile extends StatefulWidget {
|
||||
@required this.onDeletedPost,
|
||||
@required this.showPostTarget,
|
||||
@required this.groupsInfo,
|
||||
@required this.userNamesClickable,
|
||||
}) : assert(post != null),
|
||||
assert(usersInfo != null),
|
||||
assert(onDeletedPost != null),
|
||||
assert(showPostTarget != null),
|
||||
assert(groupsInfo != null),
|
||||
assert(userNamesClickable != null),
|
||||
super(key: key);
|
||||
|
||||
@override
|
||||
@ -100,7 +104,15 @@ class _PostTileState extends State<PostTile> {
|
||||
// User account image
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 8.0, left: 8.0),
|
||||
child: InkWell(
|
||||
child: AccountImageWidget(user: _user),
|
||||
onTap: widget.userNamesClickable
|
||||
? () => openUserPage(
|
||||
userID: _user.id,
|
||||
context: context,
|
||||
)
|
||||
: null,
|
||||
),
|
||||
),
|
||||
|
||||
// Column with user name + post target
|
||||
|
@ -20,15 +20,18 @@ class PostsListWidget extends StatefulWidget {
|
||||
final Future<PostsList> Function() getPostsList;
|
||||
final bool showPostsTarget;
|
||||
final bool buildListView;
|
||||
final bool userNamesClickable;
|
||||
|
||||
const PostsListWidget({
|
||||
Key key,
|
||||
@required this.getPostsList,
|
||||
@required this.showPostsTarget,
|
||||
this.userNamesClickable = true,
|
||||
this.buildListView = true,
|
||||
}) : assert(getPostsList != null),
|
||||
assert(showPostsTarget != null),
|
||||
assert(buildListView != null),
|
||||
assert(userNamesClickable != null),
|
||||
super(key: key);
|
||||
|
||||
@override
|
||||
@ -106,6 +109,7 @@ class _PostsListWidgetState extends State<PostsListWidget> {
|
||||
groupsInfo: _groups,
|
||||
onDeletedPost: _removePost,
|
||||
showPostTarget: widget.showPostsTarget,
|
||||
userNamesClickable: widget.userNamesClickable,
|
||||
);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user