Skip to content

Instantly share code, notes, and snippets.

@xinthink
Created February 27, 2020 06:00
Show Gist options
  • Save xinthink/e972c4944bf197e60c98e19125f395bc to your computer and use it in GitHub Desktop.
Save xinthink/e972c4944bf197e60c98e19125f395bc to your computer and use it in GitHub Desktop.
class NotesGrid extends StatelessWidget {
final List<Note> notes;
final void Function(Note) onTap;
const NotesGrid({Key key, this.notes, this.onTap}) : super(key: key);
/// A static factory method can be used as a function reference
static NotesGrid create({Key key, this.notes, this.onTap}) =>
NotesGrid(key: key, notes: notes, onTap: onTap);
@override
Widget build(BuildContext context) => SliverGrid(
...
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment