Files
GitJournal/lib/editors/note_title_editor.dart
Vishesh Handa ee2f0e85aa Editors: Remove the padding
This is weird. In some themes there in an internal padding, and in some
themes, there in none. I didn't think themes would affect this.

Also isDense and isCollapsed work in strange ways. I wish this was
properly documented.

I basically want to remove the left padding, and insert a normal top and
bottom padding. Is that too much to ask?
2021-05-06 15:15:52 +02:00

33 lines
942 B
Dart

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