Skip to content

Commit 31353e0

Browse files
remove unecessary library
1 parent acbbaa9 commit 31353e0

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

lib/painter/chart_painter.dart

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import 'package:mrx_charts/models/touchable/arc_shape.dart';
1919
import 'package:mrx_charts/models/touchable/rectangle_shape.dart';
2020
import 'package:mrx_charts/models/touchable/touchable_shape.dart';
2121
import 'package:mrx_charts/touch/stock_touch_callback_data.dart';
22-
import 'package:collection/collection.dart';
2322
import 'package:flutter/material.dart';
2423

2524
part 'chart_axis_painter.dart';
@@ -296,6 +295,29 @@ extension _ListExtensions<T> on List<T> {
296295
T? get lastOrNull => isNotEmpty ? last : null;
297296

298297
T? getOrNull(int index) => length > index ? this[index] : null;
298+
299+
T? firstWhereOrNull(bool Function(T element) test) {
300+
for (var element in this) {
301+
if (test(element)) return element;
302+
}
303+
return null;
304+
}
305+
}
306+
307+
extension _IterableExtensions<T> on Iterable<T> {
308+
List<T> copy() => [...this];
309+
310+
List<T> sorted(Comparator<T> compare) => copy()..sort(compare);
311+
}
312+
313+
extension _IterableDoubleExtensions on Iterable<double> {
314+
double get sum {
315+
double result = 0.0;
316+
for (double value in this) {
317+
result += value;
318+
}
319+
return result;
320+
}
299321
}
300322

301323
extension _ListTextPainterExtensions on List<TextPainter> {

0 commit comments

Comments
 (0)