Skip to content

Instantly share code, notes, and snippets.

@blaugold
Last active November 21, 2021 18:22
Show Gist options
  • Save blaugold/afb84087dffbdee53516a8ef5dbbe8c1 to your computer and use it in GitHub Desktop.
Save blaugold/afb84087dffbdee53516a8ef5dbbe8c1 to your computer and use it in GitHub Desktop.
class NoteSearchResult {
NoteSearchResult({required this.id, required this.title});
/// This method creates a NoteSearchResult from a query result.
static NoteSearchResult fromResult(Result result) => NoteSearchResult(
// The Result type has typed getters, to extract values from a result.
id: result.string('id')!,
title: result.string('title')!,
);
final String id;
final String title;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment