diff --git a/lib/ui/screens/authorized_group_page_screen.dart b/lib/ui/screens/authorized_group_page_screen.dart index 0226051..b5596d8 100644 --- a/lib/ui/screens/authorized_group_page_screen.dart +++ b/lib/ui/screens/authorized_group_page_screen.dart @@ -112,7 +112,7 @@ class _AuthorizedGroupPageScreenState extends State { return PostCreateFormWidget( postTarget: PostTarget.GROUP_PAGE, targetID: _group.id, - onCreated: () => widget.needRefresh()); + onCreated: () => _postsKey.currentState.loadPostsList(getOlder: false)); } /// Build the list of posts of the group diff --git a/lib/ui/widgets/posts_list_widget.dart b/lib/ui/widgets/posts_list_widget.dart index a8af9e5..8555cea 100644 --- a/lib/ui/widgets/posts_list_widget.dart +++ b/lib/ui/widgets/posts_list_widget.dart @@ -66,7 +66,7 @@ class PostsListWidgetState extends State { @override void didChangeDependencies() { super.didChangeDependencies(); - _loadPostsList(); + loadPostsList(); } void _loadError() { @@ -75,7 +75,7 @@ class PostsListWidgetState extends State { } /// Load the list of posts - Future _loadPostsList({bool getOlder = false}) async { + Future loadPostsList({bool getOlder = false}) async { if (_loading) return; _loading = true; @@ -131,7 +131,7 @@ class PostsListWidgetState extends State { itemBuilder: _buildItem, controller: _scrollController, ), - onRefresh: () => _loadPostsList(), + onRefresh: () => loadPostsList(), ); } @@ -166,6 +166,6 @@ class PostsListWidgetState extends State { void _removePost(Post post) => setState(() => _list.remove(post)); void reachedPostsBottom() { - if (widget.getOlder != null) _loadPostsList(getOlder: true); + if (widget.getOlder != null) loadPostsList(getOlder: true); } }