Skip to content

Minimize cross imports in examples #190305

Open

Description

@justinmc

The examples, located in the package root and in packages/flutter, should avoid cross imports.

  • If an example is unrelated to Material and Cupertino, consider refactoring it to only use Widgets.
  • If an example is realted to Material or Cupertino, consider moving it to material_ui or cupertino_ui.

See knownExamplesCrossImports, which contains a list of all example files with cross imports. The examples in api/lib/material and api/lib/cupertino do not need to be migrated because they have already been moved to material_ui or cupertino_ui.

As discussed in #190237 (comment), there's a small amount of concern for these imports of material_ui and cupertino_ui causing complicated migrations.

Part of #177028

Activity

  1. added
    in triagePresently being triaged by the triage team
    frameworkflutter/packages/flutter repository. See also f: labels.
    and removed
    in triagePresently being triaged by the triage team
    on Jul 31, 2026
  2. added
    P2Important issues not at the top of the work list
    on Aug 4, 2026
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

    P2Important issues not at the top of the work listd: examplesSample code and demosframeworkflutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions