Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
class Model {
const Model({ this.value = 0 });
final int value;
bool operator ==(Object other) {
if (identical(this, other))
return true;
if (other.runtimeType != runtimeType)
return false;
final Model otherModel = other;
return otherModel.value == value;
int get hashCode => value.hashCode;
static Model of(BuildContext context) {
final ModelBinding binding = context.inheritFromWidgetOfExactType(ModelBinding);
return binding.model;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment