diff --git a/lib/editors/checklist_editor.dart b/lib/editors/checklist_editor.dart index 354fcc57..2f4c6f0e 100644 --- a/lib/editors/checklist_editor.dart +++ b/lib/editors/checklist_editor.dart @@ -161,7 +161,8 @@ class ChecklistEditorState extends State ], ), bottomNavigationBar: Builder( - builder: (context) => buildEditorBottonBar(context, widget, this), + builder: (context) => + buildEditorBottonBar(context, widget, this, widget.note.parent), ), ); } diff --git a/lib/editors/common.dart b/lib/editors/common.dart index 05e5d987..77c20a6d 100644 --- a/lib/editors/common.dart +++ b/lib/editors/common.dart @@ -2,6 +2,7 @@ import 'dart:io'; import 'package:flutter/material.dart'; import 'package:gitjournal/core/note.dart'; +import 'package:gitjournal/core/notes_folder_fs.dart'; import 'package:gitjournal/error_reporting.dart'; import 'package:share/share.dart'; @@ -99,9 +100,9 @@ Widget buildEditorBottonBar( BuildContext context, Editor editor, EditorState editorState, + NotesFolderFS parentFolder, ) { - var note = editorState.getNote(); - var folderName = note.parent.pathSpec(); + var folderName = parentFolder.pathSpec(); if (folderName.isEmpty) { folderName = "Root Folder"; } diff --git a/lib/editors/journal_editor.dart b/lib/editors/journal_editor.dart index da47ca94..0aa36ffd 100644 --- a/lib/editors/journal_editor.dart +++ b/lib/editors/journal_editor.dart @@ -86,7 +86,8 @@ class JournalEditorState extends State implements EditorState { appBar: buildEditorAppBar(widget, this, noteModified: _noteModified), body: editor, bottomNavigationBar: Builder( - builder: (context) => buildEditorBottonBar(context, widget, this), + builder: (context) => + buildEditorBottonBar(context, widget, this, note.parent), ), ); } diff --git a/lib/editors/markdown_editor.dart b/lib/editors/markdown_editor.dart index b8eb9442..62ef9d82 100644 --- a/lib/editors/markdown_editor.dart +++ b/lib/editors/markdown_editor.dart @@ -117,7 +117,8 @@ class MarkdownEditorState extends State implements EditorState { ), body: body, bottomNavigationBar: Builder( - builder: (context) => buildEditorBottonBar(context, widget, this), + builder: (context) => + buildEditorBottonBar(context, widget, this, note.parent), ), ); } diff --git a/lib/editors/raw_editor.dart b/lib/editors/raw_editor.dart index 00986712..99a93ed1 100644 --- a/lib/editors/raw_editor.dart +++ b/lib/editors/raw_editor.dart @@ -83,7 +83,8 @@ class RawEditorState extends State implements EditorState { appBar: buildEditorAppBar(widget, this, noteModified: _noteModified), body: editor, bottomNavigationBar: Builder( - builder: (context) => buildEditorBottonBar(context, widget, this), + builder: (context) => + buildEditorBottonBar(context, widget, this, note.parent), ), ); }