From 0bd74268139d7c4f244a523c2aa740892249de9b Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sat, 12 Mar 2022 09:58:23 +0100 Subject: [PATCH] Attempt to keep post create form --- lib/ui/screens/group_sections/group_posts_section.dart | 2 ++ lib/ui/widgets/post_create_form_widget.dart | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/ui/screens/group_sections/group_posts_section.dart b/lib/ui/screens/group_sections/group_posts_section.dart index e8a7ada..14cfc4c 100644 --- a/lib/ui/screens/group_sections/group_posts_section.dart +++ b/lib/ui/screens/group_sections/group_posts_section.dart @@ -22,12 +22,14 @@ class GroupPostsSection extends StatefulWidget { class _GroupPostsSectionState extends State { final _postsKey = GlobalKey(); + final _formKey = GlobalKey(); /// Add create post target Widget _buildPostCreationArea() { if (!widget.group.canCreatePost) return Container(); return PostCreateFormWidget( + key: _formKey, postTarget: PostTarget.GROUP_PAGE, targetID: widget.group.id, onCreated: () => _postsKey.currentState!.loadPostsList(getOlder: false), diff --git a/lib/ui/widgets/post_create_form_widget.dart b/lib/ui/widgets/post_create_form_widget.dart index ae418e3..3292b75 100644 --- a/lib/ui/widgets/post_create_form_widget.dart +++ b/lib/ui/widgets/post_create_form_widget.dart @@ -38,10 +38,10 @@ class PostCreateFormWidget extends StatefulWidget { }) : super(key: key); @override - _PostCreateFormWidgetState createState() => _PostCreateFormWidgetState(); + PostCreateFormWidgetState createState() => PostCreateFormWidgetState(); } -class _PostCreateFormWidgetState extends State { +class PostCreateFormWidgetState extends State { // Helpers final PostsHelper _postHelper = PostsHelper();