Files
GitJournal/lib/storage/notes_repository.dart
Vishesh Handa 4bb02b12d6 Hookup the Journal app to git
Now notes are saved in the git repo, and immediately synced. This is not
the best implementation, as the notes are being reloaded a lot, and
the error handling is terrible (I miss golang). But it's the first
working poc.
2019-01-09 12:55:53 +01:00

26 lines
506 B
Dart

import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:journal/note.dart';
class NoteRepoResult {
bool error;
String noteFilePath;
NoteRepoResult({
@required this.error,
this.noteFilePath,
});
}
abstract class NoteRepository {
// TODO: Better error message!
Future<bool> sync();
Future<NoteRepoResult> addNote(Note note);
Future<NoteRepoResult> updateNote(Note note);
Future<NoteRepoResult> removeNote(Note note);
Future<List<Note>> listNotes();
}