mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-26 08:36:50 +08:00
Add support for filenames based on Uuid
This commit is contained in:
@ -13,6 +13,7 @@ import 'package:path/path.dart' as p;
|
||||
import 'package:meta/meta.dart';
|
||||
|
||||
import 'package:markdown/markdown.dart' as md;
|
||||
import 'package:uuid/uuid.dart';
|
||||
|
||||
import 'md_yaml_doc.dart';
|
||||
import 'md_yaml_doc_codec.dart';
|
||||
@ -432,6 +433,8 @@ class Note with NotesNotifier {
|
||||
return toIso8601WithTimezone(date);
|
||||
case NoteFileNameFormat.Iso8601WithTimeZoneWithoutColon:
|
||||
return toIso8601WithTimezone(date).replaceAll(":", "_");
|
||||
case NoteFileNameFormat.UuidV4:
|
||||
return Uuid().v4();
|
||||
}
|
||||
|
||||
return date.toString();
|
||||
|
@ -240,6 +240,7 @@ class NoteFileNameFormat {
|
||||
static const FromTitle = NoteFileNameFormat("FromTitle", "Title");
|
||||
static const SimpleDate =
|
||||
NoteFileNameFormat("SimpleDate", "yyyy-mm-dd-hh-mm-ss");
|
||||
static const UuidV4 = NoteFileNameFormat("uuidv4", "Uuid V4");
|
||||
|
||||
static const Default = FromTitle;
|
||||
|
||||
@ -249,6 +250,7 @@ class NoteFileNameFormat {
|
||||
Iso8601,
|
||||
Iso8601WithTimeZone,
|
||||
Iso8601WithTimeZoneWithoutColon,
|
||||
UuidV4,
|
||||
];
|
||||
|
||||
static NoteFileNameFormat fromInternalString(String str) {
|
||||
|
Reference in New Issue
Block a user