Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove "note that" in our documentation (as per style guide) #120842

Merged
merged 4 commits into from Feb 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion dev/benchmarks/complex_layout/lib/src/app.dart
Expand Up @@ -630,7 +630,7 @@ class GalleryDrawer extends StatelessWidget {
Widget build(BuildContext context) {
final ScrollMode currentMode = ComplexLayoutApp.of(context)!.scrollMode;
return Drawer(
// Note: for real apps, see the Gallery material Drawer demo. More
// For real apps, see the Gallery material Drawer demo. More
// typically, a drawer would have a fixed header with a scrolling body
// below it.
child: ListView(
Expand Down
Expand Up @@ -24,7 +24,7 @@ void main() async {
watch.reset();
watch.start();
for (int i = 0; i < _kBatchSize; i += 1) {
// Note: We don't load images like this. PlatformAssetBundle is used for
// We don't load images like this. PlatformAssetBundle is used for
// other assets (like Rive animations). We are using an image because it's
// conveniently sized and available for the test.
tally += (await bundle.load('packages/flutter_gallery_assets/places/india_pondicherry_salt_farm.png')).lengthInBytes;
Expand Down
4 changes: 2 additions & 2 deletions dev/benchmarks/multiple_flutters/android/build.gradle
Expand Up @@ -13,8 +13,8 @@ buildscript {
classpath "com.android.tools.build:gradle:7.3.0"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
// Do not place your application dependencies here; they belong
// in the individual module build.gradle files.
}
}

Expand Down
5 changes: 3 additions & 2 deletions dev/bots/analyze.dart
Expand Up @@ -1842,7 +1842,7 @@ Future<void> verifyNullInitializedDebugExpensiveFields(String workingDirectory,
}
}

final RegExp tabooPattern = RegExp(r'^ *///.*\b(simply)\b', caseSensitive: false);
final RegExp tabooPattern = RegExp(r'^ *///.*\b(simply|note:|note that)\b', caseSensitive: false);

Future<void> verifyTabooDocumentation(String workingDirectory, { int minimumMatches = 100 }) async {
final List<String> errors = <String>[];
Expand All @@ -1859,7 +1859,8 @@ Future<void> verifyTabooDocumentation(String workingDirectory, { int minimumMatc
if (errors.isNotEmpty) {
foundError(<String>[
'${bold}Avoid the word "simply" in documentation. See https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#use-the-passive-voice-recommend-do-not-require-never-say-things-are-simple for details.$reset',
'${bold}In many cases the word can be omitted without loss of generality; in other cases it may require a bit of rewording to avoid implying that the task is simple.$reset',
'${bold}In many cases thes words can be omitted without loss of generality; in other cases it may require a bit of rewording to avoid implying that the task is simple.$reset',
'${bold}Similarly, avoid using "note:" or the phrase "note that". See https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#avoid-empty-prose for details.$reset',
...errors,
]);
}
Expand Down
2 changes: 1 addition & 1 deletion dev/bots/docs.sh
Expand Up @@ -18,7 +18,7 @@ function script_location() {

function generate_docs() {
# Install and activate dartdoc.
# NOTE: When updating to a new dartdoc version, please also update
# When updating to a new dartdoc version, please also update
# `dartdoc_options.yaml` to include newly introduced error and warning types.
"$DART" pub global activate dartdoc 6.1.5

Expand Down
2 changes: 1 addition & 1 deletion dev/ci/README.md
Expand Up @@ -9,7 +9,7 @@ On each new change to this `Dockerfile`, Cirrus will build a new version of
the Docker image as a dependency to any Linux tests. It is no longer necessary
to manually build and push the Docker image locally.

NOTE: there are some factors external to the actual `Dockerfile` that would
There are some factors external to the actual `Dockerfile` that would
necessitate rebuilding the Docker image, such as upstream code changes, (Linux
distribution) repository updates or a file that gets `COPY`ied into the image
changing. In this case, a trivial `Dockerfile` change (such as a comment)
Expand Down
3 changes: 1 addition & 2 deletions dev/conductor/core/lib/src/repository.dart
Expand Up @@ -129,8 +129,7 @@ abstract class Repository {
'Fetch ${upstreamRemote.name} to ensure we have latest refs',
workingDirectory: _checkoutDirectory!.path,
);
// Note: if [initialRef] is a remote ref the checkout will be left in a
// detached HEAD state.
// If [initialRef] is a remote ref, the checkout will be left in a detached HEAD state.
await git.run(
<String>['checkout', initialRef!],
'Checking out initialRef $initialRef',
Expand Down
2 changes: 1 addition & 1 deletion dev/conductor/core/test/start_test.dart
Expand Up @@ -531,7 +531,7 @@ void main() {
'171876a4e6cf56ee6da1f97d203926bd7afda7ef';
const String nextDartRevision =
'f6c91128be6b77aef8351e1e3a9d07c85bc2e46e';
// note that this significantly behind the candidate branch name
// This is significantly behind the candidate branch name
const String previousVersion = '0.9.0-1.0.pre';
// This is what this release will be
const String nextVersion = '0.9.0-1.1.pre';
Expand Down
Expand Up @@ -2,8 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Note: This code is not runnable, it contains code snippets displayed in the
// gallery.
// This code is not runnable, it contains code snippets displayed in the Gallery.

import 'package:flutter/material.dart';

Expand Down
Expand Up @@ -22,9 +22,9 @@ -(void)viewWillDisappear:(BOOL)animated {
self.navigationController.navigationBarHidden = NO;
self.navigationController.hidesBarsOnSwipe = NO;
if (self.isMovingFromParentViewController) {
// Note that if we were doing things that might cause the VC
// If we were doing things that might cause the VC
// to disappear (like using the image_picker plugin)
// we shouldn't do this. But in this case we know we're
// we shouldn't do this, but in this case we know we're
// just going back to the navigation controller.
// If we needed Flutter to tell us when we could actually go away,
// we'd need to communicate over a method channel with it.
Expand Down
Expand Up @@ -22,9 +22,9 @@ -(void)viewWillDisappear:(BOOL)animated {
self.navigationController.navigationBarHidden = NO;
self.navigationController.hidesBarsOnSwipe = NO;
if (self.isMovingFromParentViewController) {
// Note that if we were doing things that might cause the VC
// If we were doing things that might cause the VC
// to disappear (like using the image_picker plugin)
// we shouldn't do this. But in this case we know we're
// we shouldn't do this, but in this case we know we're
// just going back to the navigation controller.
// If we needed Flutter to tell us when we could actually go away,
// we'd need to communicate over a method channel with it.
Expand Down
6 changes: 3 additions & 3 deletions dev/integration_tests/ios_host_app/flutterapp/lib/main
Expand Up @@ -21,9 +21,9 @@ const String hybridRouteName = 'hybrid';
/// Channel used to let the Flutter app know to reset the app to a specific
/// route. See the [run] method.
///
/// Note that we shouldn't use the `setInitialRoute` method on the system
/// navigation channel, as that never gets propagated back to Flutter after the
/// initial call.
/// We shouldn't use the `setInitialRoute` method on the system
/// navigation channel, as that never gets propagated back to Flutter
/// after the initial call.
const String _kReloadChannelName = 'reload';
const BasicMessageChannel<String> _kReloadChannel =
BasicMessageChannel<String>(_kReloadChannelName, StringCodec());
Expand Down
7 changes: 5 additions & 2 deletions dev/tools/gen_keycodes/lib/physical_key_data.dart
Expand Up @@ -76,18 +76,21 @@ class PhysicalKeyData {
return outputMap;
}

/// Parses entries from Androids Generic.kl scan code data file.
/// Parses entries from Android's `Generic.kl` scan code data file.
///
/// Lines in this file look like this (without the ///):
///
/// ```
/// key 100 ALT_RIGHT
/// # key 101 "KEY_LINEFEED"
/// key 477 F12 FUNCTION
/// ```
///
/// We parse the commented out lines as well as the non-commented lines, so
/// that we can get names for all of the available scan codes, not just ones
/// defined for the generic profile.
///
/// Also, note that some keys (notably MEDIA_EJECT) can be mapped to more than
/// Some keys (notably `MEDIA_EJECT`) can be mapped to more than
/// one scan code, so the mapping can't just be 1:1, it has to be 1:many.
static Map<String, List<int>> _readAndroidScanCodes(String keyboardLayout, String nameMap) {
final RegExp keyEntry = RegExp(
Expand Down
Expand Up @@ -164,7 +164,7 @@ class MyStatelessWidget extends StatelessWidget {
),
// A group that orders in widget order, regardless of what the order is set to.
FocusTraversalGroup(
// Note that because this is NOT an OrderedTraversalPolicy, the
// Because this is NOT an OrderedTraversalPolicy, the
// assigned order of these OrderedButtons is ignored, and they
// are traversed in widget order. TRY THIS: change this to
// "OrderedTraversalPolicy()" and see that it now follows the
Expand Down
Expand Up @@ -52,15 +52,15 @@ class _HomeState extends State<Home> {
_fooVersion += 1;
// Changing the SharedAppData's value for 'foo' causes the
// widgets that depend on 'foo' to be rebuilt.
SharedAppData.setValue<String, String?>(context, 'foo', 'FOO $_fooVersion'); // note: no setState()
SharedAppData.setValue<String, String?>(context, 'foo', 'FOO $_fooVersion'); // no need to call setState()
},
),
const SizedBox(height: 16),
ElevatedButton(
child: const Text('change bar'),
onPressed: () {
_barVersion += 1;
SharedAppData.setValue<String, String?>(context, 'bar', 'BAR $_barVersion'); // note: no setState()
SharedAppData.setValue<String, String?>(context, 'bar', 'BAR $_barVersion'); // no need to call setState()
},
),
],
Expand Down
Expand Up @@ -28,7 +28,7 @@ void main() {
}

void expectInnerGestureDetectorBehavior(WidgetTester tester, HitTestBehavior behavior) {
// Note that there is a third GestureDetector added by Scaffold
// There is a third GestureDetector added by Scaffold.
final Finder innerGestureDetectorFinder = find.byType(GestureDetector).at(1);
final GestureDetector innerGestureDetector = tester.firstWidget<GestureDetector>(innerGestureDetectorFinder);
expect(innerGestureDetector.behavior, behavior);
Expand Down
28 changes: 14 additions & 14 deletions examples/layers/raw/canvas.dart
Expand Up @@ -32,24 +32,24 @@ ui.Picture paint(ui.Rect paintBounds) {
final double devicePixelRatio = ui.window.devicePixelRatio;
final ui.Size logicalSize = ui.window.physicalSize / devicePixelRatio;

// Saves a copy of current transform onto the save stack
// Saves a copy of current transform onto the save stack.
canvas.save();

// Note that transforms that occur after this point apply only to the
// yellow-bluish rectangle
// Transforms that occur after this point apply only to the
// yellow-bluish rectangle.

// This line will cause the transform to shift entirely outside the paint
// boundaries, which will cause the canvas interface to discard its
// commands. Comment it out to see it on screen.
canvas.translate(-mid.dx / 2.0, logicalSize.height * 2.0);

// Clips the current transform
// Clips the current transform.
canvas.clipRect(
ui.Rect.fromLTRB(0, radius + 50, logicalSize.width, logicalSize.height),
clipOp: ui.ClipOp.difference,
);

// Shifts the coordinate space of and rotates the current transform
// Shifts the coordinate space of and rotates the current transform.
canvas.translate(mid.dx, mid.dy);
canvas.rotate(math.pi/4);

Expand All @@ -59,14 +59,14 @@ ui.Picture paint(ui.Rect paintBounds) {
<ui.Color>[const ui.Color(0xFFFFFF00), const ui.Color(0xFF0000FF)],
);

// Draws a yellow-bluish rectangle
// Draws a yellow-bluish rectangle.
canvas.drawRect(
ui.Rect.fromLTRB(-radius, -radius, radius, radius),
ui.Paint()..shader = yellowBlue,
);

// Note that transforms that occur after this point apply only to the
// yellow circle
// Transforms that occur after this point apply only to the
// yellow circle.

// Scale x and y by 0.5.
final Float64List scaleMatrix = Float64List.fromList(<double>[
Expand All @@ -77,20 +77,20 @@ ui.Picture paint(ui.Rect paintBounds) {
]);
canvas.transform(scaleMatrix);

// Sets paint to transparent yellow
// Sets paint to transparent yellow.
paint.color = const ui.Color.fromARGB(128, 0, 255, 0);

// Draws a transparent yellow circle
// Draws a transparent yellow circle.
canvas.drawCircle(ui.Offset.zero, radius, paint);

// Restores the transform from before `save` was called
// Restores the transform from before `save` was called.
canvas.restore();

// Sets paint to transparent red
// Sets paint to transparent red.
paint.color = const ui.Color.fromARGB(128, 255, 0, 0);

// Note that this circle is drawn on top of the previous layer that contains
// the rectangle and smaller circle
// This circle is drawn on top of the previous layer that contains
// the rectangle and smaller circle.
canvas.drawCircle(const ui.Offset(150.0, 300.0), radius, paint);

// When we're done issuing painting commands, we end the recording an receive
Expand Down
8 changes: 4 additions & 4 deletions packages/flutter/lib/fix_data/README.md
Expand Up @@ -31,10 +31,10 @@ https://github.com/flutter/flutter/wiki/Data-driven-Fixes

## When making structural changes to this directory

Note that the tests in this directory are also invoked from external
repositories. Specifically, the CI system for the dart-lang/sdk repo runs these
tests in order to ensure that changes to the dart fix file format do not break
Flutter.
The tests in this directory are also invoked from external
repositories. Specifically, the CI system for the dart-lang/sdk repo
runs these tests in order to ensure that changes to the dart fix file
format do not break Flutter.

See [tools/bots/flutter/analyze_flutter_flutter.sh](https://github.com/dart-lang/sdk/blob/main/tools/bots/flutter/analyze_flutter_flutter.sh)
for where the tests are invoked.
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/lib/src/cupertino/refresh.dart
Expand Up @@ -398,7 +398,7 @@ class CupertinoSliverRefreshControl extends StatefulWidget {
switch (refreshState) {
case RefreshIndicatorMode.drag:
// While we're dragging, we draw individual ticks of the spinner while simultaneously
// easing the opacity in. Note that the opacity curve values here were derived using
// easing the opacity in. The opacity curve values here were derived using
// Xcode through inspecting a native app running on iOS 13.5.
const Curve opacityCurve = Interval(0.0, 0.35, curve: Curves.easeInOut);
return Opacity(
Expand Down
3 changes: 2 additions & 1 deletion packages/flutter/lib/src/gestures/resampler.dart
Expand Up @@ -240,7 +240,8 @@ class PointerEventResampler {
// generated when the position has changed.
if (event is! PointerMoveEvent && event is! PointerHoverEvent) {
// Add synthetics `move` or `hover` event if position has changed.
// Note: Devices without `hover` events are expected to always have
//
// Devices without `hover` events are expected to always have
// `add` and `down` events with the same position and this logic will
// therefore never produce `hover` events.
if (position != _position) {
Expand Down
15 changes: 7 additions & 8 deletions packages/flutter/lib/src/material/button_bar.dart
Expand Up @@ -146,15 +146,14 @@ class ButtonBar extends StatelessWidget {

/// The spacing between buttons when the button bar overflows.
///
/// If the [children] do not fit into a single row, they are
/// arranged into a column. This parameter provides additional
/// vertical space in between buttons when it does overflow.
/// If the [children] do not fit into a single row, they are arranged into a
/// column. This parameter provides additional vertical space in between
/// buttons when it does overflow.
///
/// Note that the button spacing may appear to be more than
/// the value provided. This is because most buttons adhere to the
/// [MaterialTapTargetSize] of 48px. So, even though a button
/// might visually be 36px in height, it might still take up to
/// 48px vertically.
/// The button spacing may appear to be more than the value provided. This is
/// because most buttons adhere to the [MaterialTapTargetSize] of 48px. So,
/// even though a button might visually be 36px in height, it might still take
/// up to 48px vertically.
///
/// If null then no spacing will be added in between buttons in
/// an overflow state.
Expand Down
28 changes: 14 additions & 14 deletions packages/flutter/lib/src/material/dialog.dart
Expand Up @@ -482,9 +482,10 @@ class AlertDialog extends StatelessWidget {
/// Typically used to provide padding to the button bar between the button bar
/// and the edges of the dialog.
///
/// If there are no [actions], then no padding will be included. It is also
/// important to note that [buttonPadding] may contribute to the padding on
/// the edges of [actions] as well.
/// The [buttonPadding] may contribute to the padding on the edges of
/// [actions] as well.
///
/// If there are no [actions], then no padding will be included.
///
/// {@tool snippet}
/// This is an example of a set of actions aligned with the content widget.
Expand Down Expand Up @@ -546,21 +547,20 @@ class AlertDialog extends StatelessWidget {
/// * [OverflowBar], which [actions] configures to lay itself out.
final VerticalDirection? actionsOverflowDirection;

/// The spacing between [actions] when the [OverflowBar] switches
/// to a column layout because the actions don't fit horizontally.
/// The spacing between [actions] when the [OverflowBar] switches to a column
/// layout because the actions don't fit horizontally.
///
/// If the widgets in [actions] do not fit into a single row, they are
/// arranged into a column. This parameter provides additional
/// vertical space in between buttons when it does overflow.
/// arranged into a column. This parameter provides additional vertical space
/// between buttons when it does overflow.
///
/// Note that the button spacing may appear to be more than
/// the value provided. This is because most buttons adhere to the
/// [MaterialTapTargetSize] of 48px. So, even though a button
/// might visually be 36px in height, it might still take up to
/// 48px vertically.
/// The button spacing may appear to be more than the value provided. This is
/// because most buttons adhere to the [MaterialTapTargetSize] of 48px. So,
/// even though a button might visually be 36px in height, it might still take
/// up to 48px vertically.
///
/// If null then no spacing will be added in between buttons in
/// an overflow state.
/// If null then no spacing will be added in between buttons in an overflow
/// state.
final double? actionsOverflowButtonSpacing;

/// The padding that surrounds each button in [actions].
Expand Down