Skip to content

(Test cross-imports) Don't cross-import test utils #182636

Description

@justinmc

Some test files import test utilities from other library's tests. This won't be possible once Material and Cupertino are moved to the flutter/packages repo.

For example:

import '../widgets/semantics_tester.dart';

Umbrella issue: #177028

What to do about it

  • Move the util to flutter_test if:
    • it's used in many places.
    • it has a solid API that has been in use for awhile and we are ready to commit to it.
    • it's of public-level quality.
  • Duplicate the util if:
    • its implementation is trivial, or it's just a constant, etc.
    • we are worried about its API needing changes and don't want to make it public.
  • Any other options? I don't think it will be possible to import it any other way.

The utils

Rendering:

Widgets:

Tests to fix:

Material importing Widgets

$ rg "import '\.\.\/widgets" packages/flutter/test/material -l

Cupertino importing Widgets

$ rg "import '\.\.\/widgets" packages/flutter/test/cupertino -l

Cupertino importing Rendering

$ rg "import '\.\.\/rendering" packages/flutter/test/cupertino -l

Activity

  1. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    p: material_uimaterial_ui package in flutter/packages
    p: cupertino_uicupertino_ui package in flutter/packages
    a: tests"flutter test", flutter_test, or one of our tests
    on Mar 6, 2026
  2. added
    P2Important issues not at the top of the work list
    on Mar 10, 2026
  3. 90 remaining items

  4. added
    packageflutter/packages repository. See also p: labels.
    and removed
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Aug 17, 2026
  5. added
    team-designOwned by Design Languages team
    triaged-designTriaged by Design Languages team
    and removed on Aug 26, 2026
  6. Piinks commented on Oct 19, 2026

    @Piinks
    Contributor

    @justinmc is this resolved now that material and cupertino are stable in flutter/packages?

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

    P1High-priority issues at the top of the work lista: tests"flutter test", flutter_test, or one of our testsp: cupertino_uicupertino_ui package in flutter/packagesp: material_uimaterial_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.team-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions