diff --git a/lib/core/note.dart b/lib/core/note.dart index 53a4f479..71766b72 100644 --- a/lib/core/note.dart +++ b/lib/core/note.dart @@ -70,22 +70,24 @@ class Note with NotesNotifier { Note.newNote(this.parent) { created = DateTime.now(); _loadState = NoteLoadState.Loaded; + _fileFormat = NoteFileFormat.Markdown; } String get filePath { if (_filePath == null) { _filePath = p.join(parent.folderPath, _buildFileName()); switch (_fileFormat) { - case NoteFileFormat.Markdown: - if (!_filePath.toLowerCase().endsWith('.md')) { - _filePath += '.md'; - } - break; case NoteFileFormat.Txt: if (!_filePath.toLowerCase().endsWith('.txt')) { _filePath += '.txt'; } break; + case NoteFileFormat.Markdown: + default: + if (!_filePath.toLowerCase().endsWith('.md')) { + _filePath += '.md'; + } + break; } }