Only save and load .md files

For now I only want to deal with markdown. In the future, we can move
towards maybe accepting all .txt files as well? Not sure.
This commit is contained in:
Vishesh Handa
2019-01-15 21:23:26 +01:00
parent f5592a2fde
commit 38218fd9a3
2 changed files with 5 additions and 1 deletions

View File

@ -50,7 +50,7 @@ class StateContainerState extends State<StateContainer> {
getDirectory: getNotesDir,
dirName: "journal",
gitCloneUrl: "root@bcn.vhanda.in:git/test",
fileNameGenerator: (Note n) => toIso8601WithTimezone(n.created),
fileNameGenerator: (Note n) => toIso8601WithTimezone(n.created) + '.md',
);
StateContainerState(bool onBoardingCompleted) {

View File

@ -32,6 +32,10 @@ class FileStorage implements NoteRepository {
if (note == null) {
continue;
}
if (!fileEntity.path.endsWith('.md') &&
!fileEntity.path.endsWith('.MD')) {
continue;
}
if (note.id == null) {
String filename = p.basename(fileEntity.path);
note.id = filename;