dnfield / flutter_path_drawing

MIT License
166 stars 27 forks source link

Make `DashOffset` comparable #21

Closed bselwe closed 3 years ago

bselwe commented 3 years ago

Implements value-based equality for DashOffset.

This change is to allow for testing parseDashOffset in flutter_svg by simply comparing the test results. For instance:

final XmlStartElementEvent abs =
  parseEvents('<stroke stroke-dashoffset="20" />').first 
    as XmlStartElementEvent;

expect(
  parseDashOffset(abs.attributes.toAttributeMap()),
  equals(
    const DashOffset.absolute(20)
  ),
);
bselwe commented 3 years ago

@dnfield

bselwe commented 3 years ago

@dnfield Could we publish this soon to be able to merge https://github.com/dnfield/flutter_svg/pull/605?