Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Conversation

@mklim
Copy link
Contributor

@mklim mklim commented Nov 19, 2019

Description

Also adds a lint to prevent undocumented APIs going forward.

Related Issues

Fixes flutter/flutter#44405.

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors (See Contributor Guide).
  • All existing and new tests are passing.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (flutter analyze) does not report any problems on my PR.
  • I read and followed the Flutter Style Guide.
  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy.
  • I updated CHANGELOG.md to add a description of the change.
  • I signed the CLA.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (please indicate a breaking change in CHANGELOG.md and increment major revision).
  • No, this is not a breaking change.

@mklim mklim requested a review from cyanglaz November 19, 2019 01:40
@mklim mklim requested a review from iskakaushik as a code owner November 19, 2019 01:40
Copy link
Contributor

@cyanglaz cyanglaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM modulo some nits.

Comment on lines 54 to 56
/// For example, assume that the entire video is 4 minutes long. If [end] has a
/// duration of two minutes, this will return `0.5` since the DurationRange
/// ends 50% of the way through the video's total length.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use a similar example with the startFraction so it's easier to understand. 0.5 is kind of ambitious.
maybe 1 min -> 0.75 -> 75%

/// Whether or not [errorDescription] is null.
bool get hasError => errorDescription != null;

/// Returns [size.width] / [size.height] when size is non-null, or `1.0.` when
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto as initialized

Copy link
Contributor Author

@mklim mklim Nov 22, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think in this specific case (unlike the other two) this is actually explaining what the getter does in a way that's hard to simplify. An aspect ratio really is either width / height or height / width, and I think it's useful to know what happens in strange edge cases where there aren't any dimensions loaded yet.

Comment on lines 388 to 389
/// This finishes as soon as the "play" command has been sent to the platform,
/// not when playback is complete.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe: This method returns as soon as the playback has started, not when it is complete.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is referring specifically to the future. It completes once "play" itself starts, not when playback is complete. I thought that was potentially confusing so I mentioned it. I'll clear this up to say "The future that is returned from this method finishes as soon as..."

/// controlled by [controller].
///
/// Defaults will be used for everything except [controller] if they're not
/// provided. [allowScrubbing] defaults to false, and [padding] will default
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nits: The [allowingScrubing]...
I think we don't start sentences with small letter characters

Copy link
Contributor Author

@mklim mklim Nov 22, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's weird to start off a sentence with "[a", but I think this is actually correct here for a few reasons.

Using "the" would imply that allowScrubbing is significant somehow--that it's a specific allowScrubbing out of multiple possible allowScrubbings out there, or maybe somehow very important. Similarly if I were to use "a/an" I would be implying a random allowScrubbing out of the various allowScrubbings available. But In this case there is only one parameter called allowScrubbing, so it doesn't make sense to use either article. I'm referring to the one and only allowScrubbing throughout, and it's just a regular parameter like any other one.

And then after that normally sentences do start with upper case letters. This is where it gets into extremely confusing territory because prescriptive grammarians haven't really caught on to coding documentation yet, but here I'm basically using [allowScrubbing] as a name that is also lower cased. That's unusual for English, but when it does happen it is generally considered to be correct to just use the proper name as it's normally capitalized instead of upper casing it, the same if I were talking about iPhones. See https://english.stackexchange.com/a/68665 for some discussion on it.

That said, English doesn't really have real grammar rules so this is all very subjective.

Michael Klimushyn added 3 commits November 22, 2019 10:54
Also adds a lint to prevent undocumented APIs going forward.
@mklim mklim merged commit 56b81b7 into flutter:master Nov 22, 2019
@mklim mklim deleted the video_player_polish branch November 22, 2019 20:15
sungmin-park pushed a commit to sungmin-park/flutter-plugins that referenced this pull request Dec 17, 2019
Also adds a lint to prevent undocumented APIs going forward.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[video_player] Polish issues

3 participants