Skip to content

Instantly share code, notes, and snippets.

@MarcinusX
Last active January 13, 2019 06:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MarcinusX/6a478029aff49252927e3e54d903f84e to your computer and use it in GitHub Desktop.
Save MarcinusX/6a478029aff49252927e3e54d903f84e to your computer and use it in GitHub Desktop.
class Tile extends StatelessWidget {
final NoteState state;
final double height;
const Tile({Key key, this.height, this.state}) : super(key: key);
@override
Widget build(BuildContext context) {
return SizedBox(
width: double.infinity,
height: height,
child: Container(color: color),
);
}
Color get color {
switch (state) {
case NoteState.ready: return Colors.black;
case NoteState.missed: return Colors.red;
case NoteState.tapped: return Colors.transparent;
default: return Colors.black;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment