Skip to content
pubscout

import_path_converter

1.0.1, released 5 years ago by ymgn9314.com

Automatically convert relative and absolute import paths in Dart files.

$ flutter pub add import_path_converter

What it does

It scans your lib, bin, test, and tests folders to automatically convert relative imports to absolute package imports (or vice versa). You can run it via the command line or configure it in your pubspec.yaml file.

AI-written summary of version 1.0.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You want a consistent import path style across your Dart and Flutter codebase.
  • You want to enforce import formatting rules in a CI pipeline using --exit-if-changed.

Skip it when

  • You prefer manual control over every import path without automated formatting.
  • Your project relies on tooling that conflicts with automated path conversion.

Strengths

  • Supports command-line execution and CI integration with flags like --exit-if-changed.
  • Configurable through pubspec.yaml to ignore specific files or toggle relative paths.

Weaknesses

  • Limited documentation regarding advanced custom configurations beyond the provided examples.
  • Relies on external regex or command-line filtering for granular control.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
4

Add the package as a dev dependency using `flutter pub add --dev import_path_converter` and run via `flutter pub run import_path_converter:main`.

flutter pub run import_path_converter:main

Alternatives

Packages that do the same job and could replace import_path_converter.

Works with

Packages commonly used together with import_path_converter: ones it builds on, ones built on it, and its own family.