Create cocoon analysis_options.yaml (#2086)
diff --git a/analysis_options.yaml b/analysis_options.yaml
new file mode 100644
index 0000000..18b7df2
--- /dev/null
+++ b/analysis_options.yaml
@@ -0,0 +1,44 @@
+# Specify analysis options for all of flutter/cocoon
+#
+# Until there are meta linter rules, each desired lint must be explicitly enabled.
+# See: https://github.com/dart-lang/linter/issues/288
+#
+# For a list of lints, see: http://dart-lang.github.io/linter/lints/
+# See the configuration guide for more
+# https://github.com/dart-lang/sdk/tree/master/pkg/analyzer#configuring-the-analyzer
+#
+# There are other similar analysis options files in the flutter repos,
+# which should be kept in sync with this file:
+#
+# - analysis_options.yaml (this file)
+# - packages/flutter/lib/analysis_options_user.yaml
+# - https://github.com/flutter/plugins/blob/master/analysis_options.yaml
+# - https://github.com/flutter/engine/blob/master/analysis_options.yaml
+#
+# This file contains the analysis options used by Flutter tools, such as IntelliJ,
+# Android Studio, and the `flutter analyze` command.
+include: package:flutter_lints/flutter.yaml
+
+analyzer:
+ language:
+ strict-casts: false
+ strict-raw-types: true
+ errors:
+ # treat missing required parameters as a warning (not a hint)
+ missing_required_param: warning
+ # treat missing returns as a warning (not a hint)
+ missing_return: warning
+ # allow having TODOs in the code
+ todo: ignore
+ implicit_dynamic_parameter: info
+ exclude:
+ - ".dart_tool/**"
+ - "**/*.g.dart"
+ - "**/*.pb.dart"
+ - "**/*.pbjson.dart"
+ - "**/*.pbenum.dart"
+ - "test/**/mocks.mocks.dart"
+
+linter:
+ rules:
+ use_super_parameters: true
diff --git a/app_dart/analysis_options.yaml b/app_dart/analysis_options.yaml
index 880ba73..f4cf71f 100644
--- a/app_dart/analysis_options.yaml
+++ b/app_dart/analysis_options.yaml
@@ -1,52 +1,8 @@
-# Specify analysis options.
-#
-# Until there are meta linter rules, each desired lint must be explicitly enabled.
-# See: https://github.com/dart-lang/linter/issues/288
-#
-# For a list of lints, see: http://dart-lang.github.io/linter/lints/
-# See the configuration guide for more
-# https://github.com/dart-lang/sdk/tree/master/pkg/analyzer#configuring-the-analyzer
-#
-# There are other similar analysis options files in the flutter repos,
-# which should be kept in sync with this file:
-#
-# - analysis_options.yaml (this file)
-# - packages/flutter/lib/analysis_options_user.yaml
-# - https://github.com/flutter/plugins/blob/master/analysis_options.yaml
-# - https://github.com/flutter/engine/blob/master/analysis_options.yaml
-#
-# This file contains the analysis options used by Flutter tools, such as IntelliJ,
-# Android Studio, and the `flutter analyze` command.
-
-analyzer:
- strong-mode:
- implicit-casts: false
- implicit-dynamic: false
- errors:
- # treat missing required parameters as a warning (not a hint)
- missing_required_param: warning
- # treat missing returns as a warning (not a hint)
- missing_return: warning
- # allow having TODOs in the code
- todo: ignore
- # Ignore analyzer hints for updating pubspecs when using Future or
- # Stream and not importing dart:async
- # Please see https://github.com/flutter/flutter/pull/24528 for details.
- sdk_version_async_exported_from_core: ignore
- implicit_dynamic_parameter: info
- exclude:
- - ".dart_tool/**"
- - "**/*.g.dart"
- - "**/*.pb.dart"
- - "**/*.pbjson.dart"
- - "**/*.pbenum.dart"
- - "test/src/utilities/mocks.mocks.dart"
-
-include: package:flutter_lints/flutter.yaml
+include: ../analysis_options.yaml
linter:
rules:
# a few rules listed below are the ones we would like to exclude from flutter_lint package, for app_dart
# reasons for exclusions are provided in the comments to the right
avoid_print: false # we have necessary print calls in the code
- constant_identifier_names: false # we have all capitalized enums in check_for_waiting_pull_requests_test.dart
\ No newline at end of file
+ constant_identifier_names: false # we have all capitalized enums in check_for_waiting_pull_requests_test.dart
diff --git a/app_dart/lib/src/model/ci_yaml/ci_yaml.dart b/app_dart/lib/src/model/ci_yaml/ci_yaml.dart
index 3244f2a..7ddb23e 100644
--- a/app_dart/lib/src/model/ci_yaml/ci_yaml.dart
+++ b/app_dart/lib/src/model/ci_yaml/ci_yaml.dart
@@ -202,7 +202,7 @@
final List<String> exceptions = <String>[];
/// Decoded will contain a list of maps for the dependencies found.
- dynamic decoded = json.decode(dependencyJsonString);
+ List<dynamic> decoded = json.decode(dependencyJsonString) as List<dynamic>;
for (Map<String, dynamic> depMap in decoded) {
if (!depMap.containsKey('version')) {
diff --git a/app_dart/lib/src/request_handlers/scheduler/batch_backfiller.dart b/app_dart/lib/src/request_handlers/scheduler/batch_backfiller.dart
index ac128e3..a21f36d 100644
--- a/app_dart/lib/src/request_handlers/scheduler/batch_backfiller.dart
+++ b/app_dart/lib/src/request_handlers/scheduler/batch_backfiller.dart
@@ -35,7 +35,7 @@
@override
Future<Body> get() async {
- final List<Future> futures = <Future>[];
+ final List<Future<void>> futures = <Future<void>>[];
for (RepositorySlug slug in config.supportedRepos) {
futures.add(backfillRepository(slug));
@@ -81,7 +81,7 @@
log.fine(backfill.map<String>((Tuple<Target, FullTask, int> tuple) => tuple.first.value.name));
// Create list of backfill requests.
- final List<Future> futures = <Future>[];
+ final List<Future<void>> futures = <Future<void>>[];
for (Tuple<Target, FullTask, int> tuple in backfill) {
// TODO(chillers): The backfill priority is always going to be low. If this is a ToT task, we should run it at the default priority.
final Tuple<Target, Task, int> toBeScheduled = Tuple(
diff --git a/app_dart/lib/src/request_handling/api_request_handler.dart b/app_dart/lib/src/request_handling/api_request_handler.dart
index 7447ad9..f43b738 100644
--- a/app_dart/lib/src/request_handling/api_request_handler.dart
+++ b/app_dart/lib/src/request_handling/api_request_handler.dart
@@ -157,7 +157,7 @@
}
class ApiKey<T> extends RequestKey<T> {
- const ApiKey._(String name) : super(name);
+ const ApiKey._(super.name);
static const ApiKey<Uint8List> requestBody = ApiKey<Uint8List>._('requestBody');
static const ApiKey<AuthenticatedContext> authContext = ApiKey<AuthenticatedContext>._('authenticatedContext');
diff --git a/app_dart/lib/src/request_handling/no_auth_request_handler.dart b/app_dart/lib/src/request_handling/no_auth_request_handler.dart
index bbe05e8..d2a6026 100644
--- a/app_dart/lib/src/request_handling/no_auth_request_handler.dart
+++ b/app_dart/lib/src/request_handling/no_auth_request_handler.dart
@@ -109,7 +109,7 @@
@visibleForTesting
class NoAuthKey<T> extends RequestKey<T> {
- const NoAuthKey._(String name) : super(name);
+ const NoAuthKey._(super.name);
static const NoAuthKey<Uint8List> requestBody = NoAuthKey<Uint8List>._('requestBody');
static const NoAuthKey<Map<String, dynamic>> requestData = NoAuthKey<Map<String, dynamic>>._('requestData');
diff --git a/app_dart/lib/src/request_handling/subscription_handler.dart b/app_dart/lib/src/request_handling/subscription_handler.dart
index ee2242c..6cc40a6 100644
--- a/app_dart/lib/src/request_handling/subscription_handler.dart
+++ b/app_dart/lib/src/request_handling/subscription_handler.dart
@@ -149,7 +149,7 @@
@visibleForTesting
class PubSubKey<T> extends RequestKey<T> {
- const PubSubKey._(String name) : super(name);
+ const PubSubKey._(super.name);
static const PubSubKey<PushMessage> message = PubSubKey<PushMessage>._('message');
}
diff --git a/app_dart/lib/src/service/scheduler.dart b/app_dart/lib/src/service/scheduler.dart
index 657c254..a85b7c2 100644
--- a/app_dart/lib/src/service/scheduler.dart
+++ b/app_dart/lib/src/service/scheduler.dart
@@ -167,7 +167,7 @@
///
/// Each batch request contains [Config.batchSize] builds to be scheduled.
Future<void> _batchScheduleBuilds(Commit commit, List<Tuple<Target, Task, int>> toBeScheduled) async {
- final List<Future> futures = <Future>[];
+ final List<Future<void>> futures = <Future<void>>[];
for (int i = 0; i < toBeScheduled.length; i += config.batchSize) {
futures.add(luciBuildService.schedulePostsubmitBuilds(
commit: commit,
diff --git a/auto_submit/analysis_options.yaml b/auto_submit/analysis_options.yaml
index 880ba73..4c66d4a 100644
--- a/auto_submit/analysis_options.yaml
+++ b/auto_submit/analysis_options.yaml
@@ -1,52 +1,9 @@
-# Specify analysis options.
-#
-# Until there are meta linter rules, each desired lint must be explicitly enabled.
-# See: https://github.com/dart-lang/linter/issues/288
-#
-# For a list of lints, see: http://dart-lang.github.io/linter/lints/
-# See the configuration guide for more
-# https://github.com/dart-lang/sdk/tree/master/pkg/analyzer#configuring-the-analyzer
-#
-# There are other similar analysis options files in the flutter repos,
-# which should be kept in sync with this file:
-#
-# - analysis_options.yaml (this file)
-# - packages/flutter/lib/analysis_options_user.yaml
-# - https://github.com/flutter/plugins/blob/master/analysis_options.yaml
-# - https://github.com/flutter/engine/blob/master/analysis_options.yaml
-#
-# This file contains the analysis options used by Flutter tools, such as IntelliJ,
-# Android Studio, and the `flutter analyze` command.
+include: ../analysis_options.yaml
analyzer:
- strong-mode:
- implicit-casts: false
- implicit-dynamic: false
- errors:
- # treat missing required parameters as a warning (not a hint)
- missing_required_param: warning
- # treat missing returns as a warning (not a hint)
- missing_return: warning
- # allow having TODOs in the code
- todo: ignore
- # Ignore analyzer hints for updating pubspecs when using Future or
- # Stream and not importing dart:async
- # Please see https://github.com/flutter/flutter/pull/24528 for details.
- sdk_version_async_exported_from_core: ignore
- implicit_dynamic_parameter: info
- exclude:
- - ".dart_tool/**"
- - "**/*.g.dart"
- - "**/*.pb.dart"
- - "**/*.pbjson.dart"
- - "**/*.pbenum.dart"
- - "test/src/utilities/mocks.mocks.dart"
-
-include: package:flutter_lints/flutter.yaml
+ language:
+ strict-raw-types: false # TODO: Remove this lint
linter:
rules:
- # a few rules listed below are the ones we would like to exclude from flutter_lint package, for app_dart
- # reasons for exclusions are provided in the comments to the right
- avoid_print: false # we have necessary print calls in the code
- constant_identifier_names: false # we have all capitalized enums in check_for_waiting_pull_requests_test.dart
\ No newline at end of file
+ constant_identifier_names: false # we have all capitalized enums in check_for_waiting_pull_requests_test.dart
diff --git a/auto_submit/lib/requests/check_pull_request.dart b/auto_submit/lib/requests/check_pull_request.dart
index 095159a..2f882cd 100644
--- a/auto_submit/lib/requests/check_pull_request.dart
+++ b/auto_submit/lib/requests/check_pull_request.dart
@@ -11,9 +11,7 @@
import 'package:shelf/shelf.dart';
import '../service/validation_service.dart';
-import '../request_handling/authentication.dart';
import '../request_handling/pubsub.dart';
-import '../service/config.dart';
import '../service/log.dart';
import '../server/authenticated_request_handler.dart';
@@ -24,11 +22,11 @@
/// check if the pull request is mergable.
class CheckPullRequest extends AuthenticatedRequestHandler {
const CheckPullRequest({
- required Config config,
- required CronAuthProvider cronAuthProvider,
+ required super.config,
+ required super.cronAuthProvider,
this.approverProvider = ApproverService.defaultProvider,
this.pubsub = const PubSub(),
- }) : super(config: config, cronAuthProvider: cronAuthProvider);
+ });
final PubSub pubsub;
final ApproverServiceProvider approverProvider;
diff --git a/auto_submit/lib/requests/github_webhook.dart b/auto_submit/lib/requests/github_webhook.dart
index 669bb46..2e41418 100644
--- a/auto_submit/lib/requests/github_webhook.dart
+++ b/auto_submit/lib/requests/github_webhook.dart
@@ -21,9 +21,9 @@
/// check if the pull request is mergable and publish to pubsub.
class GithubWebhook extends RequestHandler {
const GithubWebhook({
- required Config config,
+ required super.config,
this.pubsub = const PubSub(),
- }) : super(config: config);
+ });
final PubSub pubsub;
diff --git a/auto_submit/lib/requests/readiness_check.dart b/auto_submit/lib/requests/readiness_check.dart
index b16249a..1e10489 100644
--- a/auto_submit/lib/requests/readiness_check.dart
+++ b/auto_submit/lib/requests/readiness_check.dart
@@ -6,14 +6,13 @@
import 'package:shelf/shelf.dart';
-import '../service/config.dart';
import '../server/request_handler.dart';
/// Handler for readiness checks.
class ReadinessCheck extends RequestHandler {
const ReadinessCheck({
- required Config config,
- }) : super(config: config);
+ required super.config,
+ });
@override
Future<Response> get() async {
diff --git a/auto_submit/lib/server/authenticated_request_handler.dart b/auto_submit/lib/server/authenticated_request_handler.dart
index 34305f3..913d6ac 100644
--- a/auto_submit/lib/server/authenticated_request_handler.dart
+++ b/auto_submit/lib/server/authenticated_request_handler.dart
@@ -7,7 +7,6 @@
import 'request_handler.dart';
import '../request_handling/authentication.dart';
-import '../service/config.dart';
import '../requests/exceptions.dart';
import '../service/log.dart';
@@ -18,9 +17,9 @@
abstract class AuthenticatedRequestHandler extends RequestHandler {
/// Creates a new [ApiRequestHandler].
const AuthenticatedRequestHandler({
- required Config config,
+ required super.config,
required this.cronAuthProvider,
- }) : super(config: config);
+ });
/// Service responsible for authenticating this [Request].
final CronAuthProvider cronAuthProvider;
diff --git a/auto_submit/lib/validations/approval.dart b/auto_submit/lib/validations/approval.dart
index b0bbfa1..77eeea6 100644
--- a/auto_submit/lib/validations/approval.dart
+++ b/auto_submit/lib/validations/approval.dart
@@ -6,15 +6,14 @@
import 'package:auto_submit/validations/validation.dart';
import 'package:github/github.dart' as github;
-import '../service/config.dart';
import '../service/log.dart';
/// Validates that a PR has been approved in accordance with the code review
/// guidelines.
class Approval extends Validation {
Approval({
- required Config config,
- }) : super(config: config);
+ required super.config,
+ });
@override
diff --git a/auto_submit/lib/validations/change_requested.dart b/auto_submit/lib/validations/change_requested.dart
index a4f48e2..cd675c1 100644
--- a/auto_submit/lib/validations/change_requested.dart
+++ b/auto_submit/lib/validations/change_requested.dart
@@ -6,14 +6,13 @@
import 'package:auto_submit/validations/validation.dart';
import 'package:github/github.dart' as github;
-import '../service/config.dart';
import '../service/log.dart';
/// Validates the PR does not have any pending change requests.
class ChangeRequested extends Validation {
ChangeRequested({
- required Config config,
- }) : super(config: config);
+ required super.config,
+ });
@override
diff --git a/auto_submit/lib/validations/ci_successful.dart b/auto_submit/lib/validations/ci_successful.dart
index 7a921e4..1df8d30 100644
--- a/auto_submit/lib/validations/ci_successful.dart
+++ b/auto_submit/lib/validations/ci_successful.dart
@@ -20,8 +20,8 @@
};
CiSuccessful({
- required Config config,
- }) : super(config: config);
+ required super.config,
+ });
@override
diff --git a/auto_submit/lib/validations/conflicting.dart b/auto_submit/lib/validations/conflicting.dart
index b4c7021..77989b0 100644
--- a/auto_submit/lib/validations/conflicting.dart
+++ b/auto_submit/lib/validations/conflicting.dart
@@ -6,13 +6,11 @@
import 'package:auto_submit/validations/validation.dart';
import 'package:github/github.dart' as github;
-import '../service/config.dart';
-
/// Validates the PR is not conflicting.
class Conflicting extends Validation {
Conflicting({
- required Config config,
- }) : super(config: config);
+ required super.config,
+ });
@override
diff --git a/auto_submit/lib/validations/empty_checks.dart b/auto_submit/lib/validations/empty_checks.dart
index 86a5e3c..33e2819 100644
--- a/auto_submit/lib/validations/empty_checks.dart
+++ b/auto_submit/lib/validations/empty_checks.dart
@@ -6,14 +6,13 @@
import 'package:auto_submit/validations/validation.dart';
import 'package:github/github.dart' as github;
-import '../service/config.dart';
import '../service/github_service.dart';
/// Validates that the list of checks for the PR is not empty.
class EmptyChecks extends Validation {
EmptyChecks({
- required Config config,
- }) : super(config: config);
+ required super.config,
+ });
@override
diff --git a/auto_submit/lib/validations/revert.dart b/auto_submit/lib/validations/revert.dart
index 1760768..b5d6319 100644
--- a/auto_submit/lib/validations/revert.dart
+++ b/auto_submit/lib/validations/revert.dart
@@ -7,13 +7,12 @@
import 'package:auto_submit/validations/validation.dart';
import 'package:github/github.dart' as github;
-import '../service/config.dart';
import '../service/log.dart';
class Revert extends Validation {
Revert({
- required Config config,
- }) : super(config: config);
+ required super.config,
+ });
static const Set<String> allowedReviewers = <String>{ORG_MEMBER, ORG_OWNER};
diff --git a/auto_submit/lib/validations/unknown_mergeable.dart b/auto_submit/lib/validations/unknown_mergeable.dart
index 932180b..0f7b17d 100644
--- a/auto_submit/lib/validations/unknown_mergeable.dart
+++ b/auto_submit/lib/validations/unknown_mergeable.dart
@@ -6,13 +6,11 @@
import 'package:auto_submit/validations/validation.dart';
import 'package:github/github.dart' as github;
-import '../service/config.dart';
-
/// Validates the PR is not temporarily in a unknown mergeable state.
class UnknownMergeable extends Validation {
UnknownMergeable({
- required Config config,
- }) : super(config: config);
+ required super.config,
+ });
@override
diff --git a/codesign/analysis_options.yaml b/codesign/analysis_options.yaml
index c78bf18..2160798 100644
--- a/codesign/analysis_options.yaml
+++ b/codesign/analysis_options.yaml
@@ -1,27 +1,4 @@
-# For more information about the core and recommended set of lints, see
-# https://dart.dev/go/core-lints
-
-# For additional information about configuring this file, see
-# https://dart.dev/guides/language/analysis-options
-
-analyzer:
- strong-mode:
- implicit-casts: false
- implicit-dynamic: false
- errors:
- # treat missing required parameters as a warning (not a hint)
- missing_required_param: warning
- # treat missing returns as a warning (not a hint)
- missing_return: warning
- # allow having TODOs in the code
- todo: ignore
- # Ignore analyzer hints for updating pubspecs when using Future or
- # Stream and not importing dart:async
- # Please see https://github.com/flutter/flutter/pull/24528 for details.
- sdk_version_async_exported_from_core: ignore
- implicit_dynamic_parameter: info
-
-include: package:flutter_lints/flutter.yaml
+include: ../analysis_options.yaml
linter:
rules:
@@ -49,8 +26,7 @@
# - avoid_js_rounded_ints # only useful when targeting JS runtime
avoid_null_checks_in_equality_operators: true
# - avoid_positional_boolean_parameters # not yet tested
- # - avoid_private_typedef_functions # we prefer having typedef (discussion in https://github.com/flutter/flutter/pull/16356)
- avoid_relative_lib_imports: true
+ # - avoid_private_typedef_functions # we prefer having typedef (discussion in https://github.com/flutter/flutter/pull/16356) avoid_relative_lib_imports: true
avoid_renaming_method_parameters: true
avoid_return_types_on_setters: true
# - avoid_returning_null # there are plenty of valid reasons to return null
diff --git a/dashboard/analysis_options.yaml b/dashboard/analysis_options.yaml
index 0a801d3..6247623 100644
--- a/dashboard/analysis_options.yaml
+++ b/dashboard/analysis_options.yaml
@@ -1,31 +1,7 @@
-# To be kept in sync with https://github.com/flutter/flutter/blob/master/analysis_options.yaml
-# We don't set `implicit-casts: false` because of JSON code that we'll migrate with NNBD.
-# We remove the exclusions since they don't apply here.
-
+include: ../analysis_options.yaml
analyzer:
strong-mode:
- # implicit-casts: false
- implicit-dynamic: false
- errors:
- # treat missing required parameters as a warning (not a hint)
- missing_required_param: warning
- # treat missing returns as a warning (not a hint)
- missing_return: warning
- # allow having TODOs in the code
- todo: ignore
- # Ignore analyzer hints for updating pubspecs when using Future or
- # Stream and not importing dart:async
- # Please see https://github.com/flutter/flutter/pull/24528 for details.
- sdk_version_async_exported_from_core: ignore
- exclude:
- - ".dart_tool/**"
- - "**/*.g.dart"
- - "**/*.pb.dart"
- - "**/*.pbjson.dart"
- - "**/*.pbenum.dart"
- - "test/utils/mocks.mocks.dart"
-
-include: package:flutter_lints/flutter.yaml
+ implicit-casts: true # TODO remove this
linter:
rules:
prefer_single_quotes: true
diff --git a/dashboard/lib/build_dashboard_page.dart b/dashboard/lib/build_dashboard_page.dart
index 303a9e7..4042306 100644
--- a/dashboard/lib/build_dashboard_page.dart
+++ b/dashboard/lib/build_dashboard_page.dart
@@ -24,9 +24,9 @@
/// The results from tasks run on individual commits is shown in [TaskGrid].
class BuildDashboardPage extends StatefulWidget {
const BuildDashboardPage({
- Key? key,
+ super.key,
this.queryParameters,
- }) : super(key: key);
+ });
static const String routeName = '/build';
diff --git a/dashboard/lib/index_page.dart b/dashboard/lib/index_page.dart
index 6c9fe8c..cf68263 100644
--- a/dashboard/lib/index_page.dart
+++ b/dashboard/lib/index_page.dart
@@ -17,8 +17,8 @@
/// Expects an [IndexState] to be available via [Provider].
class IndexPage extends StatelessWidget {
const IndexPage({
- Key? key,
- }) : super(key: key);
+ super.key,
+ });
static const String routeName = '/';
diff --git a/dashboard/lib/main.dart b/dashboard/lib/main.dart
index e2c1150..47511c0 100644
--- a/dashboard/lib/main.dart
+++ b/dashboard/lib/main.dart
@@ -58,7 +58,7 @@
}
class MyApp extends StatelessWidget {
- const MyApp({Key? key}) : super(key: key);
+ const MyApp({super.key});
@override
Widget build(BuildContext context) {
diff --git a/dashboard/lib/navigation_drawer.dart b/dashboard/lib/navigation_drawer.dart
index 14092a8..9fd57ef 100644
--- a/dashboard/lib/navigation_drawer.dart
+++ b/dashboard/lib/navigation_drawer.dart
@@ -8,7 +8,7 @@
/// Sidebar for navigating the different pages of Cocoon.
class NavigationDrawer extends StatelessWidget {
- const NavigationDrawer({Key? key}) : super(key: key);
+ const NavigationDrawer({super.key});
@override
Widget build(BuildContext context) {
diff --git a/dashboard/lib/widgets/app_bar.dart b/dashboard/lib/widgets/app_bar.dart
index 5191b7b..40b24ae 100644
--- a/dashboard/lib/widgets/app_bar.dart
+++ b/dashboard/lib/widgets/app_bar.dart
@@ -10,7 +10,7 @@
///
/// The [actions] will always have a [SignInButton] added.
class CocoonAppBar extends StatelessWidget implements PreferredSizeWidget {
- const CocoonAppBar({Key? key, this.title, this.actions, this.backgroundColor}) : super(key: key);
+ const CocoonAppBar({super.key, this.title, this.actions, this.backgroundColor});
final Widget? title;
diff --git a/dashboard/lib/widgets/commit_author_avatar.dart b/dashboard/lib/widgets/commit_author_avatar.dart
index 9c3f23a..36322df 100644
--- a/dashboard/lib/widgets/commit_author_avatar.dart
+++ b/dashboard/lib/widgets/commit_author_avatar.dart
@@ -14,9 +14,9 @@
/// from the avatar's name.
class CommitAuthorAvatar extends StatelessWidget {
const CommitAuthorAvatar({
- Key? key,
+ super.key,
this.commit,
- }) : super(key: key);
+ });
final Commit? commit;
diff --git a/dashboard/lib/widgets/commit_box.dart b/dashboard/lib/widgets/commit_box.dart
index 6fdefe5..b5a7ed6 100644
--- a/dashboard/lib/widgets/commit_box.dart
+++ b/dashboard/lib/widgets/commit_box.dart
@@ -22,9 +22,9 @@
/// will close it.
class CommitBox extends StatefulWidget {
const CommitBox({
- Key? key,
+ super.key,
required this.commit,
- }) : super(key: key);
+ });
/// The commit being shown
final Commit commit;
@@ -68,11 +68,11 @@
/// [closeCallback] that will remove the widget from the tree.
class CommitOverlayContents extends StatelessWidget {
const CommitOverlayContents({
- Key? key,
+ super.key,
required this.parentContext,
required this.commit,
required this.closeCallback,
- }) : super(key: key);
+ });
/// The parent context that has the size of the whole screen
final BuildContext parentContext;
@@ -177,10 +177,10 @@
class Hyperlink extends StatefulWidget {
const Hyperlink({
- Key? key,
+ super.key,
required this.text,
this.onPressed,
- }) : super(key: key);
+ });
final String text;
final VoidCallback? onPressed;
diff --git a/dashboard/lib/widgets/error_brook_watcher.dart b/dashboard/lib/widgets/error_brook_watcher.dart
index 5429078..d335c3b 100644
--- a/dashboard/lib/widgets/error_brook_watcher.dart
+++ b/dashboard/lib/widgets/error_brook_watcher.dart
@@ -14,10 +14,10 @@
/// are displayed as [SnackBar]s on the nearest [Scaffold].
class ErrorBrookWatcher extends StatefulWidget {
const ErrorBrookWatcher({
- Key? key,
+ super.key,
this.errors,
this.child,
- }) : super(key: key);
+ });
final Brook<String>? errors;
diff --git a/dashboard/lib/widgets/filter_property_sheet.dart b/dashboard/lib/widgets/filter_property_sheet.dart
index b0c65d8..3e2820a 100644
--- a/dashboard/lib/widgets/filter_property_sheet.dart
+++ b/dashboard/lib/widgets/filter_property_sheet.dart
@@ -76,10 +76,9 @@
/// A class used to represent a Regular Expression property in the filter object.
class RegExpFilterProperty extends ValueFilterProperty<String?> {
- RegExpFilterProperty({required String fieldName, String? label, String? value, bool caseSensitive = true})
+ RegExpFilterProperty({required super.fieldName, super.label, String? value, bool caseSensitive = true})
: _value = value,
- _caseSensitive = caseSensitive,
- super(fieldName: fieldName, label: label);
+ _caseSensitive = caseSensitive;
String? _value;
final bool _caseSensitive;
@@ -136,10 +135,9 @@
/// A class used to represent a boolean property in the filter object.
class BoolFilterProperty extends ValueFilterProperty<bool?> {
- BoolFilterProperty({required String fieldName, String? label, bool value = true})
+ BoolFilterProperty({required super.fieldName, super.label, bool value = true})
: _value = value,
- _defaultValue = value,
- super(fieldName: fieldName, label: label);
+ _defaultValue = value;
bool? _value;
final bool? _defaultValue;
@@ -195,7 +193,7 @@
/// and notify the creator when it is closed via the callback. Otherwise the creator is
/// responsible for the lifecycle of this sheet.
class FilterPropertySheet extends StatefulWidget {
- const FilterPropertySheet(this.propertySource, {this.onClose, Key? key}) : super(key: key);
+ const FilterPropertySheet(this.propertySource, {this.onClose, super.key});
/// The notifier object used to get the initial value of the filter properties and to
/// send back new filter objects with modified values as the user edits the fields.
diff --git a/dashboard/lib/widgets/header_text.dart b/dashboard/lib/widgets/header_text.dart
index e075c65..4cef1ce 100644
--- a/dashboard/lib/widgets/header_text.dart
+++ b/dashboard/lib/widgets/header_text.dart
@@ -10,8 +10,8 @@
class HeaderText extends StatelessWidget {
const HeaderText(
this.text, {
- Key? key,
- }) : super(key: key);
+ super.key,
+ });
final String text;
diff --git a/dashboard/lib/widgets/lattice.dart b/dashboard/lib/widgets/lattice.dart
index 62f32ac..e645d9c 100644
--- a/dashboard/lib/widgets/lattice.dart
+++ b/dashboard/lib/widgets/lattice.dart
@@ -17,11 +17,11 @@
@immutable
class LatticeCell extends _LatticeCell {
const LatticeCell({
- Painter? painter,
+ super.painter,
this.builder,
- LatticeTapCallback? onTap,
+ super.onTap,
this.taskName,
- }) : super(painter: painter, onTap: onTap);
+ });
final WidgetBuilder? builder;
@@ -38,7 +38,7 @@
/// The cells will be sized according to [cellSize].
class LatticeScrollView extends StatelessWidget {
const LatticeScrollView({
- Key? key,
+ super.key,
this.horizontalPhysics,
this.horizontalController,
this.textDirection,
@@ -47,7 +47,7 @@
this.dragStartBehavior = DragStartBehavior.start,
required this.cells,
required this.cellSize,
- }) : super(key: key);
+ });
final ScrollPhysics? horizontalPhysics;
@@ -112,9 +112,8 @@
class _FakeViewport extends SingleChildRenderObjectWidget {
const _FakeViewport({
- Key? key,
- Widget? child,
- }) : super(key: key, child: child);
+ super.child,
+ });
@override
_RenderFakeViewport createRenderObject(BuildContext context) => _RenderFakeViewport();
@@ -139,13 +138,12 @@
@_public
class _LatticeBody extends RenderObjectWidget {
const _LatticeBody({
- Key? key,
required this.textDirection,
required this.horizontalOffset,
required this.verticalOffset,
required this.cells,
required this.cellSize,
- }) : super(key: key);
+ });
final TextDirection textDirection;
final ViewportOffset horizontalOffset;
@@ -182,7 +180,7 @@
@_public
class _LatticeBodyElement extends RenderObjectElement implements _LatticeDelegate {
- _LatticeBodyElement(_LatticeBody widget) : super(widget);
+ _LatticeBodyElement(_LatticeBody super.widget);
@override
_LatticeBody get widget => super.widget as _LatticeBody;
diff --git a/dashboard/lib/widgets/luci_task_attempt_summary.dart b/dashboard/lib/widgets/luci_task_attempt_summary.dart
index b78024d..c6de2f0 100644
--- a/dashboard/lib/widgets/luci_task_attempt_summary.dart
+++ b/dashboard/lib/widgets/luci_task_attempt_summary.dart
@@ -13,9 +13,9 @@
/// for a Task.
class LuciTaskAttemptSummary extends StatelessWidget {
const LuciTaskAttemptSummary({
- Key? key,
+ super.key,
required this.task,
- }) : super(key: key);
+ });
/// The task to show information from.
final Task task;
diff --git a/dashboard/lib/widgets/now.dart b/dashboard/lib/widgets/now.dart
index d59ce44..cf54f62 100644
--- a/dashboard/lib/widgets/now.dart
+++ b/dashboard/lib/widgets/now.dart
@@ -11,23 +11,19 @@
class Now extends InheritedNotifier<ValueNotifier<DateTime?>> {
/// For production.
Now({
- Key? key,
- required Widget child,
+ super.key,
+ required super.child,
}) : super(
- key: key,
notifier: _Clock(),
- child: child,
);
/// For tests.
Now.fixed({
- Key? key,
+ super.key,
required DateTime dateTime,
- required Widget child,
+ required super.child,
}) : super(
- key: key,
notifier: ValueNotifier<DateTime>(dateTime),
- child: child,
);
static DateTime? of(BuildContext context) {
diff --git a/dashboard/lib/widgets/progress_button.dart b/dashboard/lib/widgets/progress_button.dart
index e8c014b..c968ed2 100644
--- a/dashboard/lib/widgets/progress_button.dart
+++ b/dashboard/lib/widgets/progress_button.dart
@@ -14,10 +14,10 @@
/// to Sunday but...
class ProgressButton extends StatefulWidget {
const ProgressButton({
- Key? key,
+ super.key,
this.child,
this.onPressed,
- }) : super(key: key);
+ });
final Widget? child;
diff --git a/dashboard/lib/widgets/sign_in_button.dart b/dashboard/lib/widgets/sign_in_button.dart
index 1e34ef6..7983f6a 100644
--- a/dashboard/lib/widgets/sign_in_button.dart
+++ b/dashboard/lib/widgets/sign_in_button.dart
@@ -19,9 +19,9 @@
/// Otherwise, a sign in button will show.
class SignInButton extends StatelessWidget {
const SignInButton({
- Key? key,
+ super.key,
this.colorBrightness,
- }) : super(key: key);
+ });
final Brightness? colorBrightness;
diff --git a/dashboard/lib/widgets/state_provider.dart b/dashboard/lib/widgets/state_provider.dart
index 3f8de2a..ad4c492 100644
--- a/dashboard/lib/widgets/state_provider.dart
+++ b/dashboard/lib/widgets/state_provider.dart
@@ -11,12 +11,12 @@
class StateProvider extends StatelessWidget {
const StateProvider({
- Key? key,
+ super.key,
this.signInService,
this.indexState,
this.buildState,
this.child,
- }) : super(key: key);
+ });
final GoogleSignInService? signInService;
@@ -43,14 +43,9 @@
/// the value is a Listenable.
class ValueProvider<T> extends InheritedProvider<T> {
ValueProvider({
- Key? key,
- required T value,
- UpdateShouldNotify<T>? updateShouldNotify,
- Widget? child,
- }) : super.value(
- key: key,
- value: value,
- updateShouldNotify: updateShouldNotify,
- child: child,
- );
+ super.key,
+ required super.value,
+ super.updateShouldNotify,
+ super.child,
+ }) : super.value();
}
diff --git a/dashboard/lib/widgets/task_grid.dart b/dashboard/lib/widgets/task_grid.dart
index afc1d76..2a95f72 100644
--- a/dashboard/lib/widgets/task_grid.dart
+++ b/dashboard/lib/widgets/task_grid.dart
@@ -23,7 +23,7 @@
///
/// If there's no data for [TaskGrid], it shows [CircularProgressIndicator].
class TaskGridContainer extends StatelessWidget {
- const TaskGridContainer({Key? key, this.filter, this.useAnimatedLoading = false}) : super(key: key);
+ const TaskGridContainer({super.key, this.filter, this.useAnimatedLoading = false});
/// A notifier to hold a [TaskGridFilter] object to control the visibility of various
/// rows and columns of the task grid. This filter may be updated dynamically through
@@ -72,14 +72,14 @@
/// are the results from tasks.
class TaskGrid extends StatefulWidget {
const TaskGrid({
- Key? key,
+ super.key,
// TODO(ianh): We really shouldn't take both of these, since buildState exposes status as well;
// it's asking for trouble because the tests can (and do) describe a mutually inconsistent state.
required this.buildState,
required this.commitStatuses,
this.filter,
this.useAnimatedLoading = false,
- }) : super(key: key);
+ });
/// The build status data to display in the grid.
final List<CommitStatus> commitStatuses;
diff --git a/dashboard/lib/widgets/task_icon.dart b/dashboard/lib/widgets/task_icon.dart
index a978d1a..5f00ecc 100644
--- a/dashboard/lib/widgets/task_icon.dart
+++ b/dashboard/lib/widgets/task_icon.dart
@@ -15,9 +15,9 @@
/// it can't be mapped. On tap, shows the task.
class TaskIcon extends StatelessWidget {
const TaskIcon({
- Key? key,
+ super.key,
required this.qualifiedTask,
- }) : super(key: key);
+ });
/// [Task] to get information from.
final QualifiedTask qualifiedTask;
diff --git a/dashboard/lib/widgets/task_overlay.dart b/dashboard/lib/widgets/task_overlay.dart
index 3052896..3cf85a2 100644
--- a/dashboard/lib/widgets/task_overlay.dart
+++ b/dashboard/lib/widgets/task_overlay.dart
@@ -80,14 +80,14 @@
/// [closeCallback] that will remove the widget from the tree.
class TaskOverlayEntry extends StatelessWidget {
const TaskOverlayEntry({
- Key? key,
+ super.key,
required this.position,
required this.task,
required this.showSnackBarCallback,
required this.closeCallback,
required this.buildState,
required this.commit,
- }) : super(key: key);
+ });
/// The global position where to show the task overlay.
final Offset position;
@@ -162,13 +162,13 @@
/// this [Task] through the build system.
class TaskOverlayContents extends StatelessWidget {
const TaskOverlayContents({
- Key? key,
+ super.key,
required this.showSnackBarCallback,
required this.buildState,
required this.task,
required this.closeCallback,
this.commit,
- }) : super(key: key);
+ });
final ShowSnackBarCallback showSnackBarCallback;
diff --git a/dashboard/lib/widgets/web_image.dart b/dashboard/lib/widgets/web_image.dart
index e0ed63d..ab90092 100644
--- a/dashboard/lib/widgets/web_image.dart
+++ b/dashboard/lib/widgets/web_image.dart
@@ -13,14 +13,13 @@
/// HTTP errors in tests by default.
class WebImage extends StatelessWidget {
const WebImage({
- Key? key,
+ super.key,
bool? enabled,
this.imageUrl,
this.placeholder,
this.width = 50,
this.height = 50,
- }) : _enabled = enabled,
- super(key: key);
+ }) : _enabled = enabled;
final bool? _enabled;
bool? get enabled {
diff --git a/dashboard/pubspec.lock b/dashboard/pubspec.lock
index 80d3164..9c194aa 100644
--- a/dashboard/pubspec.lock
+++ b/dashboard/pubspec.lock
@@ -7,21 +7,21 @@
name: _fe_analyzer_shared
url: "https://pub.dartlang.org"
source: hosted
- version: "31.0.0"
+ version: "46.0.0"
analyzer:
dependency: transitive
description:
name: analyzer
url: "https://pub.dartlang.org"
source: hosted
- version: "2.8.0"
+ version: "4.6.0"
args:
dependency: transitive
description:
name: args
url: "https://pub.dartlang.org"
source: hosted
- version: "2.3.0"
+ version: "2.3.1"
async:
dependency: transitive
description:
@@ -42,7 +42,7 @@
name: build
url: "https://pub.dartlang.org"
source: hosted
- version: "2.2.1"
+ version: "2.3.0"
build_config:
dependency: transitive
description:
@@ -63,7 +63,7 @@
name: build_resolvers
url: "https://pub.dartlang.org"
source: hosted
- version: "2.0.4"
+ version: "2.0.9"
build_runner:
dependency: "direct dev"
description:
@@ -91,7 +91,7 @@
name: built_value
url: "https://pub.dartlang.org"
source: hosted
- version: "8.1.4"
+ version: "8.4.1"
characters:
dependency: transitive
description:
@@ -99,13 +99,6 @@
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.1"
- charcode:
- dependency: transitive
- description:
- name: charcode
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.3.1"
checked_yaml:
dependency: transitive
description:
@@ -113,13 +106,6 @@
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
- cli_util:
- dependency: transitive
- description:
- name: cli_util
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.3.5"
clock:
dependency: transitive
description:
@@ -133,7 +119,7 @@
name: code_builder
url: "https://pub.dartlang.org"
source: hosted
- version: "4.1.0"
+ version: "4.2.0"
collection:
dependency: "direct main"
description:
@@ -147,21 +133,21 @@
name: convert
url: "https://pub.dartlang.org"
source: hosted
- version: "3.0.1"
+ version: "3.0.2"
crypto:
dependency: transitive
description:
name: crypto
url: "https://pub.dartlang.org"
source: hosted
- version: "3.0.1"
+ version: "3.0.2"
dart_style:
dependency: transitive
description:
name: dart_style
url: "https://pub.dartlang.org"
source: hosted
- version: "2.1.1"
+ version: "2.2.3"
fake_async:
dependency: transitive
description:
@@ -175,14 +161,14 @@
name: file
url: "https://pub.dartlang.org"
source: hosted
- version: "6.1.2"
+ version: "6.1.4"
fixnum:
dependency: "direct main"
description:
name: fixnum
url: "https://pub.dartlang.org"
source: hosted
- version: "1.0.0"
+ version: "1.0.1"
flutter:
dependency: "direct main"
description: flutter
@@ -218,14 +204,14 @@
name: frontend_server_client
url: "https://pub.dartlang.org"
source: hosted
- version: "2.1.2"
+ version: "2.1.3"
glob:
dependency: transitive
description:
name: glob
url: "https://pub.dartlang.org"
source: hosted
- version: "2.0.2"
+ version: "2.1.0"
google_sign_in:
dependency: "direct main"
description:
@@ -260,7 +246,7 @@
name: google_sign_in_web
url: "https://pub.dartlang.org"
source: hosted
- version: "0.10.0+4"
+ version: "0.10.2"
graphs:
dependency: transitive
description:
@@ -274,21 +260,21 @@
name: http
url: "https://pub.dartlang.org"
source: hosted
- version: "0.13.4"
+ version: "0.13.5"
http_multi_server:
dependency: transitive
description:
name: http_multi_server
url: "https://pub.dartlang.org"
source: hosted
- version: "3.2.0"
+ version: "3.2.1"
http_parser:
dependency: transitive
description:
name: http_parser
url: "https://pub.dartlang.org"
source: hosted
- version: "4.0.0"
+ version: "4.0.1"
io:
dependency: transitive
description:
@@ -351,14 +337,14 @@
name: mime
url: "https://pub.dartlang.org"
source: hosted
- version: "1.0.1"
+ version: "1.0.2"
mockito:
dependency: "direct dev"
description:
name: mockito
url: "https://pub.dartlang.org"
source: hosted
- version: "5.0.15"
+ version: "5.3.0"
nested:
dependency: transitive
description:
@@ -372,7 +358,7 @@
name: package_config
url: "https://pub.dartlang.org"
source: hosted
- version: "2.0.2"
+ version: "2.1.0"
path:
dependency: "direct dev"
description:
@@ -380,13 +366,6 @@
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.2"
- pedantic:
- dependency: transitive
- description:
- name: pedantic
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.11.1"
plugin_platform_interface:
dependency: transitive
description:
@@ -400,56 +379,56 @@
name: pool
url: "https://pub.dartlang.org"
source: hosted
- version: "1.5.0"
+ version: "1.5.1"
protobuf:
dependency: "direct main"
description:
name: protobuf
url: "https://pub.dartlang.org"
source: hosted
- version: "2.0.1"
+ version: "2.1.0"
provider:
dependency: "direct main"
description:
name: provider
url: "https://pub.dartlang.org"
source: hosted
- version: "6.0.2"
+ version: "6.0.3"
pub_semver:
dependency: transitive
description:
name: pub_semver
url: "https://pub.dartlang.org"
source: hosted
- version: "2.1.0"
+ version: "2.1.1"
pubspec_parse:
dependency: transitive
description:
name: pubspec_parse
url: "https://pub.dartlang.org"
source: hosted
- version: "1.2.0"
+ version: "1.2.1"
quiver:
dependency: transitive
description:
name: quiver
url: "https://pub.dartlang.org"
source: hosted
- version: "3.0.1+1"
+ version: "3.1.0"
shelf:
dependency: transitive
description:
name: shelf
url: "https://pub.dartlang.org"
source: hosted
- version: "1.2.0"
+ version: "1.3.2"
shelf_web_socket:
dependency: transitive
description:
name: shelf_web_socket
url: "https://pub.dartlang.org"
source: hosted
- version: "1.0.1"
+ version: "1.0.2"
sky_engine:
dependency: transitive
description: flutter
@@ -461,7 +440,7 @@
name: source_gen
url: "https://pub.dartlang.org"
source: hosted
- version: "1.0.3"
+ version: "1.2.2"
source_span:
dependency: transitive
description:
@@ -524,7 +503,7 @@
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
- version: "1.3.0"
+ version: "1.3.1"
url_launcher:
dependency: "direct main"
description:
@@ -538,28 +517,28 @@
name: url_launcher_android
url: "https://pub.dartlang.org"
source: hosted
- version: "6.0.15"
+ version: "6.0.17"
url_launcher_ios:
dependency: transitive
description:
name: url_launcher_ios
url: "https://pub.dartlang.org"
source: hosted
- version: "6.0.15"
+ version: "6.0.17"
url_launcher_linux:
dependency: transitive
description:
name: url_launcher_linux
url: "https://pub.dartlang.org"
source: hosted
- version: "3.0.0"
+ version: "3.0.1"
url_launcher_macos:
dependency: transitive
description:
name: url_launcher_macos
url: "https://pub.dartlang.org"
source: hosted
- version: "3.0.0"
+ version: "3.0.1"
url_launcher_platform_interface:
dependency: "direct dev"
description:
@@ -573,14 +552,14 @@
name: url_launcher_web
url: "https://pub.dartlang.org"
source: hosted
- version: "2.0.6"
+ version: "2.0.13"
url_launcher_windows:
dependency: transitive
description:
name: url_launcher_windows
url: "https://pub.dartlang.org"
source: hosted
- version: "3.0.0"
+ version: "3.0.1"
vector_math:
dependency: transitive
description:
@@ -601,14 +580,14 @@
name: web_socket_channel
url: "https://pub.dartlang.org"
source: hosted
- version: "2.1.0"
+ version: "2.2.0"
yaml:
dependency: transitive
description:
name: yaml
url: "https://pub.dartlang.org"
source: hosted
- version: "3.1.0"
+ version: "3.1.1"
sdks:
- dart: ">=2.17.0-206.0.dev <3.0.0"
- flutter: ">=2.8.0"
+ dart: ">=2.17.0 <3.0.0"
+ flutter: ">=2.10.0"
diff --git a/dashboard/pubspec.yaml b/dashboard/pubspec.yaml
index bd25fb6..ce8c3e9 100644
--- a/dashboard/pubspec.yaml
+++ b/dashboard/pubspec.yaml
@@ -19,7 +19,7 @@
version: 1.0.0+1
environment:
- sdk: '>=2.12.0 <3.0.0'
+ sdk: '>=2.17.0 <3.0.0'
dependencies:
collection: ^1.16.0
diff --git a/dashboard/test/utils/wrapper.dart b/dashboard/test/utils/wrapper.dart
index b7421c9..6f3e38f 100644
--- a/dashboard/test/utils/wrapper.dart
+++ b/dashboard/test/utils/wrapper.dart
@@ -13,7 +13,7 @@
import 'mocks.dart';
class FakeInserter extends StatelessWidget {
- const FakeInserter({Key? key, this.child, this.signedIn = true}) : super(key: key);
+ const FakeInserter({super.key, this.child, this.signedIn = true});
final Widget? child;
diff --git a/dashboard/test/widgets/task_overlay_test.dart b/dashboard/test/widgets/task_overlay_test.dart
index f1b78c3..4cdf926 100644
--- a/dashboard/test/widgets/task_overlay_test.dart
+++ b/dashboard/test/widgets/task_overlay_test.dart
@@ -25,7 +25,7 @@
import '../utils/task_icons.dart';
class TestGrid extends StatelessWidget {
- const TestGrid({this.buildState, required this.task, Key? key}) : super(key: key);
+ const TestGrid({this.buildState, required this.task, super.key});
final BuildState? buildState;
final Task task;