This repository was archived by the owner on Jul 16, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +19
-2
lines changed
lib/src/analyzers/lint_analyzer/rules/rules_list/avoid_border_all
test/src/analyzers/lint_analyzer/rules/rules_list/avoid_border_all/examples Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 11# Changelog
22
3+ ## Unreleased
4+
5+ * fix: [ ` avoid-border-all ` ] ( https://dartcodemetrics.dev/docs/rules/flutter/avoid-border-all ) is triggered even when it is not a const.
6+
37## 4.15.1
48
59* chore: restrict ` analyzer ` version to ` >=2.4.0 <4.1.0 ` .
Original file line number Diff line number Diff line change @@ -21,7 +21,9 @@ class _Visitor extends RecursiveAstVisitor<void> {
2121 final arg = (argument as NamedExpression ).expression;
2222 if (arg is Literal ) {
2323 continue ;
24- } else if (arg is MethodInvocation || arg is ConditionalExpression ) {
24+ } else if (arg is MethodInvocation ||
25+ arg is ConditionalExpression ||
26+ arg is PropertyAccess ) {
2527 isAllConst = false ;
2628 } else if (arg is SimpleIdentifier ) {
2729 final element = arg.staticElement;
Original file line number Diff line number Diff line change 11class MyWidget extends StatelessWidget {
2- Widget build (BuildContext _ ) => Column (children: [
2+ Widget build (BuildContext context ) => Column (children: [
33 const Container (border: Border .fromBorderSide (BorderSide ())),
44 Container (border: Border .all ()), // LINT
55 Container (
@@ -27,6 +27,11 @@ class MyWidget extends StatelessWidget {
2727 style: BorderStyle .none,
2828 ),
2929 ),
30+ Container (
31+ border: Border .all (
32+ color: Theme .of (context).color,
33+ ),
34+ ),
3035 Container (
3136 border: Border .all (
3237 color: const Color (0 ),
@@ -106,3 +111,9 @@ class Widget {
106111}
107112
108113class BuildContext {}
114+
115+ class Theme {
116+ const color = Color (0 );
117+
118+ static Color of (BuildContext context) => color;
119+ }
You can’t perform that action at this time.
0 commit comments