Skip to content

Instantly share code, notes, and snippets.

@xinthink
Created March 5, 2020 09:48
Show Gist options
  • Save xinthink/273367c3be45f2e06f0617a2f5325e68 to your computer and use it in GitHub Desktop.
Save xinthink/273367c3be45f2e06f0617a2f5325e68 to your computer and use it in GitHub Desktop.
abstract class NoteCommand {
final String id;
final String uid;
/// Defines an reversible action to a note, provides the note [id], and the current user's [uid].
const NoteCommand({
@required this.id,
@required this.uid,
});
/// Returns message about the result of the action.
String get message => '';
/// Executes this command.
Future<void> execute();
/// Undo this command.
Future<void> revert();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment