From 5b680bb922706c8e224aec85d060e5d0395d0c9e Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Tue, 28 Dec 2021 17:15:25 +0100 Subject: [PATCH] Fix issue on posts list not refreshing when a new post is created --- lib/ui/screens/user_page_sections/user_posts_section.dart | 1 + lib/ui/widgets/post_create_form_widget.dart | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ui/screens/user_page_sections/user_posts_section.dart b/lib/ui/screens/user_page_sections/user_posts_section.dart index 1de6e4c..10019e2 100644 --- a/lib/ui/screens/user_page_sections/user_posts_section.dart +++ b/lib/ui/screens/user_page_sections/user_posts_section.dart @@ -29,6 +29,7 @@ class _UserPostsSectionState extends State { @override Widget build(BuildContext context) => PostsListWidget( + key: _postsKey, topWidgets: [ widget.user.canPostTexts ? PostCreateFormWidget( diff --git a/lib/ui/widgets/post_create_form_widget.dart b/lib/ui/widgets/post_create_form_widget.dart index 9fd10e7..c69cda0 100644 --- a/lib/ui/widgets/post_create_form_widget.dart +++ b/lib/ui/widgets/post_create_form_widget.dart @@ -382,9 +382,9 @@ class _PostCreateFormWidgetState extends State { this._resetForm(); widget.onCreated(); - } catch (e) { + } catch (e, s) { setState(() => _isCreating = false); - print("Error while creating post : " + e.toString()); + print("Error while creating post : $e $s"); showSimpleSnack(context, tr("Could not create post !")); } }