mirror of
https://gitlab.com/comunic/comunicmobile
synced 2025-06-19 16:25:17 +00:00
Add friend tab
This commit is contained in:
@ -1,4 +1,6 @@
|
||||
import 'package:comunic/models/advanced_user_info.dart';
|
||||
import 'package:comunic/ui/screens/friends_list_screen.dart';
|
||||
import 'package:comunic/ui/screens/other_friends_lists_screen.dart';
|
||||
import 'package:comunic/ui/screens/user_page_sections/user_page_header.dart';
|
||||
import 'package:comunic/ui/screens/user_page_sections/user_posts_section.dart';
|
||||
import 'package:comunic/utils/intl_utils.dart';
|
||||
@ -36,7 +38,21 @@ class _UserMobilePageState extends State<UserMobilePage>
|
||||
user: widget.userInfo,
|
||||
),
|
||||
),
|
||||
];
|
||||
|
||||
// User friends
|
||||
UserPageTab(
|
||||
label: tr("Friends"),
|
||||
onBuild: (c) => widget.userInfo.isCurrentUser
|
||||
? FriendsListScreen(
|
||||
showAppBar: false,
|
||||
)
|
||||
: OtherUserFriendsListScreen(
|
||||
userID: widget.userInfo.id,
|
||||
enableAppBar: false,
|
||||
),
|
||||
visible: widget.userInfo.isFriendsListPublic ||
|
||||
widget.userInfo.isCurrentUser),
|
||||
].where((element) => element.visible).toList();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@ -85,12 +101,15 @@ class _UserMobilePageState extends State<UserMobilePage>
|
||||
class UserPageTab {
|
||||
final String label;
|
||||
final WidgetBuilder onBuild;
|
||||
final bool visible;
|
||||
|
||||
UserPageTab({
|
||||
@required this.label,
|
||||
@required this.onBuild,
|
||||
this.visible = true,
|
||||
}) : assert(label != null),
|
||||
assert(onBuild != null);
|
||||
assert(onBuild != null),
|
||||
assert(visible != null);
|
||||
|
||||
Tab get tab => Tab(text: label);
|
||||
}
|
||||
|
Reference in New Issue
Block a user