Skip to content

[go_router] Finish the @internal attribute migration #171410

@loic-sharma

Description

@loic-sharma

⚠ This work is blocked until all Flutter versions supported by go_router have this change: #170563.

Work

flutter/packages#9434 updated several go_router files to use a library prefix to reference @internal.

This library prefix should be removed. For example:

- import 'package:meta/meta.dart' as meta;
+ import 'package:meta/meta.dart';

- @meta.internal
+ @internal
void someMethod() {

Background

The go_router package supports Flutter's main and stable channels, as well as the two previous stable releases (here).

flutter/packages#9434 was necessary as #170563 updated package:flutter's foundation library to export internal.

Since go_router has files that import both package:meta/meta.dart and package:flutter/foundation.dart, that caused lint failures like:

info - lib/src/match.dart:12:8 - The import of 'package:meta/meta.dart' is unnecessary because all of the used elements are also provided by the import of 'package:flutter/foundation.dart'. Try removing the import directive. - unnecessary_import
info - lib/src/route.dart:10:8 - The import of 'package:meta/meta.dart' is unnecessary because all of the used elements are also provided by the import of 'package:flutter/foundation.dart'. Try removing the import directive. - unnecessary_import

flutter/packages#9434 allowed go_router to work regardless whether the foundation library exports internal. Once go_router only supports Flutter versions that export internal, this can be cleaned up. ETA: early 2026 per go/dash-team-releases.

Metadata

Metadata

Assignees

Labels

P3Issues that are less important to the Flutter projectp: go_routerThe go_router packagepackageflutter/packages repository. See also p: labels.team-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions