Skip to content

Conversation

@jameslee9506
Copy link
Contributor

When you're using ide like intelliJ, if function parameter is omitted, code completion suggests using paramter name like c0, c1... Below is example what i said.

스크린샷 2023-02-03 오전 10 09 24

It affects two main usage, LayoutBuilder, SliverLayoutBuilder and many people are using parameter name below. (coplilot recommended 👍 )

    LayoutBuilder( // or SliverLayoutBuilder
      builder: (context, constraints) {
        
      },
    );

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

when you're using ide like intelliJ, if function parameter is omitted, code completion suggests using paramter name like c0, c1...
@flutter-dashboard flutter-dashboard bot added the framework flutter/packages/flutter repository. See also f: labels. label Feb 3, 2023
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Copy link
Member

@goderbauer goderbauer left a comment

Choose a reason for hiding this comment

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

LGTM

///
/// The builder must not return null.
final Widget Function(BuildContext, ConstraintType) builder;
final Widget Function(BuildContext context, ConstraintType constraints) builder;
Copy link
Member

Choose a reason for hiding this comment

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

Actually, per our style guide this should actually be using a typedef. Something like:

Suggested change
final Widget Function(BuildContext context, ConstraintType constraints) builder;
final ConstrainedLayoutWidgetBuilder<ConstraintType> builder;

with

/// The signature of the [ConstrainedLayoutBuilder] builder function.
typedef ConstrainedLayoutWidgetBuilder<ConstraintType extends Constraints> = Widget Function(BuildContext context, ConstraintType constraints);

Since you're in here, would you mind cleaning this up?

@goderbauer
Copy link
Member

Since this affects the IDE experience, it could be worthwhile to have a lint reminding us to always add function parameter names (cc @pq). @bebe0612 Would you mind filing a request for that at https://github.com/dart-lang/linter/issues/new/choose ?

@Hixie
Copy link
Contributor

Hixie commented Feb 7, 2023

test-exempt: code style

but many bonus points would be applied if you could find a way to detect this kind of problem in the code (e.g. via a lint).

@goderbauer
Copy link
Member

Let's submit this as-is for now, I'll follow up with a PR to fix my (unrelated) nit.

@goderbauer goderbauer added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 28, 2023
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Feb 28, 2023
@auto-submit
Copy link
Contributor

auto-submit bot commented Feb 28, 2023

auto label is removed for flutter/flutter, pr: 119877, due to - Please get at least one approved review if you are already a member or two member reviews if you are not a member before re-applying this label. Reviewers: If you left a comment approving, please use the "approve" review action instead.

@auto-submit
Copy link
Contributor

auto-submit bot commented Feb 28, 2023

auto label is removed for flutter/flutter, pr: 119877, due to Validations Fail.

Copy link
Contributor

@Piinks Piinks left a comment

Choose a reason for hiding this comment

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

LGTM!

@Piinks Piinks added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 28, 2023
@auto-submit auto-submit bot merged commit 3c70fb2 into flutter:master Mar 1, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 1, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 1, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 1, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 1, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 1, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 1, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 1, 2023
@goderbauer
Copy link
Member

Filed lint proposal: dart-lang/sdk#59047

engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 2, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 2, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 2, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 2, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 2, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 2, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 2, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 3, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 3, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 10, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 10, 2023
@hgraceb hgraceb mentioned this pull request Dec 13, 2023
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants