Split out NoteFSEntity into its own file

This commit is contained in:
Vishesh Handa
2019-12-04 14:20:58 +01:00
parent 464b7512e9
commit e287d41ffe
2 changed files with 24 additions and 20 deletions

View File

@ -1,27 +1,9 @@
import 'dart:io'; import 'dart:io';
import 'package:gitjournal/core/note.dart';
import 'package:path/path.dart'; import 'package:path/path.dart';
// FIXME: Maybe the parent should be a part of the Note, and the NoteFolder import 'note.dart';
// or maybe also a part of the NoteFolder import 'note_fs_entity.dart';
class NoteFSEntity {
NoteFolder parent;
NoteFolder folder;
Note note;
NoteFSEntity(this.parent, {this.folder, this.note}) {
assert(folder != null || note != null);
}
bool get isNote {
return note != null;
}
bool get isFolder {
return folder != null;
}
}
class NoteFolder { class NoteFolder {
List<NoteFSEntity> entities = []; List<NoteFSEntity> entities = [];

View File

@ -0,0 +1,22 @@
import 'note.dart';
import 'note_folder.dart';
// FIXME: Maybe the parent should be a part of the Note, and the NoteFolder
// or maybe also a part of the NoteFolder
class NoteFSEntity {
NoteFolder parent;
NoteFolder folder;
Note note;
NoteFSEntity(this.parent, {this.folder, this.note}) {
assert(folder != null || note != null);
}
bool get isNote {
return note != null;
}
bool get isFolder {
return folder != null;
}
}