Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
class Model {
const Model({ this.value = 0 });
final int value;
@override
bool operator ==(Object other) {
if (identical(this, other))
return true;
if (other.runtimeType != runtimeType)
return false;
final Model otherModel = other;
return otherModel.value == value;
}
@override
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
You can’t perform that action at this time.