From afeb8c4a7d40e60ec9d1115187e33d03c03a687d Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Wed, 17 Mar 2021 16:58:10 +0100 Subject: [PATCH] Improve group page --- lib/ui/screens/authorized_group_page_screen.dart | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/ui/screens/authorized_group_page_screen.dart b/lib/ui/screens/authorized_group_page_screen.dart index f000276..8329fef 100644 --- a/lib/ui/screens/authorized_group_page_screen.dart +++ b/lib/ui/screens/authorized_group_page_screen.dart @@ -50,19 +50,19 @@ class _AuthorizedGroupPageScreenState List<_GroupPageTab> get _tabs => [ // Posts list _GroupPageTab( - widget: GroupPostsSection(group: _group), + widget: (c) => GroupPostsSection(group: _group), label: tr("Posts"), ), // About the group _GroupPageTab( - widget: AboutGroupSection(group: _group), + widget: (c) => AboutGroupSection(group: _group), label: tr("About"), ) ]..addAll(_group.isAtLeastModerator ? [ _GroupPageTab( - widget: GroupMembersSection(groupID: _group.id), + widget: (c) => GroupMembersSection(groupID: _group.id), label: tr("Members"), ), ] @@ -91,7 +91,7 @@ class _AuthorizedGroupPageScreenState child: Column( children: [ _buildGroupPageHeader(), - Container( + Material( color: _headerColor, child: TabBar( tabs: _tabs.map((e) => e.tab).toList(), @@ -101,7 +101,7 @@ class _AuthorizedGroupPageScreenState Expanded( child: TabBarView( controller: _tabController, - children: _tabs.map((e) => e.widget).toList(), + children: _tabs.map((e) => e.widget(context)).toList(), ), ), ], @@ -172,7 +172,7 @@ class _AuthorizedGroupPageScreenState } class _GroupPageTab { - final Widget widget; + final WidgetBuilder widget; final String label; const _GroupPageTab({