update and fix lints, bump min SDK (dart-lang/pub_semver#74)

diff --git a/pkgs/pub_semver/.github/workflows/test-package.yml b/pkgs/pub_semver/.github/workflows/test-package.yml
index 68f255c..5c5b39d 100644
--- a/pkgs/pub_semver/.github/workflows/test-package.yml
+++ b/pkgs/pub_semver/.github/workflows/test-package.yml
@@ -47,7 +47,7 @@
       matrix:
         # Add macos-latest and/or windows-latest if relevant for this package.
         os: [ubuntu-latest]
-        sdk: [2.12.0, dev]
+        sdk: [2.17.0, dev]
     steps:
       - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
       - uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d
diff --git a/pkgs/pub_semver/CHANGELOG.md b/pkgs/pub_semver/CHANGELOG.md
index b034632..e23ce10 100644
--- a/pkgs/pub_semver/CHANGELOG.md
+++ b/pkgs/pub_semver/CHANGELOG.md
@@ -1,3 +1,7 @@
+# 2.1.3-dev
+
+- Require Dart 2.17.
+
 # 2.1.2
 
 - Add markdown badges to the readme.
@@ -16,10 +20,6 @@
 # 2.0.0
 
 - Stable null safety release.
-
-# 2.0.0-nullsafety.0
-
-- Migrate to null safety.
 - `Version.primary` now throws `StateError` if the `versions` argument is empty.
 
 # 1.4.4
diff --git a/pkgs/pub_semver/analysis_options.yaml b/pkgs/pub_semver/analysis_options.yaml
index 0569680..56d7c90 100644
--- a/pkgs/pub_semver/analysis_options.yaml
+++ b/pkgs/pub_semver/analysis_options.yaml
@@ -1,58 +1,55 @@
+# https://dart.dev/guides/language/analysis-options
 include: package:lints/recommended.yaml
 
 analyzer:
   language:
     strict-casts: true
     strict-inference: true
+    strict-raw-types: true
 
 linter:
   rules:
+    - always_declare_return_types
     - avoid_bool_literals_in_conditional_expressions
+    - avoid_catching_errors
     - avoid_classes_with_only_static_members
-    - avoid_function_literals_in_foreach_calls
-    - avoid_renaming_method_parameters
+    - avoid_dynamic_calls
+    - avoid_private_typedef_functions
+    - avoid_redundant_argument_values
     - avoid_returning_null
     - avoid_returning_null_for_future
-    - avoid_returning_null_for_void
     - avoid_returning_this
-    - avoid_single_cascade_in_expression_statements
     - avoid_unused_constructor_parameters
-    - await_only_futures
-    - camel_case_types
+    - avoid_void_async
     - cancel_subscriptions
     - cascade_invocations
     - comment_references
-    - constant_identifier_names
-    - control_flow_in_finally
     - directives_ordering
-    - empty_statements
-    - file_names
-    - hash_and_equals
-    - implementation_imports
-    - iterable_contains_unrelated_type
     - join_return_with_assignment
-    - list_remove_unrelated_type
+    - lines_longer_than_80_chars
     - literal_only_boolean_expressions
+    - missing_whitespace_between_adjacent_strings
     - no_adjacent_strings_in_list
-    - non_constant_identifier_names
+    - no_runtimeType_toString
+    - omit_local_variable_types
     - only_throw_errors
-    - overridden_fields
     - package_api_docs
-    - package_names
-    - package_prefixed_library_names
+    - prefer_asserts_in_initializer_lists
     - prefer_const_constructors
-    #- prefer_final_locals
-    - prefer_initializing_formals
-    - prefer_interpolation_to_compose_strings
-    - prefer_null_aware_operators
-    - prefer_typing_uninitialized_variables
+    - prefer_const_declarations
+    - prefer_expression_function_bodies
+    - prefer_relative_imports
+    - prefer_single_quotes
+    - sort_pub_dependencies
     - test_types_in_equals
     - throw_in_finally
+    - type_annotate_public_apis
+    - unawaited_futures
     - unnecessary_await_in_return
-    - unnecessary_brace_in_string_interps
-    - unnecessary_getters_setters
     - unnecessary_lambdas
-    - unnecessary_null_aware_assignments
     - unnecessary_parenthesis
     - unnecessary_statements
-    - void_checks
+    - use_if_null_to_convert_nulls_to_bools
+    - use_raw_strings
+    - use_string_buffers
+    - use_super_parameters
diff --git a/pkgs/pub_semver/lib/src/version.dart b/pkgs/pub_semver/lib/src/version.dart
index ba6ce8f..f9e5360 100644
--- a/pkgs/pub_semver/lib/src/version.dart
+++ b/pkgs/pub_semver/lib/src/version.dart
@@ -12,7 +12,7 @@
 import 'version_range.dart';
 
 /// The equality operator to use for comparing version components.
-final _equality = const IterableEquality();
+const _equality = IterableEquality();
 
 /// A parsed semantic version number.
 @sealed
@@ -70,14 +70,14 @@
   /// This is split into a list of components, each of which may be either a
   /// string or a non-negative integer. It may also be empty, indicating that
   /// this version has no pre-release identifier.
-  final List preRelease;
+  final List<Object> preRelease;
 
   /// The build identifier: "foo" in "1.2.3+foo".
   ///
   /// This is split into a list of components, each of which may be either a
   /// string or a non-negative integer. It may also be empty, indicating that
   /// this version has no build identifier.
-  final List build;
+  final List<Object> build;
 
   /// The original string representation of the version number.
   ///
@@ -96,7 +96,7 @@
 
   Version._(this.major, this.minor, this.patch, String? preRelease,
       String? build, this._text)
-      : preRelease = preRelease == null ? [] : _splitParts(preRelease),
+      : preRelease = preRelease == null ? <Object>[] : _splitParts(preRelease),
         build = build == null ? [] : _splitParts(build) {
     if (major < 0) throw ArgumentError('Major version must be non-negative.');
     if (minor < 0) throw ArgumentError('Minor version must be non-negative.');
@@ -154,12 +154,13 @@
   /// Splits a string of dot-delimited identifiers into their component parts.
   ///
   /// Identifiers that are numeric are converted to numbers.
-  static List _splitParts(String text) {
-    return text.split('.').map((part) {
-      // Return an integer part if possible, otherwise return the string as-is
-      return int.tryParse(part) ?? part;
-    }).toList();
-  }
+  static List<Object> _splitParts(String text) => text
+      .split('.')
+      .map((part) =>
+          // Return an integer part if possible, otherwise return the string
+          // as-is
+          int.tryParse(part) ?? part)
+      .toList();
 
   @override
   bool operator ==(Object other) =>
@@ -354,7 +355,7 @@
   ///
   /// This is used for the pre-release and build version parts. This follows
   /// Rule 12 of the Semantic Versioning spec (v2.0.0-rc.1).
-  int _compareLists(List a, List b) {
+  int _compareLists(List<Object> a, List<Object> b) {
     for (var i = 0; i < math.max(a.length, b.length); i++) {
       var aPart = (i < a.length) ? a[i] : null;
       var bPart = (i < b.length) ? b[i] : null;
diff --git a/pkgs/pub_semver/lib/src/version_constraint.dart b/pkgs/pub_semver/lib/src/version_constraint.dart
index 50d7c77..3bde491 100644
--- a/pkgs/pub_semver/lib/src/version_constraint.dart
+++ b/pkgs/pub_semver/lib/src/version_constraint.dart
@@ -84,14 +84,11 @@
         case '<=':
           return VersionRange(max: version, includeMax: true);
         case '<':
-          return VersionRange(
-              max: version,
-              includeMax: false,
-              alwaysIncludeMaxPreRelease: true);
+          return VersionRange(max: version, alwaysIncludeMaxPreRelease: true);
         case '>=':
           return VersionRange(min: version, includeMin: true);
         case '>':
-          return VersionRange(min: version, includeMin: false);
+          return VersionRange(min: version);
       }
       throw UnsupportedError(op!);
     }
diff --git a/pkgs/pub_semver/lib/src/version_range.dart b/pkgs/pub_semver/lib/src/version_range.dart
index 9431b09..6f2ed54 100644
--- a/pkgs/pub_semver/lib/src/version_range.dart
+++ b/pkgs/pub_semver/lib/src/version_range.dart
@@ -85,7 +85,7 @@
   VersionRange._(this.min, this.max, this.includeMin, this.includeMax);
 
   @override
-  bool operator ==(other) {
+  bool operator ==(Object other) {
     if (other is! VersionRange) return false;
 
     return min == other.min &&
@@ -294,7 +294,6 @@
         return VersionRange(
             min: min,
             max: max,
-            includeMin: false,
             includeMax: includeMax,
             alwaysIncludeMaxPreRelease: true);
       }
@@ -305,7 +304,6 @@
             min: min,
             max: max,
             includeMin: includeMin,
-            includeMax: false,
             alwaysIncludeMaxPreRelease: true);
       }
 
@@ -314,12 +312,10 @@
             min: min,
             max: other,
             includeMin: includeMin,
-            includeMax: false,
             alwaysIncludeMaxPreRelease: true),
         VersionRange(
             min: other,
             max: max,
-            includeMin: false,
             includeMax: includeMax,
             alwaysIncludeMaxPreRelease: true)
       ]);
diff --git a/pkgs/pub_semver/lib/src/version_union.dart b/pkgs/pub_semver/lib/src/version_union.dart
index 69ae034..844d3b8 100644
--- a/pkgs/pub_semver/lib/src/version_union.dart
+++ b/pkgs/pub_semver/lib/src/version_union.dart
@@ -35,8 +35,8 @@
   ///
   /// It's up to the caller to ensure that the invariants described in [ranges]
   /// are maintained. They are not verified by this constructor. To
-  /// automatically ensure that they're maintained, use [new
-  /// VersionConstraint.unionOf] instead.
+  /// automatically ensure that they're maintained, use
+  /// [VersionConstraint.unionOf] instead.
   VersionUnion.fromRanges(this.ranges);
 
   @override
diff --git a/pkgs/pub_semver/pubspec.yaml b/pkgs/pub_semver/pubspec.yaml
index 623606f..bac8775 100644
--- a/pkgs/pub_semver/pubspec.yaml
+++ b/pkgs/pub_semver/pubspec.yaml
@@ -1,17 +1,17 @@
 name: pub_semver
-version: 2.1.2
+version: 2.1.3-dev
 description: >-
  Versions and version constraints implementing pub's versioning policy. This
  is very similar to vanilla semver, with a few corner cases.
 repository: https://github.com/dart-lang/pub_semver
 
 environment:
-  sdk: '>=2.12.0 <3.0.0'
+  sdk: '>=2.17.0 <3.0.0'
 
 dependencies:
   collection: ^1.15.0
   meta: ^1.3.0
 
 dev_dependencies:
-  lints: ^1.0.0
+  lints: ^2.0.0
   test: ^1.16.0
diff --git a/pkgs/pub_semver/test/utils.dart b/pkgs/pub_semver/test/utils.dart
index 66f103e..bd7aa8f 100644
--- a/pkgs/pub_semver/test/utils.dart
+++ b/pkgs/pub_semver/test/utils.dart
@@ -34,7 +34,7 @@
   _VersionConstraintMatcher(this._expected, this._allow);
 
   @override
-  bool matches(item, Map matchState) =>
+  bool matches(dynamic item, Map<dynamic, dynamic> matchState) =>
       (item is VersionConstraint) &&
       _expected.every((version) => item.allows(version) == _allow);
 
@@ -46,8 +46,8 @@
   }
 
   @override
-  Description describeMismatch(
-      item, Description mismatchDescription, Map matchState, bool verbose) {
+  Description describeMismatch(dynamic item, Description mismatchDescription,
+      Map<dynamic, dynamic> matchState, bool verbose) {
     if (item is! VersionConstraint) {
       mismatchDescription.add('was not a VersionConstraint');
       return mismatchDescription;
diff --git a/pkgs/pub_semver/test/version_range_test.dart b/pkgs/pub_semver/test/version_range_test.dart
index 6e27c3a..5978df0 100644
--- a/pkgs/pub_semver/test/version_range_test.dart
+++ b/pkgs/pub_semver/test/version_range_test.dart
@@ -961,12 +961,11 @@
     test('includeMin comes before !includeMin', () {
       _expectComparesSmaller(
           VersionRange(min: v003, max: v080, includeMin: true),
-          VersionRange(min: v003, max: v080, includeMin: false));
+          VersionRange(min: v003, max: v080));
     });
 
     test('includeMax comes after !includeMax', () {
-      _expectComparesSmaller(
-          VersionRange(min: v003, max: v080, includeMax: false),
+      _expectComparesSmaller(VersionRange(min: v003, max: v080),
           VersionRange(min: v003, max: v080, includeMax: true));
     });
 
diff --git a/pkgs/pub_semver/test/version_test.dart b/pkgs/pub_semver/test/version_test.dart
index 2979706..d7f1197 100644
--- a/pkgs/pub_semver/test/version_test.dart
+++ b/pkgs/pub_semver/test/version_test.dart
@@ -408,4 +408,4 @@
 }
 
 Version _primary(List<String> input) =>
-    Version.primary(input.map((e) => Version.parse(e)).toList());
+    Version.primary(input.map(Version.parse).toList());