1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-22 04:49:21 +00:00

Attempt to keep post create form

This commit is contained in:
Pierre HUBERT 2022-03-12 09:58:23 +01:00
parent 75c596226b
commit 0bd7426813
2 changed files with 4 additions and 2 deletions

View File

@ -22,12 +22,14 @@ class GroupPostsSection extends StatefulWidget {
class _GroupPostsSectionState extends State<GroupPostsSection> { class _GroupPostsSectionState extends State<GroupPostsSection> {
final _postsKey = GlobalKey<PostsListWidgetState>(); final _postsKey = GlobalKey<PostsListWidgetState>();
final _formKey = GlobalKey<PostCreateFormWidgetState>();
/// Add create post target /// Add create post target
Widget _buildPostCreationArea() { Widget _buildPostCreationArea() {
if (!widget.group.canCreatePost) return Container(); if (!widget.group.canCreatePost) return Container();
return PostCreateFormWidget( return PostCreateFormWidget(
key: _formKey,
postTarget: PostTarget.GROUP_PAGE, postTarget: PostTarget.GROUP_PAGE,
targetID: widget.group.id, targetID: widget.group.id,
onCreated: () => _postsKey.currentState!.loadPostsList(getOlder: false), onCreated: () => _postsKey.currentState!.loadPostsList(getOlder: false),

View File

@ -38,10 +38,10 @@ class PostCreateFormWidget extends StatefulWidget {
}) : super(key: key); }) : super(key: key);
@override @override
_PostCreateFormWidgetState createState() => _PostCreateFormWidgetState(); PostCreateFormWidgetState createState() => PostCreateFormWidgetState();
} }
class _PostCreateFormWidgetState extends State<PostCreateFormWidget> { class PostCreateFormWidgetState extends State<PostCreateFormWidget> {
// Helpers // Helpers
final PostsHelper _postHelper = PostsHelper(); final PostsHelper _postHelper = PostsHelper();