From 414f81b32f7588d7747693d0ffc0317c70db324a Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Fri, 17 Apr 2020 10:37:02 +0200 Subject: [PATCH] Fix issue --- lib/ui/screens/authorized_group_page_screen.dart | 2 +- lib/ui/widgets/posts_list_widget.dart | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) 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); } }