mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-24 07:43:28 +08:00
RawEditor: Use a monospace font
It looks way way nicer. Also it really highlights how you're editing the raw contents of the file.
This commit is contained in:
BIN
fonts/RobotoMono-Regular.ttf
Executable file
BIN
fonts/RobotoMono-Regular.ttf
Executable file
Binary file not shown.
@ -48,11 +48,11 @@ class NoteEditorState extends State<NoteEditor> {
|
||||
Widget editor = Column(
|
||||
children: <Widget>[
|
||||
NoteHeader(note),
|
||||
NoteMarkdownEditor(_textController),
|
||||
NoteMarkdownEditor(_textController, false),
|
||||
],
|
||||
);
|
||||
if (rawEditor) {
|
||||
editor = NoteMarkdownEditor(_textController);
|
||||
editor = NoteMarkdownEditor(_textController, true);
|
||||
}
|
||||
|
||||
var title = newNote ? "Journal Entry" : "Edit Journal Entry";
|
||||
@ -174,17 +174,24 @@ class NoteEditorState extends State<NoteEditor> {
|
||||
|
||||
class NoteMarkdownEditor extends StatelessWidget {
|
||||
final TextEditingController textController;
|
||||
final bool useMonospace;
|
||||
|
||||
NoteMarkdownEditor(this.textController);
|
||||
NoteMarkdownEditor(this.textController, this.useMonospace);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var style = Theme.of(context).textTheme.subhead;
|
||||
if (useMonospace) {
|
||||
style = style.copyWith(fontFamily: "Roboto Mono");
|
||||
}
|
||||
|
||||
return Form(
|
||||
child: TextFormField(
|
||||
autofocus: true,
|
||||
autocorrect: false,
|
||||
keyboardType: TextInputType.multiline,
|
||||
maxLines: null,
|
||||
style: style,
|
||||
decoration: InputDecoration(
|
||||
hintText: 'Write here',
|
||||
border: InputBorder.none,
|
||||
|
@ -48,6 +48,9 @@ flutter:
|
||||
- family: Lato
|
||||
fonts:
|
||||
- asset: fonts/Lato-Regular.ttf
|
||||
- family: Roboto Mono
|
||||
fonts:
|
||||
- asset: fonts/RobotoMono-Regular.ttf
|
||||
|
||||
flutter_icons:
|
||||
android: "launcher_icon"
|
||||
|
Reference in New Issue
Block a user