diff --git a/fonts/RobotoMono-Regular.ttf b/fonts/RobotoMono-Regular.ttf new file mode 100755 index 00000000..5919b5d1 Binary files /dev/null and b/fonts/RobotoMono-Regular.ttf differ diff --git a/lib/screens/note_editor.dart b/lib/screens/note_editor.dart index 645f74bd..93bf6d12 100644 --- a/lib/screens/note_editor.dart +++ b/lib/screens/note_editor.dart @@ -48,11 +48,11 @@ class NoteEditorState extends State { Widget editor = Column( children: [ 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 { 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, diff --git a/pubspec.yaml b/pubspec.yaml index aa73dba0..75c2d433 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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"