From 179c505e3abdbf91b1ac2b4e7812e46fea0a7323 Mon Sep 17 00:00:00 2001 From: Denis Grafov Date: Mon, 4 Oct 2021 14:21:45 +0300 Subject: [PATCH] update const replacement text (#490) --- .../prefer_const_border_radius.dart | 2 +- .../prefer_const_border_radius_test.dart | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/src/analyzers/lint_analyzer/rules/rules_list/prefer_const_border_radius/prefer_const_border_radius.dart b/lib/src/analyzers/lint_analyzer/rules/rules_list/prefer_const_border_radius/prefer_const_border_radius.dart index 5b7f183c0a..16d98b5b69 100644 --- a/lib/src/analyzers/lint_analyzer/rules/rules_list/prefer_const_border_radius/prefer_const_border_radius.dart +++ b/lib/src/analyzers/lint_analyzer/rules/rules_list/prefer_const_border_radius/prefer_const_border_radius.dart @@ -56,7 +56,7 @@ class PreferConstBorderRadiusRule extends FlutterRule { return value != null ? Replacement( comment: _replaceComment, - replacement: 'BorderRadius.all(Radius.circular($value))', + replacement: 'const BorderRadius.all(Radius.circular($value))', ) : null; } diff --git a/test/analyzers/lint_analyzer/rules/rules_list/prefer_const_border_radius/prefer_const_border_radius_test.dart b/test/analyzers/lint_analyzer/rules/rules_list/prefer_const_border_radius/prefer_const_border_radius_test.dart index 2a300982a2..8ca345eda8 100644 --- a/test/analyzers/lint_analyzer/rules/rules_list/prefer_const_border_radius/prefer_const_border_radius_test.dart +++ b/test/analyzers/lint_analyzer/rules/rules_list/prefer_const_border_radius/prefer_const_border_radius_test.dart @@ -48,12 +48,12 @@ void main() { 'Replace with const BorderRadius constructor.', ], replacements: [ - 'BorderRadius.all(Radius.circular(1.0))', - 'BorderRadius.all(Radius.circular(2.0))', - 'BorderRadius.all(Radius.circular(3.0))', - 'BorderRadius.all(Radius.circular(4.0))', - 'BorderRadius.all(Radius.circular(5.0))', - 'BorderRadius.all(Radius.circular(_constValue))', + 'const BorderRadius.all(Radius.circular(1.0))', + 'const BorderRadius.all(Radius.circular(2.0))', + 'const BorderRadius.all(Radius.circular(3.0))', + 'const BorderRadius.all(Radius.circular(4.0))', + 'const BorderRadius.all(Radius.circular(5.0))', + 'const BorderRadius.all(Radius.circular(_constValue))', ], locationTexts: [ 'BorderRadius.circular(1.0)',