From 659570396c683a39bd6d9aa8cdd5636667bd7494 Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Mon, 20 Jun 2016 20:20:02 -0700 Subject: [PATCH] Add operator== to ColorFilter Fixes #69 --- flutter/lib/ui/painting.dart | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/flutter/lib/ui/painting.dart b/flutter/lib/ui/painting.dart index daf524b6faf30..22c335a1185df 100644 --- a/flutter/lib/ui/painting.dart +++ b/flutter/lib/ui/painting.dart @@ -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.