Line data Source code
1 : import 'package:mrx_icon_font_gen/parser/path/model/command_arguments.dart'; 2 : 3 : class CoordinateSequence extends CommandArguments { 4 : final List<double> coordinates; 5 : 6 4 : CoordinateSequence({ 7 : required this.coordinates, 8 : }); 9 : 10 3 : @override 11 : String toString() { 12 15 : return coordinates.map((c) => c.toStringAsFixed(2)).join(' '); 13 : } 14 : 15 4 : @override 16 : bool operator ==(Object other) { 17 4 : if (other is! CoordinateSequence) { 18 : return false; 19 : } 20 20 : if (other.coordinates.length != coordinates.length) { 21 : return false; 22 : } 23 16 : for (int i = 0; i < coordinates.length; i++) { 24 20 : if (other.coordinates[i] != coordinates[i]) { 25 : return false; 26 : } 27 : } 28 : return true; 29 : } 30 : 31 3 : @override 32 6 : int get hashCode => Object.hashAll(coordinates); 33 : }