Require Dart 2.19, update to latest lints

diff --git a/pkgs/yaml_edit/.github/workflows/test-package.yml b/pkgs/yaml_edit/.github/workflows/test-package.yml
index 26b56ef..95a51db 100644
--- a/pkgs/yaml_edit/.github/workflows/test-package.yml
+++ b/pkgs/yaml_edit/.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, stable, dev]
+        sdk: [2.19.0, stable, dev]
         platform: [vm, chrome]
     steps:
       - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
diff --git a/pkgs/yaml_edit/CHANGELOG.md b/pkgs/yaml_edit/CHANGELOG.md
index cf1c47f..26033e6 100644
--- a/pkgs/yaml_edit/CHANGELOG.md
+++ b/pkgs/yaml_edit/CHANGELOG.md
@@ -1,6 +1,6 @@
-## 2.1.1
+## 2.1.1-dev
 
-- Update to work with an unreleased version of `package:yaml`.
+- Require Dart 2.19
 
 ## 2.1.0
 - **Breaking** `wrapAsYamlNode(value, collectionStyle, scalarStyle)` will apply
@@ -9,7 +9,7 @@
   While this may change the style of the YAML documents written by applications
   that rely on the old behavior, such YAML documents should still be valid.
   Hence, we hope it is reasonable to make this change in a minor release.
-- Fix for cases that can't be encodded correctedly with
+- Fix for cases that can't be encoded correctly with
   `scalarStyle: ScalarStyle.SINGLE_QUOTED`.
 - Fix YamlEditor `appendToList` and `insertIntoList` functions inserts new item into next yaml item
   rather than at end of list.
diff --git a/pkgs/yaml_edit/analysis_options.yaml b/pkgs/yaml_edit/analysis_options.yaml
index 572dd23..d978f81 100644
--- a/pkgs/yaml_edit/analysis_options.yaml
+++ b/pkgs/yaml_edit/analysis_options.yaml
@@ -1 +1 @@
-include: package:lints/recommended.yaml
+include: package:dart_flutter_team_lints/analysis_options.yaml
diff --git a/pkgs/yaml_edit/lib/src/editor.dart b/pkgs/yaml_edit/lib/src/editor.dart
index e9ff05d..d56e2fa 100644
--- a/pkgs/yaml_edit/lib/src/editor.dart
+++ b/pkgs/yaml_edit/lib/src/editor.dart
@@ -14,7 +14,7 @@
 import 'utils.dart';
 import 'wrap.dart';
 
-/// An interface for modififying [YAML][1] documents while preserving comments
+/// An interface for modifying [YAML][1] documents while preserving comments
 /// and whitespaces.
 ///
 /// YAML parsing is supported by `package:yaml`, and modifications are performed
@@ -124,7 +124,7 @@
       if (visited.add(node)) {
         if (node is YamlMap) {
           node.nodes.forEach((key, value) {
-            collectAliases(key);
+            collectAliases(key as YamlNode);
             collectAliases(value);
           });
         } else if (node is YamlList) {
@@ -194,7 +194,8 @@
   /// Sets [value] in the [path].
   ///
   /// There is a subtle difference between [update] and [remove] followed by
-  /// an [insertIntoList], because [update] preserves comments at the same level.
+  /// an [insertIntoList], because [update] preserves comments at the same
+  /// level.
   ///
   /// Throws a [ArgumentError] if [path] is invalid.
   ///
@@ -291,8 +292,8 @@
 
   /// Prepends [value] to the list at [path].
   ///
-  /// Throws a [ArgumentError] if the element at the given path is not a [YamlList]
-  /// or if the path is invalid.
+  /// Throws a [ArgumentError] if the element at the given path is not a
+  /// [YamlList] or if the path is invalid.
   ///
   /// **Example:**
   /// ```dart
@@ -354,11 +355,11 @@
 
     final nodesToRemove = list.nodes.getRange(index, index + deleteCount);
 
-    /// Perform addition of elements before removal to avoid scenarioes where
-    /// a block list gets emptied out to {} to avoid changing collection styles
-    /// where possible.
+    // Perform addition of elements before removal to avoid scenarios where
+    // a block list gets emptied out to {} to avoid changing collection styles
+    // where possible.
 
-    /// Reverse [values] and insert them.
+    // Reverse [values] and insert them.
     final reversedValues = values.toList().reversed;
     for (final value in reversedValues) {
       insertIntoList(path, index, value);
@@ -512,7 +513,9 @@
       final keyList = node.keys.toList();
       for (var i = 0; i < node.length; i++) {
         final updatedPath = [...path, keyList[i]];
-        if (_aliases.contains(keyList[i])) throw AliasError(path, keyList[i]);
+        if (_aliases.contains(keyList[i])) {
+          throw AliasError(path, keyList[i] as YamlNode);
+        }
         _assertNoChildAlias(updatedPath, node.nodes[keyList[i]]);
       }
     }
@@ -604,8 +607,11 @@
     if (tree is YamlMap) {
       return updatedYamlMap(
           tree,
-          (nodes) => nodes[keyOrIndex] = _deepModify(nodes[keyOrIndex], path,
-              path.take(subPath.length + 1), expectedNode));
+          (nodes) => nodes[keyOrIndex] = _deepModify(
+              nodes[keyOrIndex] as YamlNode,
+              path,
+              path.take(subPath.length + 1),
+              expectedNode));
     }
 
     /// Should not ever reach here.
diff --git a/pkgs/yaml_edit/lib/src/equality.dart b/pkgs/yaml_edit/lib/src/equality.dart
index 9c82cab..0c6a952 100644
--- a/pkgs/yaml_edit/lib/src/equality.dart
+++ b/pkgs/yaml_edit/lib/src/equality.dart
@@ -80,7 +80,7 @@
   } else if (value is Iterable) {
     return const IterableEquality().hash(value.map(deepHashCode));
   } else if (value is YamlScalar) {
-    return value.value.hashCode;
+    return (value.value as Object?).hashCode;
   }
 
   return value.hashCode;
@@ -97,7 +97,7 @@
   final keyIterator = map.nodes.keys.iterator;
   while (keyIterator.moveNext()) {
     if (deepEquals(keyIterator.current, key) && keyIterator.moveNext()) {
-      return keyIterator.current;
+      return keyIterator.current as YamlNode?;
     }
   }
 
diff --git a/pkgs/yaml_edit/lib/src/errors.dart b/pkgs/yaml_edit/lib/src/errors.dart
index e44ee4d..a07a11f 100644
--- a/pkgs/yaml_edit/lib/src/errors.dart
+++ b/pkgs/yaml_edit/lib/src/errors.dart
@@ -59,11 +59,11 @@
 
   AliasError(this.path, this.anchor)
       : super('Encountered an alias node along $path! '
-            'Alias nodes are nodes that refer to a previously serialized nodes, '
-            'and are denoted by either the "*" or the "&" indicators in the '
-            'original YAML. As the resulting behavior of mutations on these '
-            'nodes is not well-defined, the operation will not be supported '
-            'by this library.\n\n'
+            'Alias nodes are nodes that refer to a previously serialized '
+            'nodes, and are denoted by either the "*" or the "&" indicators in '
+            'the original YAML. As the resulting behavior of mutations on '
+            'these nodes is not well-defined, the operation will not be '
+            'supported by this library.\n\n'
             '${anchor.span.message('The alias was first defined here.')}');
 }
 
diff --git a/pkgs/yaml_edit/lib/src/list_mutations.dart b/pkgs/yaml_edit/lib/src/list_mutations.dart
index 6e2368e..1d02ded 100644
--- a/pkgs/yaml_edit/lib/src/list_mutations.dart
+++ b/pkgs/yaml_edit/lib/src/list_mutations.dart
@@ -38,8 +38,7 @@
     if ((newValue is List && (newValue as List).isNotEmpty) ||
         (newValue is Map && (newValue as Map).isNotEmpty)) {
       valueString = valueString.substring(indentation);
-    } else if (isCollection(currValue) &&
-        getStyle(currValue) == CollectionStyle.BLOCK) {
+    } else if (currValue.collectionStyle == CollectionStyle.BLOCK) {
       valueString += lineEnding;
     }
 
@@ -47,7 +46,7 @@
     if (end <= offset) {
       offset++;
       end = offset;
-      valueString = ' ' + valueString;
+      valueString = ' $valueString';
     }
 
     return SourceEdit(offset, end - offset, valueString);
@@ -107,14 +106,16 @@
 }
 
 /// Returns a [SourceEdit] describing the change to be made on [yaml] to achieve
-/// the effect of addition [item] into [nodes], noting that this is a block list.
+/// the effect of addition [item] into [nodes], noting that this is a block
+/// list.
 SourceEdit _appendToBlockList(
     YamlEditor yamlEdit, YamlList list, YamlNode item) {
   var formattedValue = _formatNewBlock(yamlEdit, list, item);
   final yaml = yamlEdit.toString();
   var offset = list.span.end.offset;
 
-  // Adjusts offset to after the trailing newline of the last entry, if it exists
+  // Adjusts offset to after the trailing newline of the last entry, if it
+  // exists
   if (list.isNotEmpty) {
     final lastValueSpanEnd = list.nodes.last.span.end.offset;
     final nextNewLineIndex = yaml.indexOf('\n', lastValueSpanEnd - 1);
@@ -139,7 +140,7 @@
   if (isCollection(item) && !isFlowYamlCollectionNode(item) && !isEmpty(item)) {
     valueString = valueString.substring(newIndentation);
   }
-  final indentedHyphen = ' ' * listIndentation + '- ';
+  final indentedHyphen = '${' ' * listIndentation}- ';
 
   return '$indentedHyphen$valueString$lineEnding';
 }
diff --git a/pkgs/yaml_edit/lib/src/map_mutations.dart b/pkgs/yaml_edit/lib/src/map_mutations.dart
index 62d4081..5ae82f3 100644
--- a/pkgs/yaml_edit/lib/src/map_mutations.dart
+++ b/pkgs/yaml_edit/lib/src/map_mutations.dart
@@ -87,9 +87,9 @@
   if (isCollection(newValue) &&
       !isFlowYamlCollectionNode(newValue) &&
       !isEmpty(newValue)) {
-    formattedValue += '$keyString:' + lineEnding + valueString + lineEnding;
+    formattedValue += '$keyString:$lineEnding$valueString$lineEnding';
   } else {
-    formattedValue += '$keyString: ' + valueString + lineEnding;
+    formattedValue += '$keyString: $valueString$lineEnding';
   }
 
   return SourceEdit(offset, 0, formattedValue);
@@ -141,7 +141,7 @@
 
   if (!valueAsString.startsWith(lineEnding)) {
     // prepend whitespace to ensure there is space after colon.
-    valueAsString = ' ' + valueAsString;
+    valueAsString = ' $valueAsString';
   }
 
   /// +1 accounts for the colon
diff --git a/pkgs/yaml_edit/lib/src/source_edit.dart b/pkgs/yaml_edit/lib/src/source_edit.dart
index 1772397..bb70c2c 100644
--- a/pkgs/yaml_edit/lib/src/source_edit.dart
+++ b/pkgs/yaml_edit/lib/src/source_edit.dart
@@ -15,7 +15,8 @@
 /// ```
 /// foo: barbar
 /// ```
-/// will be represented by `SourceEdit(offset: 4, length: 3, replacement: 'bar')`
+/// will be represented by
+/// `SourceEdit(offset: 4, length: 3, replacement: 'bar')`
 @sealed
 class SourceEdit {
   /// The offset from the start of the string where the modification begins.
diff --git a/pkgs/yaml_edit/lib/src/strings.dart b/pkgs/yaml_edit/lib/src/strings.dart
index f156afe..8767c1b 100644
--- a/pkgs/yaml_edit/lib/src/strings.dart
+++ b/pkgs/yaml_edit/lib/src/strings.dart
@@ -3,6 +3,7 @@
 // BSD-style license that can be found in the LICENSE file.
 
 import 'package:yaml/yaml.dart';
+
 import 'utils.dart';
 
 /// Given [value], tries to format it into a plain string recognizable by YAML.
@@ -100,9 +101,9 @@
   final removedPortion = string.substring(trimmedString.length);
 
   if (removedPortion.contains('\n')) {
-    result = '>+\n' + ' ' * indentation;
+    result = '>+\n${' ' * indentation}';
   } else {
-    result = '>-\n' + ' ' * indentation;
+    result = '>-\n${' ' * indentation}';
   }
 
   /// Duplicating the newline for folded strings preserves it in YAML.
@@ -131,15 +132,15 @@
 /// if possible.
 ///
 /// If [value] is a [YamlScalar], we try to respect its [style] parameter where
-/// possible. Certain cases make this impossible (e.g. a plain string scalar that
-/// starts with '>'), in which case we will produce [value] with default styling
-/// options.
+/// possible. Certain cases make this impossible (e.g. a plain string scalar
+/// that starts with '>'), in which case we will produce [value] with default
+/// styling options.
 String _yamlEncodeFlowScalar(YamlNode value) {
   if (value is YamlScalar) {
     assertValidScalar(value.value);
 
-    if (value.value is String) {
-      final val = value.value as String;
+    final val = value.value;
+    if (val is String) {
       if (_hasUnprintableCharacters(val) ||
           value.style == ScalarStyle.DOUBLE_QUOTED) {
         return _yamlEncodeDoubleQuoted(val);
@@ -172,8 +173,8 @@
   if (value is YamlScalar) {
     assertValidScalar(value.value);
 
-    if (value.value is String) {
-      final val = value.value as String;
+    final val = value.value;
+    if (val is String) {
       if (_hasUnprintableCharacters(val)) {
         return _yamlEncodeDoubleQuoted(val);
       }
@@ -215,15 +216,15 @@
     final list = value.nodes;
 
     final safeValues = list.map(yamlEncodeFlowString);
-    return '[' + safeValues.join(', ') + ']';
+    return '[${safeValues.join(', ')}]';
   } else if (value is YamlMap) {
     final safeEntries = value.nodes.entries.map((entry) {
-      final safeKey = yamlEncodeFlowString(entry.key);
+      final safeKey = yamlEncodeFlowString(entry.key as YamlNode);
       final safeValue = yamlEncodeFlowString(entry.value);
       return '$safeKey: $safeValue';
     });
 
-    return '{' + safeEntries.join(', ') + '}';
+    return '{${safeEntries.join(', ')}}';
   }
 
   return _yamlEncodeFlowScalar(value);
@@ -244,7 +245,7 @@
   final newIndentation = indentation + additionalIndentation;
 
   if (value is YamlList) {
-    if (value.isEmpty) return ' ' * indentation + '[]';
+    if (value.isEmpty) return '${' ' * indentation}[]';
 
     Iterable<String> safeValues;
 
@@ -257,15 +258,15 @@
         valueString = valueString.substring(newIndentation);
       }
 
-      return ' ' * indentation + '- $valueString';
+      return '${' ' * indentation}- $valueString';
     });
 
     return safeValues.join(lineEnding);
   } else if (value is YamlMap) {
-    if (value.isEmpty) return ' ' * indentation + '{}';
+    if (value.isEmpty) return '${' ' * indentation}{}';
 
     return value.nodes.entries.map((entry) {
-      final safeKey = yamlEncodeFlowString(entry.key);
+      final safeKey = yamlEncodeFlowString(entry.key as YamlNode);
       final formattedKey = ' ' * indentation + safeKey;
       final formattedValue =
           yamlEncodeBlockString(entry.value, newIndentation, lineEnding);
@@ -273,10 +274,10 @@
       /// Empty collections are always encoded in flow-style, so new-line must
       /// be avoided
       if (isCollection(entry.value) && !isEmpty(entry.value)) {
-        return formattedKey + ':\n' + formattedValue;
+        return '$formattedKey:\n$formattedValue';
       }
 
-      return formattedKey + ': ' + formattedValue;
+      return '$formattedKey: $formattedValue';
     }).join(lineEnding);
   }
 
diff --git a/pkgs/yaml_edit/lib/src/utils.dart b/pkgs/yaml_edit/lib/src/utils.dart
index 5d06f54..a84db3c 100644
--- a/pkgs/yaml_edit/lib/src/utils.dart
+++ b/pkgs/yaml_edit/lib/src/utils.dart
@@ -7,18 +7,19 @@
 
 import 'editor.dart';
 
-/// Determines if [string] is dangerous by checking if parsing the plain string can
-/// return a result different from [string].
+/// Determines if [string] is dangerous by checking if parsing the plain string
+/// can return a result different from [string].
 ///
-/// This function is also capable of detecting if non-printable characters are in
-/// [string].
+/// This function is also capable of detecting if non-printable characters are
+/// in [string].
 bool isDangerousString(String string) {
   try {
     if (loadYamlNode(string).value != string) {
       return true;
     }
 
-    /// [string] should also not contain the `[`, `]`, `,`, `{` and `}` indicator characters.
+    // [string] should also not contain the `[`, `]`, `,`, `{` and `}` indicator
+    // characters.
     return string.contains(RegExp(r'\{|\[|\]|\}|,'));
   } catch (e) {
     /// This catch statement catches [ArgumentError] in `loadYamlNode` when
@@ -41,8 +42,8 @@
 
 /// Checks if [node] is a [YamlNode] with block styling.
 ///
-/// [ScalarStyle.ANY] and [CollectionStyle.ANY] are considered to be block styling
-/// by default for maximum flexibility.
+/// [ScalarStyle.ANY] and [CollectionStyle.ANY] are considered to be block
+/// styling by default for maximum flexibility.
 bool isBlockNode(YamlNode node) {
   if (node is YamlScalar) {
     if (node.style == ScalarStyle.LITERAL ||
@@ -62,8 +63,8 @@
   return false;
 }
 
-/// Returns the content sensitive ending offset of [yamlNode] (i.e. where the last
-/// meaningful content happens)
+/// Returns the content sensitive ending offset of [yamlNode] (i.e. where the
+/// last meaningful content happens)
 int getContentSensitiveEnd(YamlNode yamlNode) {
   if (yamlNode is YamlList) {
     if (yamlNode.style == CollectionStyle.FLOW) {
@@ -111,18 +112,14 @@
 }
 
 /// Returns if [value] is a [YamlList] or [YamlMap] with [CollectionStyle.FLOW].
-bool isFlowYamlCollectionNode(Object value) {
-  if (value is YamlList || value is YamlMap) {
-    return (value as dynamic).style == CollectionStyle.FLOW;
-  }
+bool isFlowYamlCollectionNode(Object value) =>
+    value is YamlNode && value.collectionStyle == CollectionStyle.FLOW;
 
-  return false;
-}
-
-/// Determines the index where [newKey] will be inserted if the keys in [map] are in
-/// alphabetical order when converted to strings.
+/// Determines the index where [newKey] will be inserted if the keys in [map]
+/// are in alphabetical order when converted to strings.
 ///
-/// Returns the length of [map] if the keys in [map] are not in alphabetical order.
+/// Returns the length of [map] if the keys in [map] are not in alphabetical
+/// order.
 int getMapInsertionIndex(YamlMap map, Object newKey) {
   final keys = map.nodes.keys.map((k) => k.toString()).toList();
 
@@ -140,15 +137,6 @@
   return map.length;
 }
 
-/// Returns the [style] property of [target], if it is a [YamlNode]. Otherwise return null.
-Object? getStyle(Object target) {
-  if (target is YamlNode) {
-    return (target as dynamic).style;
-  }
-
-  return null;
-}
-
 /// Returns the detected indentation step used in [yaml], or
 /// defaults to a value of `2` if no indentation step can be detected.
 ///
@@ -239,7 +227,7 @@
 /// Returns the detected line ending used in [yaml], more specifically, whether
 /// [yaml] appears to use Windows `\r\n` or Unix `\n` line endings.
 ///
-/// The heuristic used is to count all `\n` in the text and if stricly more
+/// The heuristic used is to count all `\n` in the text and if strictly more
 /// than half of them are preceded by `\r` we report that windows line endings
 /// are used.
 String getLineEnding(String yaml) {
@@ -256,3 +244,16 @@
 
   return windowsNewlines > unixNewlines ? '\r\n' : '\n';
 }
+
+extension YamlNodeExtension on YamlNode {
+  /// Returns the [CollectionStyle] of `this` if `this` is [YamlMap] or
+  /// [YamlList].
+  ///
+  /// Otherwise, returns `null`.
+  CollectionStyle? get collectionStyle {
+    final me = this;
+    if (me is YamlMap) return me.style;
+    if (me is YamlList) return me.style;
+    return null;
+  }
+}
diff --git a/pkgs/yaml_edit/lib/src/wrap.dart b/pkgs/yaml_edit/lib/src/wrap.dart
index 8299a00..9d4b684 100644
--- a/pkgs/yaml_edit/lib/src/wrap.dart
+++ b/pkgs/yaml_edit/lib/src/wrap.dart
@@ -152,7 +152,7 @@
   dynamic operator [](Object? key) => nodes[key]?.value;
 
   @override
-  Iterable get keys => nodes.keys.map((node) => node.value);
+  Iterable get keys => nodes.keys.map((node) => (node as YamlNode).value);
 
   @override
   Map get value => this;
@@ -207,7 +207,7 @@
   dynamic operator [](int index) => nodes[index].value;
 
   @override
-  operator []=(int index, value) {
+  void operator []=(int index, Object? value) {
     throw UnsupportedError('Cannot modify an unmodifiable List');
   }
 
diff --git a/pkgs/yaml_edit/pubspec.yaml b/pkgs/yaml_edit/pubspec.yaml
index 8ddaafb..a2360fe 100644
--- a/pkgs/yaml_edit/pubspec.yaml
+++ b/pkgs/yaml_edit/pubspec.yaml
@@ -1,11 +1,11 @@
 name: yaml_edit
-version: 2.1.1
+version: 2.1.1-dev
 description: A library for YAML manipulation with comment and whitespace preservation.
 repository: https://github.com/dart-lang/yaml_edit
 issue_tracker: https://github.com/dart-lang/yaml_edit/issues
 
 environment:
-  sdk: ">=2.12.0 <3.0.0"
+  sdk: ">=2.19.0 <3.0.0"
 
 dependencies:
   collection: ^1.15.0
@@ -14,7 +14,7 @@
   yaml: ^3.1.0
 
 dev_dependencies:
-  lints: ^1.0.1
+  coverage: # we only need format_coverage, don't care what version
+  dart_flutter_team_lints: ^1.0.0
   path: ^1.8.0
   test: ^1.17.12
-  coverage: # we only need format_coverage, don't care what version
diff --git a/pkgs/yaml_edit/test/golden_test.dart b/pkgs/yaml_edit/test/golden_test.dart
index c1f65b8..1dd6ff3 100644
--- a/pkgs/yaml_edit/test/golden_test.dart
+++ b/pkgs/yaml_edit/test/golden_test.dart
@@ -3,6 +3,8 @@
 // BSD-style license that can be found in the LICENSE file.
 
 @TestOn('vm')
+library;
+
 import 'dart:io';
 import 'dart:isolate';
 
diff --git a/pkgs/yaml_edit/test/parse_test.dart b/pkgs/yaml_edit/test/parse_test.dart
index dcad05c..382307c 100644
--- a/pkgs/yaml_edit/test/parse_test.dart
+++ b/pkgs/yaml_edit/test/parse_test.dart
@@ -127,7 +127,7 @@
       final doc = YamlEditor("YAML: ['Y', 'A', 'M', 'L']");
       final expectedYamlMap = doc.parseAt([]);
 
-      expect(() => (expectedYamlMap as YamlMap)['YAML'][0] = 'X',
+      expect(() => ((expectedYamlMap as YamlMap)['YAML'] as List)[0] = 'X',
           throwsUnsupportedError);
     });
   });
diff --git a/pkgs/yaml_edit/test/problem_strings.dart b/pkgs/yaml_edit/test/problem_strings.dart
index 43c2070..527a9e0 100644
--- a/pkgs/yaml_edit/test/problem_strings.dart
+++ b/pkgs/yaml_edit/test/problem_strings.dart
@@ -2,6 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+// ignore_for_file: lines_longer_than_80_chars
+
 const problemStrings = [
   '[]',
   '{}',
diff --git a/pkgs/yaml_edit/test/random_test.dart b/pkgs/yaml_edit/test/random_test.dart
index 08207df..0502df4 100644
--- a/pkgs/yaml_edit/test/random_test.dart
+++ b/pkgs/yaml_edit/test/random_test.dart
@@ -206,13 +206,14 @@
           case YamlModificationMethod.insert:
             args.add(nextInt(node.length + 1));
             args.add(nextYamlNode());
-            editor.insertIntoList(path, args[0], args[1]);
+            editor.insertIntoList(path, args[0] as int, args[1]);
             break;
           case YamlModificationMethod.splice:
             args.add(nextInt(node.length + 1));
-            args.add(nextInt(node.length + 1 - args[0] as int));
+            args.add(nextInt(node.length + 1 - (args[0] as int)));
             args.add(nextYamlList(0));
-            editor.spliceList(path, args[0], args[1], args[2]);
+            editor.spliceList(
+                path, args[0] as int, args[1] as int, args[2] as List);
             break;
         }
         return;
diff --git a/pkgs/yaml_edit/test/source_edit_test.dart b/pkgs/yaml_edit/test/source_edit_test.dart
index 61b7c9b..693455e 100644
--- a/pkgs/yaml_edit/test/source_edit_test.dart
+++ b/pkgs/yaml_edit/test/source_edit_test.dart
@@ -128,8 +128,11 @@
 
         final result = SourceEdit.applyAll(original, sourceEdits);
 
-        expect(result,
-            "YAML Ain't Markup Language: YAML Ain't Markup Language Ain't Markup Language");
+        expect(
+          result,
+          "YAML Ain't Markup Language: YAML Ain't Markup Language Ain't Markup "
+          'Language',
+        );
       });
     });
   });
diff --git a/pkgs/yaml_edit/test/splice_test.dart b/pkgs/yaml_edit/test/splice_test.dart
index 867959a..a7bc196 100644
--- a/pkgs/yaml_edit/test/splice_test.dart
+++ b/pkgs/yaml_edit/test/splice_test.dart
@@ -9,8 +9,8 @@
 
 void main() {
   test(
-      'throws RangeError if invalid index + deleteCount combination is passed in',
-      () {
+      'throws RangeError if invalid index + deleteCount combination is '
+      'passed in', () {
     final doc = YamlEditor('[0, 0]');
     expect(() => doc.spliceList([], 1, 5, [1, 2]), throwsRangeError);
   });
diff --git a/pkgs/yaml_edit/test/string_test.dart b/pkgs/yaml_edit/test/string_test.dart
index 20299d4..98d536f 100644
--- a/pkgs/yaml_edit/test/string_test.dart
+++ b/pkgs/yaml_edit/test/string_test.dart
@@ -8,13 +8,13 @@
 
 final _testStrings = [
   "this is a fairly' long string with\nline breaks",
-  "whitespace\n after line breaks",
-  "word",
-  "foo bar",
-  "foo\nbar",
-  "\"",
+  'whitespace\n after line breaks',
+  'word',
+  'foo bar',
+  'foo\nbar',
+  '"',
   '\'',
-  "word\"word",
+  'word"word',
   'word\'word'
 ];
 
diff --git a/pkgs/yaml_edit/test/test_case.dart b/pkgs/yaml_edit/test/test_case.dart
index f408fce..107e4f7 100644
--- a/pkgs/yaml_edit/test/test_case.dart
+++ b/pkgs/yaml_edit/test/test_case.dart
@@ -14,7 +14,7 @@
 
 /// Interface for creating golden Test cases
 class TestCases {
-  final List<_TestCase> testCases;
+  final List<_TestCase> _testCases;
 
   /// Creates a [TestCases] object based on test directory and golden directory
   /// path.
@@ -43,7 +43,7 @@
     var tested = 0;
     var created = 0;
 
-    for (final testCase in testCases) {
+    for (final testCase in _testCases) {
       testCase.testOrCreate();
       if (testCase.state == _TestCaseStates.testedGoldenFile) {
         tested++;
@@ -52,13 +52,13 @@
       }
     }
 
-    print(
-        'Successfully tested $tested inputs against golden files, created $created golden files');
+    print('Successfully tested $tested inputs against golden files, created '
+        '$created golden files');
   }
 
-  TestCases(this.testCases);
+  TestCases(this._testCases);
 
-  int get length => testCases.length;
+  int get length => _testCases.length;
 }
 
 /// Enum representing the different states of [_TestCase]s.
@@ -105,7 +105,8 @@
 
     info = inputElements[0];
     yamlBuilder = YamlEditor(inputElements[1]);
-    final rawModifications = _getValueFromYamlNode(loadYaml(inputElements[2]));
+    final rawModifications =
+        _getValueFromYamlNode(loadYaml(inputElements[2]) as YamlNode) as List;
     modifications = _parseModifications(rawModifications);
 
     /// Adds the initial state as well, so we can check that the simplest
@@ -140,7 +141,8 @@
         yamlBuilder.insertIntoList(mod.path, mod.index, mod.value);
         return;
       case YamlModificationMethod.splice:
-        yamlBuilder.spliceList(mod.path, mod.index, mod.deleteCount, mod.value);
+        yamlBuilder.spliceList(
+            mod.path, mod.index, mod.deleteCount, mod.value as List);
         return;
     }
   }
@@ -226,12 +228,13 @@
 /// objects.
 List<_YamlModification> _parseModifications(List<dynamic> modifications) {
   return modifications.map((mod) {
+    if (mod is! List) throw UnimplementedError();
     Object? value;
     var index = 0;
     var deleteCount = 0;
     final method = _getModificationMethod(mod[0] as String);
 
-    final path = mod[1];
+    final path = mod[1] as List;
 
     if (method == YamlModificationMethod.appendTo ||
         method == YamlModificationMethod.update ||
@@ -291,5 +294,6 @@
 
   @override
   String toString() =>
-      'method: $method, path: $path, index: $index, value: $value, deleteCount: $deleteCount';
+      'method: $method, path: $path, index: $index, value: $value, '
+      'deleteCount: $deleteCount';
 }
diff --git a/pkgs/yaml_edit/test/testdata/README.md b/pkgs/yaml_edit/test/testdata/README.md
index 377ae13..5145264 100644
--- a/pkgs/yaml_edit/test/testdata/README.md
+++ b/pkgs/yaml_edit/test/testdata/README.md
@@ -58,7 +58,7 @@
 
 ## Output Format
 
-The output `.golden` files contain a series of YAML strings representing the state of the YAML after each specified modification, with the first string being the inital state as specified in the ouput. These states are separated by `\n---\n` as a delimiter. For example, the output file for the sample input file above is:
+The output `.golden` files contain a series of YAML strings representing the state of the YAML after each specified modification, with the first string being the initial state as specified in the output. These states are separated by `\n---\n` as a delimiter. For example, the output file for the sample input file above is:
 
 ```
 - 0
diff --git a/pkgs/yaml_edit/test/update_test.dart b/pkgs/yaml_edit/test/update_test.dart
index 603ece4..8b9b953 100644
--- a/pkgs/yaml_edit/test/update_test.dart
+++ b/pkgs/yaml_edit/test/update_test.dart
@@ -472,14 +472,16 @@
       });
 
       test('with spacing', () {
-        final doc = YamlEditor(
-            "{ YAML:  YAML Ain't Markup Language , XML: Extensible Markup Language , HTML: Hypertext Markup Language }");
+        final doc = YamlEditor("{ YAML:  YAML Ain't Markup Language , "
+            'XML: Extensible Markup Language , '
+            'HTML: Hypertext Markup Language }');
         doc.update(['XML'], 'XML Markup Language');
 
         expect(
             doc.toString(),
-            equals(
-                "{ YAML:  YAML Ain't Markup Language , XML: XML Markup Language, HTML: Hypertext Markup Language }"));
+            equals("{ YAML:  YAML Ain't Markup Language , "
+                'XML: XML Markup Language, '
+                'HTML: Hypertext Markup Language }'));
         expectYamlBuilderValue(doc, {
           'YAML': "YAML Ain't Markup Language",
           'XML': 'XML Markup Language',
@@ -714,8 +716,8 @@
 
         expect(
             doc.toString(),
-            equals(
-                "{XML: Extensible Markup Language, YAML: YAML Ain't Markup Language}"));
+            equals('{XML: Extensible Markup Language, '
+                "YAML: YAML Ain't Markup Language}"));
         expectYamlBuilderValue(doc, {
           'XML': 'Extensible Markup Language',
           'YAML': "YAML Ain't Markup Language",
@@ -740,7 +742,7 @@
         expectYamlBuilderValue(doc, {'a': 1, 'b': 2, 'c': 3, 'd': 4});
       });
 
-      /// Regression testing to ensure it works without leading wtesttespace
+      // Regression testing to ensure it works without leading whitespace
       test('(2)', () {
         final doc = YamlEditor('a: 1');
         doc.update(['b'], 2);
diff --git a/pkgs/yaml_edit/test/utils_test.dart b/pkgs/yaml_edit/test/utils_test.dart
index 5d6b76a..57f0b2a 100644
--- a/pkgs/yaml_edit/test/utils_test.dart
+++ b/pkgs/yaml_edit/test/utils_test.dart
@@ -248,9 +248,12 @@
             ]));
 
         expect(
-            doc.toString(),
-            equals(
-                '[[plain string, folded string, \'single-quoted string\', literal string, "double-quoted string"]]'));
+          doc.toString(),
+          equals(
+            '[[plain string, folded string, \'single-quoted string\', '
+            'literal string, "double-quoted string"]]',
+          ),
+        );
         expectYamlBuilderValue(doc, [
           [
             'plain string',
@@ -349,7 +352,7 @@
         expect(doc.toString(), equals('''
 {1: ["d9]zH`FoYC\\/>]"]}
 '''));
-        expect((doc.parseAt([1, 0]) as dynamic).style,
+        expect((doc.parseAt([1, 0]) as YamlScalar).style,
             equals(ScalarStyle.DOUBLE_QUOTED));
       });
 
@@ -392,8 +395,8 @@
       });
 
       test(
-          'flow collection structure does not get substringed when added to block structure',
-          () {
+          'flow collection structure does not get substringed when added to '
+          'block structure', () {
         final doc = YamlEditor('''
 a:
   - false
diff --git a/pkgs/yaml_edit/test/wrap_test.dart b/pkgs/yaml_edit/test/wrap_test.dart
index 57b9b29..60237b9 100644
--- a/pkgs/yaml_edit/test/wrap_test.dart
+++ b/pkgs/yaml_edit/test/wrap_test.dart
@@ -2,6 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+// ignore_for_file: avoid_dynamic_calls
+
 import 'dart:io';
 
 import 'package:test/test.dart';
@@ -257,8 +259,8 @@
     });
 
     test(
-        'returns the same result for two YamlScalars with same value but different styles',
-        () {
+        'returns the same result for two YamlScalars with same value but '
+        'different styles', () {
       final hashCode1 =
           deepHashCode(wrapAsYamlNode('foo', scalarStyle: ScalarStyle.PLAIN));
       final hashCode2 =
@@ -308,8 +310,8 @@
     });
 
     test(
-        'returns the same result for two YamlLists with same value but different styles',
-        () {
+        'returns the same result for two YamlLists with same value but '
+        'different styles', () {
       final hashCode1 = deepHashCode(
           wrapAsYamlNode([1, 2, 3], collectionStyle: CollectionStyle.BLOCK));
       final hashCode2 = deepHashCode(wrapAsYamlNode([1, 2, 3]));