Americanise spellings (#33323)

Updates documentation and non-public API to use American spellings for
consistency with the rest of the codebase.

No changes to behaviour... other than how it's spelt.
diff --git a/dev/devicelab/lib/tasks/perf_tests.dart b/dev/devicelab/lib/tasks/perf_tests.dart
index 98217cd..c82e016 100644
--- a/dev/devicelab/lib/tasks/perf_tests.dart
+++ b/dev/devicelab/lib/tasks/perf_tests.dart
@@ -494,7 +494,7 @@
     await receivedNextMessage;
   }
 
-  /// To change the behaviour of the test, override this.
+  /// To change the behavior of the test, override this.
   ///
   /// Make sure to call recordStart() and recordEnd() once each in that order.
   ///
diff --git a/dev/snippets/README.md b/dev/snippets/README.md
index a1e7875..9f67878 100644
--- a/dev/snippets/README.md
+++ b/dev/snippets/README.md
@@ -52,8 +52,8 @@
 There is currently one skeleton for
 [application](config/skeletons/application.html) snippets and one for
 [sample](config/skeletons/sample.html)
-snippets, but there could be more. It uses moustache notation (e.g. `{{code}}`)
+snippets, but there could be more. It uses mustache notation (e.g. `{{code}}`)
 to mark where the components to be interpolated into the template should go.
 
-(It doesn't actually use the moustache package, since the only things that need
-substituting are simple strings, but it uses the same syntax). 
\ No newline at end of file
+(It doesn't actually use the mustache package, since the only things that need
+substituting are simple strings, but it uses the same syntax).
diff --git a/dev/snippets/lib/snippets.dart b/dev/snippets/lib/snippets.dart
index d7800e3..f4dd8d6 100644
--- a/dev/snippets/lib/snippets.dart
+++ b/dev/snippets/lib/snippets.dart
@@ -82,7 +82,7 @@
         return description.join('\n').trim();
       } else {
         // If the match isn't found in the injections, then just remove the
-        // moustache reference, since we want to allow the sections to be
+        // mustache reference, since we want to allow the sections to be
         // "optional" in the input: users shouldn't be forced to add an empty
         // "```dart preamble" section if that section would be empty.
         return injections
diff --git a/examples/layers/rendering/src/sector_layout.dart b/examples/layers/rendering/src/sector_layout.dart
index 96eb119..87e5db8 100644
--- a/examples/layers/rendering/src/sector_layout.dart
+++ b/examples/layers/rendering/src/sector_layout.dart
@@ -623,7 +623,7 @@
 
   // TODO(goderbauer): Add convenience methods to transform hit test positions
   //    once we have RenderSector implementations that move the origin of their
-  //    children (e.g. RenderSectorTransform analogues to RenderTransform).
+  //    children (e.g. RenderSectorTransform analogs to RenderTransform).
 }
 
 /// A hit test entry used by [RenderSector].
diff --git a/examples/layers/widgets/spinning_mixed.dart b/examples/layers/widgets/spinning_mixed.dart
index 9795d64..b7be577 100644
--- a/examples/layers/widgets/spinning_mixed.dart
+++ b/examples/layers/widgets/spinning_mixed.dart
@@ -7,7 +7,7 @@
 
 import '../rendering/src/solid_color_box.dart';
 
-// Solid colour, RenderObject version
+// Solid color, RenderObject version
 void addFlexChildSolidColor(RenderFlex parent, Color backgroundColor, { int flex = 0 }) {
   final RenderSolidColorBox child = RenderSolidColorBox(backgroundColor);
   parent.add(child);
@@ -15,7 +15,7 @@
   childParentData.flex = flex;
 }
 
-// Solid colour, Widget version
+// Solid color, Widget version
 class Rectangle extends StatelessWidget {
   const Rectangle(this.color, { Key key }) : super(key: key);
 
diff --git a/examples/stocks/test/icon_color_test.dart b/examples/stocks/test/icon_color_test.dart
index a3ba3fd..5dedeb4 100644
--- a/examples/stocks/test/icon_color_test.dart
+++ b/examples/stocks/test/icon_color_test.dart
@@ -72,7 +72,7 @@
     expect(find.text('MARKET'), findsOneWidget);
     expect(find.text('Account Balance'), findsOneWidget);
 
-    // check the colour of the icon - light mode
+    // check the color of the icon - light mode
     checkIconColor(tester, 'Stock List', Colors.purple); // theme primary color
     checkIconColor(tester, 'Account Balance', Colors.black38); // disabled
     checkIconColor(tester, 'About', Colors.black45); // enabled
@@ -83,7 +83,7 @@
     await tester.pump(); // start the theme transition
     await tester.pump(const Duration(seconds: 5)); // end the transition
 
-    // check the colour of the icon - dark mode
+    // check the color of the icon - dark mode
     checkIconColor(tester, 'Stock List', Colors.redAccent); // theme accent color
     checkIconColor(tester, 'Account Balance', Colors.white30); // disabled
     checkIconColor(tester, 'About', Colors.white); // enabled
diff --git a/packages/flutter/lib/src/cupertino/route.dart b/packages/flutter/lib/src/cupertino/route.dart
index 5e884b2..42bbc4d 100644
--- a/packages/flutter/lib/src/cupertino/route.dart
+++ b/packages/flutter/lib/src/cupertino/route.dart
@@ -884,7 +884,7 @@
 }
 
 // The curve and initial scale values were mostly eyeballed from iOS, however
-// they reuse the same animation curve that was modelled after native page
+// they reuse the same animation curve that was modeled after native page
 // transitions.
 final Animatable<double> _dialogScaleTween = Tween<double>(begin: 1.3, end: 1.0)
   .chain(CurveTween(curve: Curves.linearToEaseOut));
diff --git a/packages/flutter/lib/src/foundation/assertions.dart b/packages/flutter/lib/src/foundation/assertions.dart
index 0438a91..275ecaf 100644
--- a/packages/flutter/lib/src/foundation/assertions.dart
+++ b/packages/flutter/lib/src/foundation/assertions.dart
@@ -282,7 +282,7 @@
       // Regular _AssertionErrors thrown by assert() put the message last, after
       // some code snippets. This leads to ugly messages. To avoid this, we move
       // the assertion message up to before the code snippets, separated by a
-      // newline, if we recognise that format is being used.
+      // newline, if we recognize that format is being used.
       final Object message = exception.message;
       final String fullMessage = exception.toString();
       if (message is String && message != fullMessage) {
diff --git a/packages/flutter/lib/src/gestures/drag_details.dart b/packages/flutter/lib/src/gestures/drag_details.dart
index 9d2665b..27b3246 100644
--- a/packages/flutter/lib/src/gestures/drag_details.dart
+++ b/packages/flutter/lib/src/gestures/drag_details.dart
@@ -147,7 +147,7 @@
 /// has moved again.
 ///
 /// The `details` object provides the position of the touch and the distance it
-/// has travelled since the last update.
+/// has traveled since the last update.
 ///
 /// See [DragGestureRecognizer.onUpdate].
 typedef GestureDragUpdateCallback = void Function(DragUpdateDetails details);
diff --git a/packages/flutter/lib/src/gestures/monodrag.dart b/packages/flutter/lib/src/gestures/monodrag.dart
index b334f58..4cbeef3 100644
--- a/packages/flutter/lib/src/gestures/monodrag.dart
+++ b/packages/flutter/lib/src/gestures/monodrag.dart
@@ -120,7 +120,7 @@
   /// A pointer that is in contact with the screen with a primary button and
   /// moving has moved again.
   ///
-  /// The distance travelled by the pointer since the last update is provided in
+  /// The distance traveled by the pointer since the last update is provided in
   /// the callback's `details` argument, which is a [DragUpdateDetails] object.
   ///
   /// See also:
@@ -281,7 +281,7 @@
           sourceTimeStamp: timestamp,
           delta: updateDelta,
           primaryDelta: _getPrimaryValueFromOffset(updateDelta),
-          globalPosition: _initialPosition + updateDelta, // Only adds delta for down behaviour
+          globalPosition: _initialPosition + updateDelta, // Only adds delta for down behavior
         );
       }
     }
diff --git a/packages/flutter/lib/src/material/arc.dart b/packages/flutter/lib/src/material/arc.dart
index 99d24fa..706953e 100644
--- a/packages/flutter/lib/src/material/arc.dart
+++ b/packages/flutter/lib/src/material/arc.dart
@@ -224,7 +224,7 @@
 ///  * [MaterialRectCenterArcTween], which interpolates a rect along a circular
 ///    arc between the begin and end [Rect]'s centers.
 ///  * [Tween], for a discussion on how to use interpolation objects.
-///  * [MaterialPointArcTween], the analogue for [Offset] interpolation.
+///  * [MaterialPointArcTween], the analog for [Offset] interpolation.
 ///  * [RectTween], which does a linear rectangle interpolation.
 ///  * [Hero.createRectTween], which can be used to specify the tween that defines
 ///    a hero's path.
@@ -340,7 +340,7 @@
 ///  * [MaterialRectArcTween], A [Tween] that interpolates a [Rect] by having
 ///    its opposite corners follow circular arcs.
 ///  * [Tween], for a discussion on how to use interpolation objects.
-///  * [MaterialPointArcTween], the analogue for [Offset] interpolation.
+///  * [MaterialPointArcTween], the analog for [Offset] interpolation.
 ///  * [RectTween], which does a linear rectangle interpolation.
 ///  * [Hero.createRectTween], which can be used to specify the tween that defines
 ///    a hero's path.
diff --git a/packages/flutter/lib/src/material/ink_well.dart b/packages/flutter/lib/src/material/ink_well.dart
index 7da4cc5..955c7ea 100644
--- a/packages/flutter/lib/src/material/ink_well.dart
+++ b/packages/flutter/lib/src/material/ink_well.dart
@@ -24,7 +24,7 @@
 ///
 /// Subclasses call [cancel] when an input gesture is aborted before it
 /// is recognized. For example a press event might trigger an ink feature
-/// that's cancelled when the pointer is dragged out of the reference
+/// that's canceled when the pointer is dragged out of the reference
 /// box.
 ///
 /// The [InkWell] and [InkResponse] widgets generate instances of this
diff --git a/packages/flutter/lib/src/material/time_picker.dart b/packages/flutter/lib/src/material/time_picker.dart
index b3834a8..9d720aa 100644
--- a/packages/flutter/lib/src/material/time_picker.dart
+++ b/packages/flutter/lib/src/material/time_picker.dart
@@ -171,13 +171,13 @@
 /// positioned in the center of the header, with all other pieces positioned
 /// to the left or right of it.
 class _TimePickerHeaderFormat {
-  const _TimePickerHeaderFormat(this.centrepieceIndex, this.pieces)
-    : assert(centrepieceIndex != null),
+  const _TimePickerHeaderFormat(this.centerpieceIndex, this.pieces)
+    : assert(centerpieceIndex != null),
       assert(pieces != null);
 
   /// Index into the [pieces] list pointing at the piece that contains the
   /// pivot fragment.
-  final int centrepieceIndex;
+  final int centerpieceIndex;
 
   /// Pieces that constitute a time picker header.
   final List<_TimePickerHeaderPiece> pieces;
@@ -514,14 +514,14 @@
         pieces.add(piece1);
         break;
     }
-    int centrepieceIndex;
+    int centerpieceIndex;
     for (int i = 0; i < pieces.length; i += 1) {
       if (pieces[i].pivotIndex >= 0) {
-        centrepieceIndex = i;
+        centerpieceIndex = i;
       }
     }
-    assert(centrepieceIndex != null);
-    return _TimePickerHeaderFormat(centrepieceIndex, pieces);
+    assert(centerpieceIndex != null);
+    return _TimePickerHeaderFormat(centerpieceIndex, pieces);
   }
 
   // Convenience function for creating a time header piece with up to three fragments.
@@ -632,9 +632,9 @@
         fragmentsFlattened.add(fragment);
       }
 
-      if (pieceIndex == format.centrepieceIndex)
-        pivotIndex += format.pieces[format.centrepieceIndex].pivotIndex;
-      else if (pieceIndex < format.centrepieceIndex)
+      if (pieceIndex == format.centerpieceIndex)
+        pivotIndex += format.pieces[format.centerpieceIndex].pivotIndex;
+      else if (pieceIndex < format.centerpieceIndex)
         pivotIndex += piece.fragments.length;
     }
 
@@ -659,14 +659,14 @@
       margin = piece.bottomMargin;
     }
 
-    final _TimePickerHeaderPiece centrepiece = format.pieces[format.centrepieceIndex];
+    final _TimePickerHeaderPiece centerpiece = format.pieces[format.centerpieceIndex];
     double y = (size.height - height) / 2.0;
     for (int pieceIndex = 0; pieceIndex < format.pieces.length; pieceIndex += 1) {
       final double pieceVerticalCenter = y + pieceHeights[pieceIndex] / 2.0;
-      if (pieceIndex != format.centrepieceIndex)
+      if (pieceIndex != format.centerpieceIndex)
         _positionPiece(size.width, pieceVerticalCenter, childSizes, format.pieces[pieceIndex].fragments);
       else
-        _positionPivoted(size.width, pieceVerticalCenter, childSizes, centrepiece.fragments, centrepiece.pivotIndex);
+        _positionPivoted(size.width, pieceVerticalCenter, childSizes, centerpiece.fragments, centerpiece.pivotIndex);
 
       y += pieceHeights[pieceIndex] + format.pieces[pieceIndex].bottomMargin;
     }
diff --git a/packages/flutter/lib/src/painting/basic_types.dart b/packages/flutter/lib/src/painting/basic_types.dart
index b3ca604..0a1af23 100644
--- a/packages/flutter/lib/src/painting/basic_types.dart
+++ b/packages/flutter/lib/src/painting/basic_types.dart
@@ -253,7 +253,7 @@
   return null;
 }
 
-/// Returns whether travelling along the given axis direction visits coordinates
+/// Returns whether traveling along the given axis direction visits coordinates
 /// along that axis in numerically decreasing order.
 ///
 /// Specifically, returns true for [AxisDirection.up] and [AxisDirection.left]
diff --git a/packages/flutter/lib/src/painting/image_provider.dart b/packages/flutter/lib/src/painting/image_provider.dart
index 0ff5ed6..8f12d66 100644
--- a/packages/flutter/lib/src/painting/image_provider.dart
+++ b/packages/flutter/lib/src/painting/image_provider.dart
@@ -475,7 +475,7 @@
 /// See also:
 ///
 ///  * [Image.network] for a shorthand of an [Image] widget backed by [NetworkImage].
-// TODO(ianh): Find some way to honour cache headers to the extent that when the
+// TODO(ianh): Find some way to honor cache headers to the extent that when the
 // last reference to an image is released, we proactively evict the image from
 // our cache if the headers describe the image as having expired at that point.
 class NetworkImage extends ImageProvider<NetworkImage> {
diff --git a/packages/flutter/lib/src/rendering/layer.dart b/packages/flutter/lib/src/rendering/layer.dart
index bad941c..a559efb 100644
--- a/packages/flutter/lib/src/rendering/layer.dart
+++ b/packages/flutter/lib/src/rendering/layer.dart
@@ -1492,7 +1492,7 @@
 /// A composited layer that uses a physical model to producing lighting effects.
 ///
 /// For example, the layer casts a shadow according to its geometry and the
-/// relative position of lights and other physically modelled objects in the
+/// relative position of lights and other physically modeled objects in the
 /// scene.
 ///
 /// When debugging, setting [debugDisablePhysicalShapeLayers] to true will cause this
diff --git a/packages/flutter/lib/src/rendering/object.dart b/packages/flutter/lib/src/rendering/object.dart
index 1e00975..733db60 100644
--- a/packages/flutter/lib/src/rendering/object.dart
+++ b/packages/flutter/lib/src/rendering/object.dart
@@ -1853,7 +1853,7 @@
       owner._nodesNeedingCompositingBitsUpdate.add(this);
   }
 
-  bool _needsCompositing; // initialised in the constructor
+  bool _needsCompositing; // initialized in the constructor
   /// Whether we or one of our descendants has a compositing layer.
   ///
   /// If this node needs compositing as indicated by this bit, then all ancestor
diff --git a/packages/flutter/lib/src/services/platform_views.dart b/packages/flutter/lib/src/services/platform_views.dart
index a32d343..7e8b4a9 100644
--- a/packages/flutter/lib/src/services/platform_views.dart
+++ b/packages/flutter/lib/src/services/platform_views.dart
@@ -466,7 +466,7 @@
   /// Android's [MotionEvent.ACTION_MOVE](https://developer.android.com/reference/android/view/MotionEvent#ACTION_MOVE)
   static const int kActionMove = 2;
 
-  /// Action code for when a motion event has been cancelled.
+  /// Action code for when a motion event has been canceled.
   ///
   /// Android's [MotionEvent.ACTION_CANCEL](https://developer.android.com/reference/android/view/MotionEvent#ACTION_CANCEL)
   static const int kActionCancel = 3;
diff --git a/packages/flutter/lib/src/widgets/navigator.dart b/packages/flutter/lib/src/widgets/navigator.dart
index 1cc159b..bdd4208 100644
--- a/packages/flutter/lib/src/widgets/navigator.dart
+++ b/packages/flutter/lib/src/widgets/navigator.dart
@@ -2134,7 +2134,7 @@
       final Route<dynamic> previousRoute = !route.willHandlePopInternally && _history.length > 1
           ? _history[_history.length - 2]
           : null;
-      // Don't operate the _history list since the gesture may be cancelled.
+      // Don't operate the _history list since the gesture may be canceled.
       // In case of a back swipe, the gesture controller will call .pop() itself.
 
       for (NavigatorObserver observer in widget.observers)
diff --git a/packages/flutter/test/cupertino/refresh_test.dart b/packages/flutter/test/cupertino/refresh_test.dart
index e74c2c2..0241bac 100644
--- a/packages/flutter/test/cupertino/refresh_test.dart
+++ b/packages/flutter/test/cupertino/refresh_test.dart
@@ -173,7 +173,7 @@
       },
     );
 
-    testWidgets('let the builder update as cancelled drag scrolls away', (WidgetTester tester) async {
+    testWidgets('let the builder update as canceled drag scrolls away', (WidgetTester tester) async {
       debugDefaultTargetPlatformOverride = TargetPlatform.iOS;
 
       await tester.pumpWidget(
diff --git a/packages/flutter/test/gestures/gesture_binding_test.dart b/packages/flutter/test/gestures/gesture_binding_test.dart
index 3bfdf91..d899a2d 100644
--- a/packages/flutter/test/gestures/gesture_binding_test.dart
+++ b/packages/flutter/test/gestures/gesture_binding_test.dart
@@ -251,7 +251,7 @@
     expect(events[6].runtimeType, equals(PointerScrollEvent));
   });
 
-  test('Should synthesise kPrimaryButton for touch', () {
+  test('Should synthesize kPrimaryButton for touch', () {
     final Offset location = const Offset(10.0, 10.0) * ui.window.devicePixelRatio;
     const PointerDeviceKind kind = PointerDeviceKind.touch;
     final ui.PointerDataPacket packet = ui.PointerDataPacket(
@@ -282,7 +282,7 @@
     PointerEventConverter.clearPointers();
   });
 
-  test('Should synthesise kPrimaryButton for stylus', () {
+  test('Should synthesize kPrimaryButton for stylus', () {
     final Offset location = const Offset(10.0, 10.0) * ui.window.devicePixelRatio;
     for (PointerDeviceKind kind in <PointerDeviceKind>[
       PointerDeviceKind.stylus,
@@ -318,7 +318,7 @@
     }
   });
 
-  test('Should synthesise kPrimaryButton for unknown devices', () {
+  test('Should synthesize kPrimaryButton for unknown devices', () {
     final Offset location = const Offset(10.0, 10.0) * ui.window.devicePixelRatio;
     const PointerDeviceKind kind = PointerDeviceKind.unknown;
     final ui.PointerDataPacket packet = ui.PointerDataPacket(
@@ -349,7 +349,7 @@
     PointerEventConverter.clearPointers();
   });
 
-  test('Should not synthesise kPrimaryButton for mouse', () {
+  test('Should not synthesize kPrimaryButton for mouse', () {
     final Offset location = const Offset(10.0, 10.0) * ui.window.devicePixelRatio;
     for (PointerDeviceKind kind in <PointerDeviceKind>[
       PointerDeviceKind.mouse,
diff --git a/packages/flutter/test/widgets/scroll_events_test.dart b/packages/flutter/test/widgets/scroll_events_test.dart
index 5f5bf67..7a83b31 100644
--- a/packages/flutter/test/widgets/scroll_events_test.dart
+++ b/packages/flutter/test/widgets/scroll_events_test.dart
@@ -139,7 +139,7 @@
     final List<String> log = <String>[];
     await tester.pumpWidget(_buildScroller(log: log));
 
-    // The ideal behaviour here would be a single start/end pair, but for
+    // The ideal behavior here would be a single start/end pair, but for
     // simplicity of implementation we compromise here and accept two. Should
     // you find a way to make this work with just one without complicating the
     // API, feel free to change the expectation here.
diff --git a/packages/flutter/test/widgets/visibility_test.dart b/packages/flutter/test/widgets/visibility_test.dart
index bf339cf..ad586a7 100644
--- a/packages/flutter/test/widgets/visibility_test.dart
+++ b/packages/flutter/test/widgets/visibility_test.dart
@@ -64,7 +64,7 @@
     final Matcher expectedSemanticsWhenAbsent = hasSemantics(TestSemantics.root());
 
     // We now run a sequence of pumpWidget calls one after the other. In
-    // addition to verifying that the right behaviour is seen in each case, this
+    // addition to verifying that the right behavior is seen in each case, this
     // also verifies that the widget can dynamically change from state to state.
 
     await tester.pumpWidget(Visibility(child: testChild));
diff --git a/packages/flutter_tools/lib/src/base/utils.dart b/packages/flutter_tools/lib/src/base/utils.dart
index 71f835e..76f6661 100644
--- a/packages/flutter_tools/lib/src/base/utils.dart
+++ b/packages/flutter_tools/lib/src/base/utils.dart
@@ -265,11 +265,11 @@
   final Duration initialDelay;
   final Duration pollingInterval;
 
-  bool _cancelled = false;
+  bool _canceled = false;
   Timer _timer;
 
   Future<void> _handleCallback() async {
-    if (_cancelled)
+    if (_canceled)
       return;
 
     try {
@@ -278,13 +278,13 @@
       printTrace('Error from poller: $error');
     }
 
-    if (!_cancelled)
+    if (!_canceled)
       _timer = Timer(pollingInterval, _handleCallback);
   }
 
   /// Cancels the poller.
   void cancel() {
-    _cancelled = true;
+    _canceled = true;
     _timer?.cancel();
     _timer = null;
   }
diff --git a/packages/flutter_tools/lib/src/ios/mac.dart b/packages/flutter_tools/lib/src/ios/mac.dart
index 919e70d..41379c7 100644
--- a/packages/flutter_tools/lib/src/ios/mac.dart
+++ b/packages/flutter_tools/lib/src/ios/mac.dart
@@ -519,7 +519,7 @@
     (List<String>
         .from(buildCommands)
         ..add('-showBuildSettings'))
-        // Undocumented behaviour: xcodebuild craps out if -showBuildSettings
+        // Undocumented behavior: xcodebuild craps out if -showBuildSettings
         // is used together with -allowProvisioningUpdates or
         // -allowProvisioningDeviceRegistration and freezes forever.
         .where((String buildCommand) {
diff --git a/packages/flutter_tools/test/base/logger_test.dart b/packages/flutter_tools/test/base/logger_test.dart
index c878855..f6abf23 100644
--- a/packages/flutter_tools/test/base/logger_test.dart
+++ b/packages/flutter_tools/test/base/logger_test.dart
@@ -263,7 +263,7 @@
         Stopwatch: () => mockStopwatch,
       });
 
-      testUsingContext('AnsiStatus works when cancelled for $testOs', () async {
+      testUsingContext('AnsiStatus works when canceled for $testOs', () async {
         final AnsiStatus ansiStatus = _createAnsiStatus();
         bool done = false;
         FakeAsync().run((FakeAsync time) {
@@ -615,7 +615,7 @@
       Platform: _kNoAnsiPlatform,
     });
 
-    testUsingContext('SummaryStatus works when cancelled', () async {
+    testUsingContext('SummaryStatus works when canceled', () async {
       summaryStatus.start();
       List<String> lines = outputStdout();
       expect(lines[0], startsWith('Hello world              '));