This repository was archived by the owner on Jul 16, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +47
-1
lines changed
test/src/analyzers/lint_analyzer/rules/rules_list/prefer_const_border_radius/examples Expand file tree Collapse file tree 2 files changed +47
-1
lines changed Original file line number Diff line number Diff line change 22
33## Unreleased
44
5+ * test: added test case in [ ` prefer-const-border-radius ` ] ( https://dartcodemetrics.dev/docs/rules/flutter/prefer-const-border-radius ) rule.
56* chore: restrict ` analyzer ` version to ` >=2.4.0 <4.2.0 ` .
67* fix: improve context root included files calculation.
78
Original file line number Diff line number Diff line change @@ -26,10 +26,42 @@ class MyWidget extends StatelessWidget {
2626 _constValue == 10.0 ? 25.0 : 30.0 ,
2727 ),
2828 ),
29+ ClipRRect (
30+ decoration: BoxDecoration (
31+ shape: BoxShape .circle,
32+ border: Border .all (
33+ width: ringWidth,
34+ color: Colors .gray,
35+ ),
36+ ),
37+ ),
2938 ]);
3039 }
3140}
3241
42+ class Colors {
43+ static const gray = Color (0xFF000000 );
44+ }
45+
46+ class Color {
47+ final int value;
48+
49+ const Color (int value) : value = value & 0xFFFFFFFF ;
50+ }
51+
52+ enum BoxShape { circle }
53+
54+ final _kDefaultRingWidth = 3 ;
55+ final _scaling = 3.0 ;
56+ final ringWidth = _kDefaultRingWidth * _scaling;
57+
58+ class BoxDecoration {
59+ final BoxShape ? shape;
60+ final Border ? border;
61+
62+ const BoxDecoration ({this .shape, this .border});
63+ }
64+
3365class BorderRadius {
3466 final Radius topLeft;
3567 final Radius topRight;
@@ -54,6 +86,18 @@ class BorderRadius {
5486 });
5587}
5688
89+ class BorderSide {}
90+
91+ class Border {
92+ final Color ? color;
93+ final double ? width;
94+
95+ const Border .all ({
96+ this .width,
97+ this .color,
98+ });
99+ }
100+
57101class Radius {
58102 final double x;
59103 final double y;
@@ -68,8 +112,9 @@ class Radius {
68112class ClipRRect extends Widget {
69113 final Widget ? child;
70114 final BorderRadius ? borderRadius;
115+ final BoxDecoration ? decoration;
71116
72- const ClipRRect ({this .child, this .borderRadius});
117+ const ClipRRect ({this .child, this .borderRadius, this .decoration });
73118}
74119
75120class Column extends Widget {
You can’t perform that action at this time.
0 commit comments