forked from firka/flutter
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.
This commit is contained in:
@@ -494,7 +494,7 @@ class MemoryTest {
|
||||
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.
|
||||
///
|
||||
|
||||
@@ -52,8 +52,8 @@ are interpolated, in order to display it nicely.
|
||||
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).
|
||||
(It doesn't actually use the mustache package, since the only things that need
|
||||
substituting are simple strings, but it uses the same syntax).
|
||||
|
||||
@@ -82,7 +82,7 @@ class SnippetGenerator {
|
||||
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
|
||||
|
||||
@@ -623,7 +623,7 @@ class SectorHitTestResult extends HitTestResult {
|
||||
|
||||
// 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].
|
||||
|
||||
@@ -7,7 +7,7 @@ import 'package:flutter/rendering.dart';
|
||||
|
||||
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 @@ void addFlexChildSolidColor(RenderFlex parent, Color backgroundColor, { int flex
|
||||
childParentData.flex = flex;
|
||||
}
|
||||
|
||||
// Solid colour, Widget version
|
||||
// Solid color, Widget version
|
||||
class Rectangle extends StatelessWidget {
|
||||
const Rectangle(this.color, { Key key }) : super(key: key);
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ void main() {
|
||||
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 @@ void main() {
|
||||
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
|
||||
|
||||
@@ -884,7 +884,7 @@ Future<T> showCupertinoModalPopup<T>({
|
||||
}
|
||||
|
||||
// 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));
|
||||
|
||||
@@ -282,7 +282,7 @@ class FlutterErrorDetails extends Diagnosticable {
|
||||
// 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) {
|
||||
|
||||
@@ -147,7 +147,7 @@ class DragUpdateDetails {
|
||||
/// 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);
|
||||
|
||||
@@ -120,7 +120,7 @@ abstract class DragGestureRecognizer extends OneSequenceGestureRecognizer {
|
||||
/// 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 @@ abstract class DragGestureRecognizer extends OneSequenceGestureRecognizer {
|
||||
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
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -224,7 +224,7 @@ T _maxBy<T>(Iterable<T> input, _KeyFunc<T> keyFunc) {
|
||||
/// * [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 @@ class MaterialRectArcTween extends RectTween {
|
||||
/// * [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.
|
||||
|
||||
@@ -24,7 +24,7 @@ import 'theme.dart';
|
||||
///
|
||||
/// 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
|
||||
|
||||
@@ -171,13 +171,13 @@ class _TimePickerHeaderPiece {
|
||||
/// 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 @@ _TimePickerHeaderFormat _buildHeaderFormat(
|
||||
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 @@ class _TimePickerHeaderLayout extends MultiChildLayoutDelegate {
|
||||
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 @@ class _TimePickerHeaderLayout extends MultiChildLayoutDelegate {
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -253,7 +253,7 @@ AxisDirection flipAxisDirection(AxisDirection axisDirection) {
|
||||
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]
|
||||
|
||||
@@ -475,7 +475,7 @@ abstract class AssetBundleImageProvider extends ImageProvider<AssetBundleImageKe
|
||||
/// 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> {
|
||||
|
||||
@@ -1492,7 +1492,7 @@ class BackdropFilterLayer extends ContainerLayer {
|
||||
/// 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
|
||||
|
||||
@@ -1853,7 +1853,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
|
||||
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
|
||||
|
||||
@@ -466,7 +466,7 @@ class AndroidViewController {
|
||||
/// 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;
|
||||
|
||||
@@ -2134,7 +2134,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin {
|
||||
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)
|
||||
|
||||
@@ -173,7 +173,7 @@ void main() {
|
||||
},
|
||||
);
|
||||
|
||||
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(
|
||||
|
||||
@@ -251,7 +251,7 @@ void main() {
|
||||
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 @@ void main() {
|
||||
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 @@ void main() {
|
||||
}
|
||||
});
|
||||
|
||||
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 @@ void main() {
|
||||
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,
|
||||
|
||||
@@ -139,7 +139,7 @@ void main() {
|
||||
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.
|
||||
|
||||
@@ -64,7 +64,7 @@ void main() {
|
||||
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));
|
||||
|
||||
@@ -265,11 +265,11 @@ class Poller {
|
||||
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 @@ class Poller {
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -519,7 +519,7 @@ Future<XcodeBuildResult> buildXcodeProject({
|
||||
(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) {
|
||||
|
||||
@@ -263,7 +263,7 @@ void main() {
|
||||
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 @@ void main() {
|
||||
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 '));
|
||||
|
||||
Reference in New Issue
Block a user