1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-25 22:39:22 +00:00

Put post create form into a card

This commit is contained in:
Pierre HUBERT 2020-05-16 09:20:17 +02:00
parent bc3972082c
commit 922fce541f

View File

@ -8,6 +8,7 @@ import 'package:comunic/models/new_post.dart';
import 'package:comunic/ui/dialogs/input_url_dialog.dart'; import 'package:comunic/ui/dialogs/input_url_dialog.dart';
import 'package:comunic/ui/dialogs/input_youtube_link_dialog.dart'; import 'package:comunic/ui/dialogs/input_youtube_link_dialog.dart';
import 'package:comunic/ui/dialogs/new_survey_dialog.dart'; import 'package:comunic/ui/dialogs/new_survey_dialog.dart';
import 'package:comunic/ui/widgets/post_container_widget.dart';
import 'package:comunic/utils/files_utils.dart'; import 'package:comunic/utils/files_utils.dart';
import 'package:comunic/utils/intl_utils.dart'; import 'package:comunic/utils/intl_utils.dart';
import 'package:comunic/utils/post_utils.dart'; import 'package:comunic/utils/post_utils.dart';
@ -99,7 +100,9 @@ class _PostCreateFormWidgetState extends State<PostCreateFormWidget> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Column( return PostContainer(
child: Card(
child: Column(
children: <Widget>[ children: <Widget>[
// Post text content // Post text content
Padding( Padding(
@ -108,7 +111,8 @@ class _PostCreateFormWidgetState extends State<PostCreateFormWidget> {
controller: _postTextController, controller: _postTextController,
minLines: 3, minLines: 3,
maxLines: 10, maxLines: 10,
decoration: InputDecoration(hintText: tr("Create a new post...")), decoration:
InputDecoration(hintText: tr("Create a new post...")),
onChanged: (s) => setState(() {}), onChanged: (s) => setState(() {}),
), ),
), ),
@ -201,6 +205,8 @@ class _PostCreateFormWidgetState extends State<PostCreateFormWidget> {
), ),
) )
], ],
),
),
); );
} }
@ -338,7 +344,6 @@ class _PostCreateFormWidgetState extends State<PostCreateFormWidget> {
/// Pick a new YouTube video /// Pick a new YouTube video
Future<void> _pickYouTubeVideo() async { Future<void> _pickYouTubeVideo() async {
final youtubeID = await showInputYouTubeIDDialog(context, _youtubeID); final youtubeID = await showInputYouTubeIDDialog(context, _youtubeID);
if (youtubeID == null) return; if (youtubeID == null) return;
@ -347,7 +352,6 @@ class _PostCreateFormWidgetState extends State<PostCreateFormWidget> {
setState(() { setState(() {
_youtubeID = youtubeID; _youtubeID = youtubeID;
}); });
} }
/// Submit new post /// Submit new post