Skip to content

Commit

Permalink
Add operator== to ColorFilter (#2769)
Browse files Browse the repository at this point in the history
Fixes #69
  • Loading branch information
abarth authored Jun 21, 2016
1 parent f59f7da commit 661946e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions flutter/lib/ui/painting.dart
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,21 @@ class ColorFilter {

final Color _color;
final TransferMode _transferMode;

@override
bool operator ==(dynamic other) {
if (other is! ColorFilter)
return false;
final ColorFilter typedOther = other;
return _color == typedOther._color &&
_transferMode == typedOther._transferMode;
}

@override
int get hashCode => hashValues(_color, _transferMode);

@override
String toString() => "ColorFilter($_color, $TransferMode)";
}

/// A filter operation to apply to a raster image.
Expand Down

0 comments on commit 661946e

Please sign in to comment.