Created
February 27, 2020 06:00
-
-
Save xinthink/e972c4944bf197e60c98e19125f395bc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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