From ee5f791638dd8dfa78cde6d63ced4108be8fc35b Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sat, 25 Apr 2020 10:01:45 +0200 Subject: [PATCH] Adapt form to small screens --- lib/ui/widgets/post_create_form_widget.dart | 59 +++++++++++---------- 1 file changed, 32 insertions(+), 27 deletions(-) diff --git a/lib/ui/widgets/post_create_form_widget.dart b/lib/ui/widgets/post_create_form_widget.dart index 0f467cd..9249302 100644 --- a/lib/ui/widgets/post_create_form_widget.dart +++ b/lib/ui/widgets/post_create_form_widget.dart @@ -102,34 +102,39 @@ class _PostCreateFormWidgetState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ // Text post button - _PostOptionWidget( - icon: Icons.text_format, - selected: postKind == PostKind.TEXT, - onTap: _resetPostSelection), - - // Include image button - _PostOptionWidget( - icon: Icons.image, - selected: postKind == PostKind.IMAGE, - onTap: _pickImageForPost, - ), - - // Include PDF button - _PostOptionWidget( - icon: Icons.picture_as_pdf, - selected: postKind == PostKind.PDF, - onTap: _pickPDFForPost, - ), - - // Add countdown timer - _PostOptionWidget( - icon: Icons.timer, - selected: postKind == PostKind.COUNTDOWN, - onTap: _pickCountdownTime, - ), - Expanded( - child: Container(), + child: SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Row( + children: [ + _PostOptionWidget( + icon: Icons.text_format, + selected: postKind == PostKind.TEXT, + onTap: _resetPostSelection), + + // Include image button + _PostOptionWidget( + icon: Icons.image, + selected: postKind == PostKind.IMAGE, + onTap: _pickImageForPost, + ), + + // Include PDF button + _PostOptionWidget( + icon: Icons.picture_as_pdf, + selected: postKind == PostKind.PDF, + onTap: _pickPDFForPost, + ), + + // Add countdown timer + _PostOptionWidget( + icon: Icons.timer, + selected: postKind == PostKind.COUNTDOWN, + onTap: _pickCountdownTime, + ), + ], + ), + ), ), // Post visibility level