diff --git a/lib/ui/screens/user_page_screen.dart b/lib/ui/screens/user_page_screen.dart index e8a380b..aa8b0c5 100644 --- a/lib/ui/screens/user_page_screen.dart +++ b/lib/ui/screens/user_page_screen.dart @@ -93,7 +93,9 @@ class _UserPageScreenState extends State { body: RefreshIndicator( key: _refreshIndicatorKey, child: ListView( - children: [_buildHeader(), _buildBody()], + children: [] + ..add(_buildHeader()) + ..addAll(_buildBody()), physics: AlwaysScrollableScrollPhysics(), controller: _scrollWatcher, ), @@ -155,29 +157,27 @@ class _UserPageScreenState extends State { ); } - Widget _buildBody() { - return Column( - children: [ - // Posts create form - _userInfo.canPostTexts - ? PostCreateFormWidget( - postTarget: PostTarget.USER_PAGE, - targetID: _userInfo.id, - onCreated: _postCreated, - ) - : Container(), + List _buildBody() { + return [ + // Posts create form + _userInfo.canPostTexts + ? PostCreateFormWidget( + postTarget: PostTarget.USER_PAGE, + targetID: _userInfo.id, + onCreated: _postCreated, + ) + : Container(), - // Posts list - PostsListWidget( - key: _postListKey, - getPostsList: () => _postsHelper.getUserPosts(widget.userID), - getOlder: (from) => - _postsHelper.getUserPosts(widget.userID, from: from), - showPostsTarget: false, - buildListView: false, - ), - ], - ); + // Posts list + PostsListWidget( + key: _postListKey, + getPostsList: () => _postsHelper.getUserPosts(widget.userID), + getOlder: (from) => + _postsHelper.getUserPosts(widget.userID, from: from), + showPostsTarget: false, + buildListView: false, + ), + ]; } /// Method called each time a menu option is selected