Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 9 additions & 16 deletions lib/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -250,29 +250,22 @@ class _HomeState extends State<Home> {
}

Widget _fullView() {
final size = MediaQuery.sizeOf(context);
return Padding(
padding: const EdgeInsets.fromLTRB(10, 0, 10, 10),
child: AnimatedSwitcher(
duration: const Duration(milliseconds: 300),
reverseDuration: const Duration(milliseconds: 300),
child: _isPreview
? _markdownPreviewWidget()
: SizedBox(
height: size.height,
width: size.width,
child: SingleChildScrollView(
child: MarkdownTextInput(
(String value) {
setState(() {
_inputText = value;
});
},
_inputText,
controller: _textEditingController,
label: AppLocalizations.of(context)!.markdownTextInputLabel,
),
),
: MarkdownTextInput(
(String value) {
setState(() {
_inputText = value;
});
},
_inputText,
controller: _textEditingController,
label: AppLocalizations.of(context)!.markdownTextInputLabel,
),
),
);
Expand Down
59 changes: 31 additions & 28 deletions lib/widgets/MarkdownTextInput/markdown_text_input.dart
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ class _MarkdownTextInputState extends State<MarkdownTextInput> {
borderRadius: const BorderRadius.all(Radius.circular(10)),
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
SizedBox(
height: 44,
Expand All @@ -357,36 +358,38 @@ class _MarkdownTextInputState extends State<MarkdownTextInput> {
),
),
const Divider(height: 0),
TextFormField(
focusNode: _focusNode,
textInputAction: TextInputAction.newline,
maxLines: widget.maxLines,
controller: _controller,
textCapitalization: TextCapitalization.sentences,
validator: widget.validators != null
? (value) => widget.validators!(value)
: null,
style: widget.textStyle ?? Theme.of(context).textTheme.bodyLarge,
cursorColor: Theme.of(context).colorScheme.primary,
textDirection: widget.textDirection,
decoration: InputDecoration(
enabledBorder: UnderlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).colorScheme.secondary,
Flexible(
child: TextFormField(
focusNode: _focusNode,
textInputAction: TextInputAction.newline,
maxLines: widget.maxLines,
controller: _controller,
textCapitalization: TextCapitalization.sentences,
validator: widget.validators != null
? (value) => widget.validators!(value)
: null,
style: widget.textStyle ?? Theme.of(context).textTheme.bodyLarge,
cursorColor: Theme.of(context).colorScheme.primary,
textDirection: widget.textDirection,
decoration: InputDecoration(
enabledBorder: UnderlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).colorScheme.secondary,
),
),
),
focusedBorder: UnderlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).colorScheme.secondary,
focusedBorder: UnderlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).colorScheme.secondary,
),
),
hintText: widget.label,
hintStyle: const TextStyle(
color: Color.fromRGBO(63, 61, 86, 0.5),
),
contentPadding: const EdgeInsets.symmetric(
vertical: 5,
horizontal: 10,
),
),
hintText: widget.label,
hintStyle: const TextStyle(
color: Color.fromRGBO(63, 61, 86, 0.5),
),
contentPadding: const EdgeInsets.symmetric(
vertical: 5,
horizontal: 10,
),
),
),
Expand Down