From 7c00401e72cc562e61259429f195fcf0da90c6b9 Mon Sep 17 00:00:00 2001 From: Gonzalo Velasco Date: Thu, 21 Sep 2023 15:34:09 -0300 Subject: [PATCH 1/3] add bottom padding to textfield --- .../ContentField/content_field.dart | 42 +++++++++++-------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/lib/screens/note/components/ContentField/content_field.dart b/lib/screens/note/components/ContentField/content_field.dart index 8ac66c77..2f58535b 100644 --- a/lib/screens/note/components/ContentField/content_field.dart +++ b/lib/screens/note/components/ContentField/content_field.dart @@ -540,24 +540,30 @@ class _ContentFieldState extends ConsumerState { ]), child: Actions( actions: getTextFieldActions(), - child: TextField( - focusNode: contentFocusNode, - textCapitalization: TextCapitalization.sentences, - autofocus: widget.autofocus, - controller: widget.controller, - undoController: undoController, - keyboardType: TextInputType.multiline, - minLines: 10, - maxLines: null, - style: Theme.of(context).textTheme.bodyMedium, - decoration: const InputDecoration( - hintText: "Start writing your thoughts...", - border: InputBorder.none, - ), - onChanged: (text) => _onContentChanged(text), - onTap: () => _onContentTap(), - textDirection: widget.textDirection, - ), + child: Padding( + padding: const EdgeInsets.only(bottom: 16.0), + child: Column( + children: [ + TextField( + focusNode: contentFocusNode, + textCapitalization: TextCapitalization.sentences, + autofocus: widget.autofocus, + controller: widget.controller, + undoController: undoController, + keyboardType: TextInputType.multiline, + minLines: 10, + maxLines: null, + style: Theme.of(context).textTheme.bodyMedium, + decoration: const InputDecoration( + hintText: "Start writing your thoughts...", + border: InputBorder.none, + ), + onChanged: (text) => _onContentChanged(text), + onTap: () => _onContentTap(), + textDirection: widget.textDirection, + ) + ], + )), ), ), ); From 9457c3f1bf4bd2e877adcfbb4b73d03ad7420ec9 Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Sat, 23 Sep 2023 12:29:36 -0400 Subject: [PATCH 2/3] actually add padding --- .../ContentField/content_field.dart | 46 +++++++++---------- lib/screens/note/note_editor.dart | 2 +- 2 files changed, 23 insertions(+), 25 deletions(-) diff --git a/lib/screens/note/components/ContentField/content_field.dart b/lib/screens/note/components/ContentField/content_field.dart index 2f58535b..57d4b41e 100644 --- a/lib/screens/note/components/ContentField/content_field.dart +++ b/lib/screens/note/components/ContentField/content_field.dart @@ -540,30 +540,28 @@ class _ContentFieldState extends ConsumerState { ]), child: Actions( actions: getTextFieldActions(), - child: Padding( - padding: const EdgeInsets.only(bottom: 16.0), - child: Column( - children: [ - TextField( - focusNode: contentFocusNode, - textCapitalization: TextCapitalization.sentences, - autofocus: widget.autofocus, - controller: widget.controller, - undoController: undoController, - keyboardType: TextInputType.multiline, - minLines: 10, - maxLines: null, - style: Theme.of(context).textTheme.bodyMedium, - decoration: const InputDecoration( - hintText: "Start writing your thoughts...", - border: InputBorder.none, - ), - onChanged: (text) => _onContentChanged(text), - onTap: () => _onContentTap(), - textDirection: widget.textDirection, - ) - ], - )), + child: Column( + children: [ + TextField( + focusNode: contentFocusNode, + textCapitalization: TextCapitalization.sentences, + autofocus: widget.autofocus, + controller: widget.controller, + undoController: undoController, + keyboardType: TextInputType.multiline, + minLines: 10, + maxLines: null, + style: Theme.of(context).textTheme.bodyMedium, + decoration: const InputDecoration( + hintText: "Start writing your thoughts...", + border: InputBorder.none, + ), + onChanged: (text) => _onContentChanged(text), + onTap: () => _onContentTap(), + textDirection: widget.textDirection, + ) + ], + ), ), ), ); diff --git a/lib/screens/note/note_editor.dart b/lib/screens/note/note_editor.dart index cbc8b9f7..b5867edb 100644 --- a/lib/screens/note/note_editor.dart +++ b/lib/screens/note/note_editor.dart @@ -409,7 +409,7 @@ class _NoteEditorState extends ConsumerState { child: KeyboardVisibilityBuilder(builder: (context, kbVisible) { return Padding( padding: - (kbVisible) ? const EdgeInsets.only(bottom: 36) : EdgeInsets.zero, + (kbVisible) ? const EdgeInsets.only(bottom: 52) : EdgeInsets.zero, child: SingleChildScrollView( child: Padding( padding: widget.padding ?? EdgeInsets.zero, From 2b5714374275fb5e967fdb1da3c0d6b8c1d9155f Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Sat, 23 Sep 2023 12:42:05 -0400 Subject: [PATCH 3/3] remove column --- .../ContentField/content_field.dart | 38 +++++++++---------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/lib/screens/note/components/ContentField/content_field.dart b/lib/screens/note/components/ContentField/content_field.dart index 57d4b41e..8ac66c77 100644 --- a/lib/screens/note/components/ContentField/content_field.dart +++ b/lib/screens/note/components/ContentField/content_field.dart @@ -540,27 +540,23 @@ class _ContentFieldState extends ConsumerState { ]), child: Actions( actions: getTextFieldActions(), - child: Column( - children: [ - TextField( - focusNode: contentFocusNode, - textCapitalization: TextCapitalization.sentences, - autofocus: widget.autofocus, - controller: widget.controller, - undoController: undoController, - keyboardType: TextInputType.multiline, - minLines: 10, - maxLines: null, - style: Theme.of(context).textTheme.bodyMedium, - decoration: const InputDecoration( - hintText: "Start writing your thoughts...", - border: InputBorder.none, - ), - onChanged: (text) => _onContentChanged(text), - onTap: () => _onContentTap(), - textDirection: widget.textDirection, - ) - ], + child: TextField( + focusNode: contentFocusNode, + textCapitalization: TextCapitalization.sentences, + autofocus: widget.autofocus, + controller: widget.controller, + undoController: undoController, + keyboardType: TextInputType.multiline, + minLines: 10, + maxLines: null, + style: Theme.of(context).textTheme.bodyMedium, + decoration: const InputDecoration( + hintText: "Start writing your thoughts...", + border: InputBorder.none, + ), + onChanged: (text) => _onContentChanged(text), + onTap: () => _onContentTap(), + textDirection: widget.textDirection, ), ), ),