From 3236957f02fa0d8fd88a09b4d7aa6c75ceeae2aa Mon Sep 17 00:00:00 2001 From: goodmost <164015983+goodmost@users.noreply.github.com> Date: Wed, 20 Mar 2024 01:00:24 +0800 Subject: [PATCH] chore: fix some comments (#145397) fix some comments --- .../android_verified_input/test_driver/main_test.dart | 2 +- dev/integration_tests/external_textures/README.md | 2 +- .../editable_text/text_editing_controller.1_test.dart | 2 +- packages/flutter/lib/src/cupertino/date_picker.dart | 2 +- .../flutter/lib/src/material/date_picker_theme.dart | 2 +- packages/flutter/lib/src/material/radio_list_tile.dart | 2 +- .../flutter/lib/src/material/time_picker_theme.dart | 4 ++-- packages/flutter/lib/src/rendering/box.dart | 4 ++-- .../flutter/test/widgets/lookup_boundary_test.dart | 2 +- .../general.shard/generate_localizations_test.dart | 4 ++-- .../test/general.shard/ios/xcode_debug_test.dart | 10 +++++----- .../isolated/macos/native_assets_host_test.dart | 2 +- 12 files changed, 19 insertions(+), 19 deletions(-) diff --git a/dev/integration_tests/android_verified_input/test_driver/main_test.dart b/dev/integration_tests/android_verified_input/test_driver/main_test.dart index ecf3061dfb..fcb0d1483c 100644 --- a/dev/integration_tests/android_verified_input/test_driver/main_test.dart +++ b/dev/integration_tests/android_verified_input/test_driver/main_test.dart @@ -28,7 +28,7 @@ Future main() async { // to be verified. final Future inputEventWasVerified = driver.requestData('input_was_verified'); - // Keep issueing taps until we get the requested data. The actual setup + // Keep issuing taps until we get the requested data. The actual setup // of the platform view is asynchronous so we might have to tap more than // once to get a response. bool stop = false; diff --git a/dev/integration_tests/external_textures/README.md b/dev/integration_tests/external_textures/README.md index b4fd5f3540..3e0f1eec37 100644 --- a/dev/integration_tests/external_textures/README.md +++ b/dev/integration_tests/external_textures/README.md @@ -24,7 +24,7 @@ subtle translation issues. ## How it works - Each `lib/*_main.dart` file is a Flutter app instrumenting a test case. -- There is a cooresponding `test_driver/*_test.dart` that runs assertions. +- There is a corresponding `test_driver/*_test.dart` that runs assertions. To run the test cases locally, use `flutter drive`[^2]: diff --git a/examples/api/test/widgets/editable_text/text_editing_controller.1_test.dart b/examples/api/test/widgets/editable_text/text_editing_controller.1_test.dart index b60106e29e..c2b00d9ad9 100644 --- a/examples/api/test/widgets/editable_text/text_editing_controller.1_test.dart +++ b/examples/api/test/widgets/editable_text/text_editing_controller.1_test.dart @@ -7,7 +7,7 @@ import 'package:flutter_api_samples/widgets/editable_text/text_editing_controlle import 'package:flutter_test/flutter_test.dart'; void main() { - testWidgets('Initial selection is collasped at offset 0', (WidgetTester tester) async { + testWidgets('Initial selection is collapsed at offset 0', (WidgetTester tester) async { await tester.pumpWidget( const example.TextEditingControllerExampleApp(), ); diff --git a/packages/flutter/lib/src/cupertino/date_picker.dart b/packages/flutter/lib/src/cupertino/date_picker.dart index 08a44fdc4a..9bc9e4045a 100644 --- a/packages/flutter/lib/src/cupertino/date_picker.dart +++ b/packages/flutter/lib/src/cupertino/date_picker.dart @@ -405,7 +405,7 @@ class CupertinoDatePicker extends StatefulWidget { /// Defaults to null, which disables background painting entirely. final Color? backgroundColor; - /// Whether to to show day of week alongside day. Defaults to false. + /// Whether to show day of week alongside day. Defaults to false. final bool showDayOfWeek; /// {@macro flutter.cupertino.picker.itemExtent} diff --git a/packages/flutter/lib/src/material/date_picker_theme.dart b/packages/flutter/lib/src/material/date_picker_theme.dart index 60c46c4554..cbdf7a9abd 100644 --- a/packages/flutter/lib/src/material/date_picker_theme.dart +++ b/packages/flutter/lib/src/material/date_picker_theme.dart @@ -333,7 +333,7 @@ class DatePickerThemeData with Diagnosticable { final MaterialStateProperty? rangeSelectionOverlayColor; /// Overrides the default color used to paint the horizontal divider - /// below the header text when dialog is in in portrait orientation + /// below the header text when dialog is in portrait orientation /// and vertical divider when the dialog is in landscape orientation. final Color? dividerColor; diff --git a/packages/flutter/lib/src/material/radio_list_tile.dart b/packages/flutter/lib/src/material/radio_list_tile.dart index cc25b42e4a..ba6be4b9b1 100644 --- a/packages/flutter/lib/src/material/radio_list_tile.dart +++ b/packages/flutter/lib/src/material/radio_list_tile.dart @@ -35,7 +35,7 @@ enum _RadioType { material, adaptive } /// /// The [selected] property on this widget is similar to the [ListTile.selected] /// property. The [fillColor] in the selected state is used for the selected item's -/// text color. It it is null, the [activeColor] is used. +/// text color. If it is null, the [activeColor] is used. /// /// This widget does not coordinate the [selected] state and the /// [checked] state; to have the list tile appear selected when the diff --git a/packages/flutter/lib/src/material/time_picker_theme.dart b/packages/flutter/lib/src/material/time_picker_theme.dart index 1ba598ada4..c071265f55 100644 --- a/packages/flutter/lib/src/material/time_picker_theme.dart +++ b/packages/flutter/lib/src/material/time_picker_theme.dart @@ -271,7 +271,7 @@ class TimePickerThemeData with Diagnosticable { /// `RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(4.0)))`. final ShapeBorder? shape; - /// The color of the time selector seperator between the hour and minute controls. + /// The color of the time selector separator between the hour and minute controls. /// /// if this is null, the time picker defaults to the overall theme's /// [ColorScheme.onSurface]. @@ -280,7 +280,7 @@ class TimePickerThemeData with Diagnosticable { /// [hourMinuteTextColor]. final MaterialStateProperty? timeSelectorSeparatorColor; - /// Used to configure the text style for the time selector seperator between the hour + /// Used to configure the text style for the time selector separator between the hour /// and minute controls. /// /// If this is null, the time picker defaults to the overall theme's diff --git a/packages/flutter/lib/src/rendering/box.dart b/packages/flutter/lib/src/rendering/box.dart index 449b39417a..d848a0a069 100644 --- a/packages/flutter/lib/src/rendering/box.dart +++ b/packages/flutter/lib/src/rendering/box.dart @@ -2074,11 +2074,11 @@ abstract class RenderBox extends RenderObject { /// would results in UI changes when [paint] is called, or hit-testing behavior /// changes when [hitTest] is called. Moreover, accessing the current layout /// of this [RenderBox] or child [RenderBox]es (including accessing [size], or - /// `child.size`) usually indicates a bug in the implementaion, as the current + /// `child.size`) usually indicates a bug in the implementation, as the current /// layout is typically calculated using a set of [BoxConstraints] that's /// different from the `constraints` given as the first parameter. To get the /// size of this [RenderBox] or a child [RenderBox] in this method's - /// implementatin, use the [getDryLayout] method instead. + /// implementation, use the [getDryLayout] method instead. /// /// The implementation must return a value that represents the distance from /// the top of the box to the first baseline of the box's contents, for the diff --git a/packages/flutter/test/widgets/lookup_boundary_test.dart b/packages/flutter/test/widgets/lookup_boundary_test.dart index 36d2d3b310..51e8742dd2 100644 --- a/packages/flutter/test/widgets/lookup_boundary_test.dart +++ b/packages/flutter/test/widgets/lookup_boundary_test.dart @@ -173,7 +173,7 @@ void main() { expect(tester.state<_DidChangeDependencySpyState>(find.byType(DidChangeDependencySpy)).didChangeDependenciesCount, 3); }); - testWidgets('causes didChangeDependencies to be called on move even if dependency was non-existant', (WidgetTester tester) async { + testWidgets('causes didChangeDependencies to be called on move even if dependency was non-existent', (WidgetTester tester) async { MyInheritedWidget? inheritedWidget; final Key globalKey = GlobalKey(); diff --git a/packages/flutter_tools/test/general.shard/generate_localizations_test.dart b/packages/flutter_tools/test/general.shard/generate_localizations_test.dart index ea06e8b132..5d3742c7dd 100644 --- a/packages/flutter_tools/test/general.shard/generate_localizations_test.dart +++ b/packages/flutter_tools/test/general.shard/generate_localizations_test.dart @@ -2522,10 +2522,10 @@ NumberFormat.decimalPatternDigits( testWithoutContext('dollar signs are escaped properly when there is a select clause', () { const String dollarSignWithSelect = r''' { - "dollarSignWithSelect": "$nice_bug\nHello Bug! Manifistation #1 {selectPlaceholder, select, case{message} other{messageOther}}" + "dollarSignWithSelect": "$nice_bug\nHello Bug! Manifestation #1 {selectPlaceholder, select, case{message} other{messageOther}}" }'''; setupLocalizations({ 'en': dollarSignWithSelect }); - expect(getGeneratedFileContent(locale: 'en'), contains(r'\$nice_bug\nHello Bug! Manifistation #1 $_temp0')); + expect(getGeneratedFileContent(locale: 'en'), contains(r'\$nice_bug\nHello Bug! Manifestation #1 $_temp0')); }); testWithoutContext('can generate method with named parameter', () { diff --git a/packages/flutter_tools/test/general.shard/ios/xcode_debug_test.dart b/packages/flutter_tools/test/general.shard/ios/xcode_debug_test.dart index e4c830a859..9b8049f58e 100644 --- a/packages/flutter_tools/test/general.shard/ios/xcode_debug_test.dart +++ b/packages/flutter_tools/test/general.shard/ios/xcode_debug_test.dart @@ -275,13 +275,13 @@ void main() { 'open', [ '-a', - '/non_existant_path', + '/non_existent_path', '-g', '-j', '-F', xcworkspace.path, ], - 'The application /non_existant_path cannot be opened for an unexpected reason', + 'The application /non_existent_path cannot be opened for an unexpected reason', ), ), ]); @@ -304,7 +304,7 @@ void main() { expect( logger.errorText, - contains('The application /non_existant_path cannot be opened for an unexpected reason'), + contains('The application /non_existent_path cannot be opened for an unexpected reason'), ); expect(fakeProcessManager, hasNoRemainingExpectations); expect(status, false); @@ -807,7 +807,7 @@ void main() { expect(status, isTrue); }); - testWithoutContext('prints error message when deleting temporary directory that is nonexistant', () async { + testWithoutContext('prints error message when deleting temporary directory that is nonexistent', () async { final Xcode xcode = setupXcode( fakeProcessManager: fakeProcessManager, fileSystem: fileSystem, @@ -914,7 +914,7 @@ void main() { expect(exitStatus, isTrue); }); - testWithoutContext('does not crash when deleting temporary directory that is nonexistant when force exiting', () async { + testWithoutContext('does not crash when deleting temporary directory that is nonexistent when force exiting', () async { final Xcode xcode = setupXcode( fakeProcessManager: FakeProcessManager.any(), fileSystem: fileSystem, diff --git a/packages/flutter_tools/test/general.shard/isolated/macos/native_assets_host_test.dart b/packages/flutter_tools/test/general.shard/isolated/macos/native_assets_host_test.dart index 4e1c3b62c8..7608db06de 100644 --- a/packages/flutter_tools/test/general.shard/isolated/macos/native_assets_host_test.dart +++ b/packages/flutter_tools/test/general.shard/isolated/macos/native_assets_host_test.dart @@ -38,7 +38,7 @@ void main() { ); }); - test('framework name name confilicts', () { + test('framework name conflicts', () { final Set alreadyTakenNames = {}; expect( frameworkUri('libfoo.dylib', alreadyTakenNames),