From 59d8aca3fca47738ea0c40c0a5d9aa7988cb16dd Mon Sep 17 00:00:00 2001 From: Konstantin Scheglov Date: Wed, 3 Nov 2021 11:26:24 -0700 Subject: [PATCH] Fix a few prefer_const_declarations and avoid_redundant_argument_values. (#92929) --- packages/flutter/test/cupertino/text_field_test.dart | 2 +- packages/flutter/test/material/text_field_test.dart | 4 ++-- .../test/painting/image_provider_network_image_test.dart | 2 +- .../flutter_localizations/test/material/date_picker_test.dart | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/flutter/test/cupertino/text_field_test.dart b/packages/flutter/test/cupertino/text_field_test.dart index 163b382b40..8d363efa8e 100644 --- a/packages/flutter/test/cupertino/text_field_test.dart +++ b/packages/flutter/test/cupertino/text_field_test.dart @@ -27,7 +27,7 @@ import '../widgets/editable_text_utils.dart' show OverflowWidgetTextEditingContr import '../widgets/semantics_tester.dart'; // On web, the context menu (aka toolbar) is provided by the browser. -final bool isContextMenuProvidedByPlatform = isBrowser; +const bool isContextMenuProvidedByPlatform = isBrowser; class MockTextSelectionControls extends TextSelectionControls { @override diff --git a/packages/flutter/test/material/text_field_test.dart b/packages/flutter/test/material/text_field_test.dart index 2f8b741bd6..c741f4102d 100644 --- a/packages/flutter/test/material/text_field_test.dart +++ b/packages/flutter/test/material/text_field_test.dart @@ -31,10 +31,10 @@ import 'feedback_tester.dart'; typedef FormatEditUpdateCallback = void Function(TextEditingValue, TextEditingValue); // On web, the context menu (aka toolbar) is provided by the browser. -final bool isContextMenuProvidedByPlatform = isBrowser; +const bool isContextMenuProvidedByPlatform = isBrowser; // On web, key events in text fields are handled by the browser. -final bool areKeyEventsHandledByPlatform = isBrowser; +const bool areKeyEventsHandledByPlatform = isBrowser; class MaterialLocalizationsDelegate extends LocalizationsDelegate { @override diff --git a/packages/flutter/test/painting/image_provider_network_image_test.dart b/packages/flutter/test/painting/image_provider_network_image_test.dart index 333af0fb6e..5407b68293 100644 --- a/packages/flutter/test/painting/image_provider_network_image_test.dart +++ b/packages/flutter/test/painting/image_provider_network_image_test.dart @@ -36,7 +36,7 @@ void main() { }); test('Expect thrown exception with statusCode - evicts from cache and drains', () async { - final int errorStatusCode = HttpStatus.notFound; + const int errorStatusCode = HttpStatus.notFound; const String requestUrl = 'foo-url'; httpClient.request.response.statusCode = errorStatusCode; diff --git a/packages/flutter_localizations/test/material/date_picker_test.dart b/packages/flutter_localizations/test/material/date_picker_test.dart index 5872eba389..bcbe59deb0 100644 --- a/packages/flutter_localizations/test/material/date_picker_test.dart +++ b/packages/flutter_localizations/test/material/date_picker_test.dart @@ -13,7 +13,7 @@ void main() { late DateTime initialDate; setUp(() { - firstDate = DateTime(2001, DateTime.january); + firstDate = DateTime(2001); lastDate = DateTime(2031, DateTime.december, 31); initialDate = DateTime(2016, DateTime.january, 15); });