Skip to content

Be consistent about callback parameter names for tapping/pressing something #17407

Description

@alanrussian

Some widgets use onPressed and others use onTap. I find two issues here:

  • The name is inconsistent.
  • The tense is inconsistent.

This makes it (very slightly) more difficult to use these widgets.

Is there a preferred naming convention for these callbacks?

Activity

  1. alanrussian commented on May 8, 2018

    @alanrussian
    ContributorAuthor

    In regards to tense, it looks like present tense is preferred by the style guide: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#naming-rules-for-typedefs-and-function-variables

  2. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    c: API breakBackwards-incompatible API changes
    on Jul 27, 2018
  3. added this to the milestone on Jan 28, 2019
  4. goderbauer commented on Feb 27, 2020

    @goderbauer
    Member

    I added this to the list in #24722.

  5. github-actions commented on Aug 15, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  6. locked as resolved and limited conversation to collaborators on Aug 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: qualityA truly polished experiencec: API breakBackwards-incompatible API changesframeworkflutter/packages/flutter repository. See also f: labels.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions