Files
GitJournal/lib/editors/note_body_editor.dart
2021-05-25 12:39:35 +02:00

40 lines
1.1 KiB
Dart

import 'package:flutter/material.dart';
import 'package:easy_localization/easy_localization.dart';
class NoteBodyEditor extends StatelessWidget {
final TextEditingController textController;
final bool autofocus;
final Function onChanged;
NoteBodyEditor({
required this.textController,
required this.autofocus,
required this.onChanged,
});
@override
Widget build(BuildContext context) {
var theme = Theme.of(context);
var style = theme.textTheme.subtitle1;
return TextField(
autofocus: autofocus,
keyboardType: TextInputType.multiline,
maxLines: null,
style: style,
decoration: InputDecoration(
hintText: tr('editors.common.defaultBodyHint'),
border: InputBorder.none,
fillColor: theme.scaffoldBackgroundColor,
hoverColor: theme.scaffoldBackgroundColor,
contentPadding: const EdgeInsets.all(0.0),
),
controller: textController,
textCapitalization: TextCapitalization.sentences,
scrollPadding: const EdgeInsets.all(0.0),
onChanged: (_) => onChanged(),
);
}
}