Skip to content

Commit 152a8f1

Browse files
ruinalsuAlexander SukhovDaniil
authored
fix(SNP-400): Updates build badge route. (#22)
* fix(SNP-400): Updates build badge route. * fix: analysis fixes * fix: format code --------- Co-authored-by: Alexander Sukhov <sukhov@surf.dev> Co-authored-by: Daniil <bondarev@surf.dev>
1 parent 5c03d00 commit 152a8f1

File tree

6 files changed

+36
-41
lines changed

6 files changed

+36
-41
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Render Metrics
22

3-
[![Build Status](https://shields.io/github/workflow/status/surfstudio/flutter-render-metrics/Analysis?logo=github&logoColor=white)](https://github.com/surfstudio/flutter-render-metrics)
3+
[![Build Status](https://shields.io/github/actions/workflow/status/surfstudio/flutter-render-metrics/main.yml?logo=github&logoColor=white)](https://github.com/surfstudio/flutter-render-metrics)
44
[![Coverage Status](https://img.shields.io/codecov/c/github/surfstudio/flutter-render-metrics?=render_metrics&logo=codecov&logoColor=white)](https://app.codecov.io/gh/surfstudio/flutter-render-metrics)
55
[![Pub Version](https://img.shields.io/pub/v/render_metrics?logo=dart&logoColor=white)](https://pub.dev/packages/render_metrics)
66
[![Pub Likes](https://badgen.net/pub/likes/render_metrics)](https://pub.dev/packages/render_metrics)

lib/src/data/comparison_diff.dart

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,20 @@ import 'package:render_metrics/src/data/coords_metrics.dart';
4343
/// [centerLeft] - center left coordinate.
4444
/// [centerRight] - center right coordinate.
4545
class ComparisonDiff {
46+
const ComparisonDiff({
47+
required this.yTop,
48+
required this.yBottom,
49+
required this.yCenter,
50+
required this.xLeft,
51+
required this.xRight,
52+
required this.xCenter,
53+
required this.diffTopToBottom,
54+
required this.diffBottomToTop,
55+
required this.diffLeftToRight,
56+
required this.diffRightToLeft,
57+
required this.width,
58+
required this.height,
59+
});
4660
final double yTop;
4761
final double yBottom;
4862
final double yCenter;
@@ -77,21 +91,6 @@ class ComparisonDiff {
7791
CoordinatesMetrics get centerRight =>
7892
CoordinatesMetrics(y: yCenter, x: xRight);
7993

80-
const ComparisonDiff({
81-
required this.yTop,
82-
required this.yBottom,
83-
required this.yCenter,
84-
required this.xLeft,
85-
required this.xRight,
86-
required this.xCenter,
87-
required this.diffTopToBottom,
88-
required this.diffBottomToTop,
89-
required this.diffLeftToRight,
90-
required this.diffRightToLeft,
91-
required this.width,
92-
required this.height,
93-
});
94-
9594
@override
9695
String toString() {
9796
return 'ComparisonDiff(\n'

lib/src/data/coords_metrics.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@
1414

1515
/// Defines a point representing a location in (x,y) coordinate space.
1616
class CoordinatesMetrics {
17-
final double x;
18-
final double y;
19-
2017
const CoordinatesMetrics({
2118
required this.x,
2219
required this.y,
2320
});
21+
final double x;
22+
final double y;
2423
}

lib/src/data/render_data.dart

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,16 @@ import 'package:render_metrics/src/data/coords_metrics.dart';
3434
/// [centerLeft] - center left coordinate.
3535
/// [centerRight] - center right coordinate.
3636
class RenderData {
37+
const RenderData({
38+
required this.yTop,
39+
required this.yBottom,
40+
required this.yCenter,
41+
required this.xLeft,
42+
required this.xRight,
43+
required this.xCenter,
44+
required this.width,
45+
required this.height,
46+
});
3747
final double yTop;
3848
final double yBottom;
3949
final double yCenter;
@@ -64,17 +74,6 @@ class RenderData {
6474
CoordinatesMetrics get centerRight =>
6575
CoordinatesMetrics(y: yCenter, x: xRight);
6676

67-
const RenderData({
68-
required this.yTop,
69-
required this.yBottom,
70-
required this.yCenter,
71-
required this.xLeft,
72-
required this.xRight,
73-
required this.xCenter,
74-
required this.width,
75-
required this.height,
76-
});
77-
7877
@override
7978
String toString() {
8079
return 'RenderData(\n'

lib/src/render/render_metrics.dart

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,6 @@ typedef UnMountCallback<T> = void Function(T id);
3838
/// When deleted from the tree, didUnmountRenderObject is triggered.
3939
/// It calls onUnMount(if passed) and the removeRenderObject method.
4040
class RenderMetricsObject<T> extends SingleChildRenderObjectWidget {
41-
final T id;
42-
final RenderManager manager;
43-
final MountCallback<T>? onMount;
44-
final MountCallback<T>? onUpdate;
45-
final UnMountCallback<T>? onUnMount;
46-
4741
const RenderMetricsObject({
4842
required this.id,
4943
required this.manager,
@@ -53,6 +47,11 @@ class RenderMetricsObject<T> extends SingleChildRenderObjectWidget {
5347
Key? key,
5448
Widget? child,
5549
}) : super(key: key, child: child);
50+
final T id;
51+
final RenderManager manager;
52+
final MountCallback<T>? onMount;
53+
final MountCallback<T>? onUpdate;
54+
final UnMountCallback<T>? onUnMount;
5655

5756
@override
5857
RenderMetricsBox createRenderObject(BuildContext context) {
@@ -84,6 +83,9 @@ class RenderMetricsObject<T> extends SingleChildRenderObjectWidget {
8483
/// extends [RenderProxyBox] which extends [RenderObject].
8584
/// [data] - getter for receiving data in the instance [RenderData].
8685
class RenderMetricsBox extends RenderProxyBox {
86+
RenderMetricsBox({
87+
RenderBox? child,
88+
}) : super(child);
8789
RenderData get data {
8890
final size = this.size;
8991
final width = size.width;
@@ -103,8 +105,4 @@ class RenderMetricsBox extends RenderProxyBox {
103105
height: height,
104106
);
105107
}
106-
107-
RenderMetricsBox({
108-
RenderBox? child,
109-
}) : super(child);
110108
}

test/render_metrics_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ void main() {
150150
RenderMetricsObject(
151151
id: firstId,
152152
manager: renderManager,
153-
child: box,
154153
onUpdate: onUpdate,
154+
child: box,
155155
).updateRenderObject(context, renderObject);
156156

157157
verify(() => onUpdate(any<String>(), any())).called(1);

0 commit comments

Comments
 (0)