mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-08-06 15:21:21 +08:00

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?
33 lines
942 B
Dart
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(),
|
|
);
|
|
}
|
|
}
|