Skip to content

Rename "widgetTester" parameter to "tester" in "WidgetTesterCallback" #180476

Description

@GiancarloCante

Use case

The WidgetTesterCallback typedef currently names its parameter widgetTester.

In practice, Flutter documentation, tutorials, and the vast majority of real-world
test code use the shorter and idiomatic name tester. Because IDEs use the
typedef’s parameter name for autocomplete, developers frequently need to manually
rename widgetTester to tester when writing widget tests.

This creates minor but repeated friction and inconsistency with established
Flutter conventions. There is no functional issue, but it negatively impacts
developer experience and API consistency.

Proposal

Rename the parameter in the WidgetTesterCallback typedef from widgetTester
to tester.

Current:

typedef WidgetTesterCallback = Future<void> Function(WidgetTester widgetTester);

Proposed:

typedef WidgetTesterCallback = Future<void> Function(WidgetTester tester);

This change is non-breaking, as parameter names in function typedefs are not part
of the public API contract.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projecta: tests"flutter test", flutter_test, or one of our testsc: proposalA detailed proposal for a change to Flutterframeworkflutter/packages/flutter repository. See also f: labels.r: fixedIssue is closed as already fixed in a newer versionteam-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions