re-re-enable lint unnecessary_const (#20103)
This commit is contained in:
committed by
GitHub
parent
ffbaa97b50
commit
eda03e2586
@@ -74,7 +74,7 @@ enum TestBindingEventSource {
|
||||
device,
|
||||
}
|
||||
|
||||
const Size _kDefaultTestViewportSize = const Size(800.0, 600.0);
|
||||
const Size _kDefaultTestViewportSize = Size(800.0, 600.0);
|
||||
|
||||
/// Base class for bindings used by widgets library tests.
|
||||
///
|
||||
@@ -346,21 +346,21 @@ abstract class TestWidgetsFlutterBinding extends BindingBase
|
||||
FlutterExceptionHandler _oldExceptionHandler;
|
||||
FlutterErrorDetails _pendingExceptionDetails;
|
||||
|
||||
static const TextStyle _messageStyle = const TextStyle(
|
||||
color: const Color(0xFF917FFF),
|
||||
static const TextStyle _messageStyle = TextStyle(
|
||||
color: Color(0xFF917FFF),
|
||||
fontSize: 40.0,
|
||||
);
|
||||
|
||||
static const Widget _preTestMessage = const Center(
|
||||
child: const Text(
|
||||
static const Widget _preTestMessage = Center(
|
||||
child: Text(
|
||||
'Test starting...',
|
||||
style: _messageStyle,
|
||||
textDirection: TextDirection.ltr,
|
||||
)
|
||||
);
|
||||
|
||||
static const Widget _postTestMessage = const Center(
|
||||
child: const Text(
|
||||
static const Widget _postTestMessage = Center(
|
||||
child: Text(
|
||||
'Test finished.',
|
||||
style: _messageStyle,
|
||||
textDirection: TextDirection.ltr,
|
||||
@@ -678,7 +678,7 @@ class AutomatedTestWidgetsFlutterBinding extends TestWidgetsFlutterBinding {
|
||||
// The timeout here is absurdly high because we do our own timeout logic and
|
||||
// this is just a backstop.
|
||||
@override
|
||||
test_package.Timeout get defaultTestTimeout => const test_package.Timeout(const Duration(minutes: 5));
|
||||
test_package.Timeout get defaultTestTimeout => const test_package.Timeout(Duration(minutes: 5));
|
||||
|
||||
@override
|
||||
bool get inTest => _currentFakeAsync != null;
|
||||
@@ -1380,7 +1380,7 @@ class _LiveTestRenderView extends RenderView {
|
||||
final Map<int, _LiveTestPointerRecord> _pointers = <int, _LiveTestPointerRecord>{};
|
||||
|
||||
TextPainter _label;
|
||||
static const TextStyle _labelStyle = const TextStyle(
|
||||
static const TextStyle _labelStyle = TextStyle(
|
||||
fontFamily: 'sans-serif',
|
||||
fontSize: 10.0,
|
||||
);
|
||||
|
||||
@@ -15,7 +15,7 @@ typedef bool WidgetPredicate(Widget widget);
|
||||
typedef bool ElementPredicate(Element element);
|
||||
|
||||
/// Some frequently used widget [Finder]s.
|
||||
const CommonFinders find = const CommonFinders._();
|
||||
const CommonFinders find = CommonFinders._();
|
||||
|
||||
/// Provides lightweight syntax for getting frequently used widget [Finder]s.
|
||||
///
|
||||
|
||||
@@ -34,7 +34,7 @@ import 'goldens.dart';
|
||||
/// * [findsWidgets], when you want the finder to find one or more widgets.
|
||||
/// * [findsOneWidget], when you want the finder to find exactly one widget.
|
||||
/// * [findsNWidgets], when you want the finder to find a specific number of widgets.
|
||||
const Matcher findsNothing = const _FindsWidgetMatcher(null, 0);
|
||||
const Matcher findsNothing = _FindsWidgetMatcher(null, 0);
|
||||
|
||||
/// Asserts that the [Finder] locates at least one widget in the widget tree.
|
||||
///
|
||||
@@ -49,7 +49,7 @@ const Matcher findsNothing = const _FindsWidgetMatcher(null, 0);
|
||||
/// * [findsNothing], when you want the finder to not find anything.
|
||||
/// * [findsOneWidget], when you want the finder to find exactly one widget.
|
||||
/// * [findsNWidgets], when you want the finder to find a specific number of widgets.
|
||||
const Matcher findsWidgets = const _FindsWidgetMatcher(1, null);
|
||||
const Matcher findsWidgets = _FindsWidgetMatcher(1, null);
|
||||
|
||||
/// Asserts that the [Finder] locates at exactly one widget in the widget tree.
|
||||
///
|
||||
@@ -64,7 +64,7 @@ const Matcher findsWidgets = const _FindsWidgetMatcher(1, null);
|
||||
/// * [findsNothing], when you want the finder to not find anything.
|
||||
/// * [findsWidgets], when you want the finder to find one or more widgets.
|
||||
/// * [findsNWidgets], when you want the finder to find a specific number of widgets.
|
||||
const Matcher findsOneWidget = const _FindsWidgetMatcher(1, 1);
|
||||
const Matcher findsOneWidget = _FindsWidgetMatcher(1, 1);
|
||||
|
||||
/// Asserts that the [Finder] locates the specified number of widgets in the widget tree.
|
||||
///
|
||||
@@ -96,7 +96,7 @@ Matcher findsNWidgets(int n) => new _FindsWidgetMatcher(n, n);
|
||||
/// See also:
|
||||
///
|
||||
/// * [isOnstage], the opposite.
|
||||
const Matcher isOffstage = const _IsOffstage();
|
||||
const Matcher isOffstage = _IsOffstage();
|
||||
|
||||
/// Asserts that the [Finder] locates the a single widget that has no
|
||||
/// [Offstage] widget ancestors.
|
||||
@@ -104,7 +104,7 @@ const Matcher isOffstage = const _IsOffstage();
|
||||
/// See also:
|
||||
///
|
||||
/// * [isOffstage], the opposite.
|
||||
const Matcher isOnstage = const _IsOnstage();
|
||||
const Matcher isOnstage = _IsOnstage();
|
||||
|
||||
/// Asserts that the [Finder] locates the a single widget that has at
|
||||
/// least one [Card] widget ancestor.
|
||||
@@ -112,7 +112,7 @@ const Matcher isOnstage = const _IsOnstage();
|
||||
/// See also:
|
||||
///
|
||||
/// * [isNotInCard], the opposite.
|
||||
const Matcher isInCard = const _IsInCard();
|
||||
const Matcher isInCard = _IsInCard();
|
||||
|
||||
/// Asserts that the [Finder] locates the a single widget that has no
|
||||
/// [Card] widget ancestors.
|
||||
@@ -122,14 +122,14 @@ const Matcher isInCard = const _IsInCard();
|
||||
/// See also:
|
||||
///
|
||||
/// * [isInCard], the opposite.
|
||||
const Matcher isNotInCard = const _IsNotInCard();
|
||||
const Matcher isNotInCard = _IsNotInCard();
|
||||
|
||||
/// Asserts that an object's toString() is a plausible one-line description.
|
||||
///
|
||||
/// Specifically, this matcher checks that the string does not contains newline
|
||||
/// characters, and does not have leading or trailing whitespace, is not
|
||||
/// empty, and does not contain the default `Instance of ...` string.
|
||||
const Matcher hasOneLineDescription = const _HasOneLineDescription();
|
||||
const Matcher hasOneLineDescription = _HasOneLineDescription();
|
||||
|
||||
/// Asserts that an object's toStringDeep() is a plausible multi-line
|
||||
/// description.
|
||||
@@ -146,7 +146,7 @@ const Matcher hasOneLineDescription = const _HasOneLineDescription();
|
||||
/// * Has multiple lines.
|
||||
/// * The first line starts with `prefixLineOne`
|
||||
/// * All subsequent lines start with `prefixOtherLines`.
|
||||
const Matcher hasAGoodToStringDeep = const _HasGoodToStringDeep();
|
||||
const Matcher hasAGoodToStringDeep = _HasGoodToStringDeep();
|
||||
|
||||
/// A matcher for functions that throw [FlutterError].
|
||||
///
|
||||
@@ -821,7 +821,7 @@ typedef num DistanceFunction<T>(T a, T b);
|
||||
/// first casting it to a [DistanceFunction<T>] for some concrete T.
|
||||
typedef num AnyDistanceFunction(Null a, Null b);
|
||||
|
||||
const Map<Type, AnyDistanceFunction> _kStandardDistanceFunctions = const <Type, AnyDistanceFunction>{
|
||||
const Map<Type, AnyDistanceFunction> _kStandardDistanceFunctions = <Type, AnyDistanceFunction>{
|
||||
Color: _maxComponentColorDistance,
|
||||
HSVColor: _maxComponentHSVColorDistance,
|
||||
HSLColor: _maxComponentHSLColorDistance,
|
||||
@@ -1028,7 +1028,7 @@ class _IsMethodCall extends Matcher {
|
||||
/// Asserts that a [Finder] locates a single object whose root RenderObject
|
||||
/// is a [RenderClipRect] with no clipper set, or an equivalent
|
||||
/// [RenderClipPath].
|
||||
const Matcher clipsWithBoundingRect = const _ClipsWithBoundingRect();
|
||||
const Matcher clipsWithBoundingRect = _ClipsWithBoundingRect();
|
||||
|
||||
/// Asserts that a [Finder] locates a single object whose root RenderObject
|
||||
/// is a [RenderClipRRect] with no clipper set, and border radius equals to
|
||||
|
||||
Reference in New Issue
Block a user