mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-27 09:06:43 +08:00
Split out NoteFSEntity into its own file
This commit is contained in:
@ -1,27 +1,9 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:gitjournal/core/note.dart';
|
||||
import 'package:path/path.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;
|
||||
}
|
||||
}
|
||||
import 'note.dart';
|
||||
import 'note_fs_entity.dart';
|
||||
|
||||
class NoteFolder {
|
||||
List<NoteFSEntity> entities = [];
|
||||
|
22
lib/core/note_fs_entity.dart
Normal file
22
lib/core/note_fs_entity.dart
Normal 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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user