Skip to content

Migrate_design_widgets fix still does not rewrite export directives (Dart 3.13.5) #64560

Open

Description

@marwaMejri

The Dart 3.13.1 changelog says:

Fixes dart fix --apply --code=migrate_design_widgets to replace URIs in both import and export statements. (issue #63968)

With Dart 3.13.5 (Flutter 3.47.6 stable), export directives are still left on package:flutter/material.dart, both in a file that only exports and in a file that also has an import migrated by the same fix.

Steps to reproduce

flutter create export_repro
cd export_repro
printf "export 'package:flutter/material.dart';\n" > lib/plain_export.dart
printf "import 'package:flutter/material.dart';\nexport 'package:flutter/material.dart';\n\nconst Widget placeholder = Placeholder();\n" > lib/mixed.dart
dart fix --apply --code=migrate_design_widgets
cat lib/mixed.dart
cat lib/plain_export.dart

Expected

Both export directives are rewritten to package:material_ui/material_ui.dart.

Actual

lib/plain_export.dart gets no fix (it is not listed by dart fix --dry-run either). In lib/mixed.dart, only the import is rewritten:

import 'package:material_ui/material_ui.dart';
export 'package:flutter/material.dart';

const Widget placeholder = Placeholder();
export 'package:flutter/material.dart';

A file with library; before the export, and a file exporting package:flutter/cupertino.dart with a hide clause, are not listed by dart fix --dry-run either.

Why it matters

Barrel files that re-export the design libraries are common. In my app, a widget imported through an unmigrated barrel file kept reading the SDK's Theme and silently painted with the default theme, with no analyzer error. The project is here, with every command output: https://github.com/marwaMejri/material_ui_migration (tag first-app-without-migration, file lib/core/ui.dart).

Environment

Dart SDK version: 3.13.5 (stable) (Tue Sep 29 01:00:52 2026 -0700) on "macos_arm64"
Flutter 3.47.6 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 5fc346839b (12 days ago) • 2026-09-30 15:02:49 -0700
Engine • hash b8c8d3d8d5d0095127057f8a29ca8cc53da2167c (revision 692136cb65) (12 days ago) • 2026-09-30 00:56:59.000Z
Tools • Dart 3.13.5 • DevTools 2.60.0

Activity

  1. added
    area-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.
    on Oct 12, 2026
  2. FMorschel commented on Oct 12, 2026

    @FMorschel
    Contributor
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

    area-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions