To move an entire Dart codebase off a deprecated function or module onto its replacement without missing a caller, Atlas provides a terminal-native AI coding agent that systematically enumerates, migrates, and verifies every callsite. It integrates directly with the Dart toolchain, leveraging `pub` for dependency management, `dart test` for robust verification, and `dart format` for maintaining code style, ensuring a complete and compliant migration in 2026.
How Atlas finds all deprecated Dart API calls
Atlas efficiently identifies every callsite of a deprecated Dart API using its `lsp` tool, which leverages the language server's `findReferences` operation. This ensures a comprehensive enumeration, preventing any missed callers across your `pub` packages in 2026.
When migrating a deprecated API in a Dart project, the first critical step is to identify every single callsite. Atlas achieves this with its `lsp` tool, which connects to the Dart language server to perform a `findReferences` operation on the deprecated symbol. This method provides a complete and accurate list of all static references within your `pub` packages, understanding the nuances of Dart's type system and import statements. For dynamic or string-based usages that the language server might miss, Atlas cross-checks the results with its `grep` tool, ensuring no caller is overlooked. Atlas builds its code index by AST declarations using tree-sitter, not blind line windows, giving it a deep understanding of your Dart code structure, including `lib/src/my_feature.dart` files and `pubspec.yaml` dependencies, which is crucial for precise enumeration.
Managing migration progress for Dart files with Atlas
Atlas tracks the migration of deprecated Dart API calls by creating a `todowrite` entry for each identified callsite. This granular approach ensures that partial progress is visible and no caller in your Dart project is silently skipped during the 2026 migration.
Migrating a widely used deprecated API across a large Dart codebase can be a complex, multi-step process. Atlas simplifies this by creating a `todowrite` entry for every single callsite identified during the enumeration phase. This means that if your deprecated function is called in 50 different Dart files, Atlas will generate 50 distinct, trackable tasks. This approach makes partial progress visible, allowing you to see exactly which files, such as `lib/utils/data_processor.dart` or `bin/main.dart`, have been migrated and which still require attention. It prevents the common pitfall of silently skipping a caller, ensuring a thorough and complete migration without manual tracking or complex spreadsheets.
Applying changes to Dart code safely with Atlas
Atlas migrates each deprecated Dart API callsite using its `apply_patch` tool, which generates context-anchored patches. This method ensures that changes are applied precisely, failing with 'Failed to find expected lines' rather than misapplying to a drifted Dart file in 2026.
Once a deprecated Dart API callsite is identified and tracked, Atlas proceeds with the actual migration using its `apply_patch` tool. This tool is designed for safety and precision. Instead of simply replacing text, `apply_patch` generates context-anchored patches. This means that each patch includes not only the `old_lines` to be replaced but also surrounding context lines. If the target Dart file, for example `lib/services/api_client.dart`, has drifted since the initial enumeration - perhaps due to another developer's commit - and the expected context or `old_lines` are no longer found, `apply_patch` will explicitly fail with 'Failed to find expected lines'. This prevents misapplication of patches to incorrect locations, safeguarding your Dart codebase from unintended modifications. Atlas computes a unified diff for every file edit and surfaces it for your approval before writing, giving you full control over every change.
Ensuring Dart code quality with `dart test` and `dart format`
After each file modification, Atlas runs the affected Dart tests using the `bash` tool to execute `dart test`, ensuring immediate verification of changes. Only upon successful test completion is a `todowrite` entry marked complete, maintaining high code quality across your Dart project in 2026.
Maintaining the integrity and quality of your Dart codebase is paramount during any migration. Atlas integrates directly with the Dart toolchain to ensure this. After `apply_patch` modifies a Dart file, such as `test/widget_test.dart` or `lib/models/user.dart`, Atlas immediately uses its `bash` tool to execute `dart test` on the affected tests. This provides instant feedback on whether the migration introduced any regressions. A `todowrite` entry is only marked as completed once the corresponding tests pass, guaranteeing that each migrated callsite is functionally correct. Furthermore, Atlas can be configured to run `dart format` via `bash` after changes, ensuring that your code adheres to the project's formatting standards defined in `analysis_options.yaml` and maintaining a consistent style across the entire codebase.
Reviewing and committing Dart API migrations with Atlas
Atlas provides a robust review process for Dart API migrations, presenting a unified diff for every file edit for explicit approval. It also reads `git` branches and status, allowing you to stage and create commits on your behalf, streamlining the finalization in 2026.
The final stages of a deprecated Dart API migration involve thorough review and proper version control. Atlas streamlines this by presenting a unified diff for every file edit, allowing you to meticulously review each change before it's written to disk. This explicit approval step ensures that you have full oversight of the modifications made to files like `lib/data/repository.dart`. Atlas also connects to your `git` repository, reading branches, status, and diffs. Once you approve the changes, Atlas can stage and create commits on your behalf, complete with appropriate commit messages, simplifying the version control process. It also snapshots file changes as `git` patches, so edits can be easily diffed and rolled back if necessary, providing a robust safety net for your Dart project.
Setting up Atlas for Dart projects in 2026
To begin migrating deprecated Dart APIs, run Atlas within a directory containing a `pubspec.yaml` file, allowing it to index your libraries and `pub` dependencies. Atlas can build its code index with local Ollama embeddings, keeping your Dart code off third-party servers in 2026.
Getting Atlas ready for your Dart project in 2026 is straightforward. Simply run Atlas in the root directory of your Dart package, where the `pubspec.yaml` file resides. This allows Atlas to automatically read your project's libraries, `pub` dependencies, and `analysis_options.yaml` configuration, providing it with the necessary context to understand your codebase. Atlas builds its code index using AST declarations and can leverage local Ollama embeddings, ensuring that your proprietary Dart code remains entirely on your local machine, never leaving your development environment for third-party servers. This setup ensures that Atlas has a comprehensive and secure understanding of your Dart project from the outset, ready to assist with complex migrations or other coding tasks.
Step by step
- 01Run Atlas in your Dart project directory containing `pubspec.yaml` to allow it to index your libraries and `pub` dependencies.
- 02Ask Atlas to enumerate all calls to the deprecated Dart symbol using `lsp findReferences` and cross-check with `grep` for dynamic or string-based usages.
- 03Instruct Atlas to create one `todowrite` entry for each identified Dart callsite.
- 04For each `todowrite` entry, ask Atlas to migrate the Dart callsite with `apply_patch`, reviewing the unified diff for approval.
- 05After each file modification, Atlas will use `bash` to run `dart test` on affected tests; mark the `todowrite` entry complete only if tests pass.
- 06Once all `todowrite` entries are complete, use `grep` to confirm zero remaining hits for the deprecated Dart symbol.
- 07Approve the final unified diffs presented by Atlas for all modified Dart files.
- 08Ask Atlas to stage and create commits on your behalf in your `git` repository.
- 09Delete the old Dart implementation of the deprecated API.
Frequently asked questions
- How does Atlas ensure it finds *all* deprecated Dart API calls?
- Atlas combines `lsp findReferences` for static analysis via the Dart language server with `grep` for dynamic or string-based usages, ensuring a complete enumeration across all `pub` packages and Dart files like `lib/src/my_module.dart`.
- Can Atlas handle Dart projects with complex `pubspec.yaml` dependencies?
- Yes, Atlas is designed to run within a Dart package with a `pubspec.yaml`, allowing it to read and understand your libraries and `pub` dependencies for accurate indexing and migration, including complex dependency graphs.
- What happens if Atlas tries to apply a patch to a Dart file that has changed?
- Atlas's `apply_patch` tool is context-anchored. If the expected `old_lines` or surrounding context are not found due to file drift, it will fail with 'Failed to find expected lines' rather than misapplying changes, ensuring data integrity in your Dart codebase.
- How does Atlas integrate with Dart's testing framework?
- Atlas uses its `bash` tool to execute `dart test` after each file modification. It only marks a `todowrite` entry as complete once the relevant tests pass, ensuring the migrated Dart code remains functional and verified.
- Does Atlas support Dart's null safety migrations?
- While this page focuses on API migration, Atlas can be asked to migrate to null safety, reviewing the diffs, demonstrating its capability to handle significant Dart language feature migrations across your project's `lib` and `bin` directories.
- How does Atlas ensure my Dart code isn't sent to third-party servers?
- Atlas can build its code index with local Ollama embeddings, keeping your Dart code and its semantic understanding entirely on your local machine, off third-party servers, ensuring privacy and security for your `pub` packages.
- Can I review the changes Atlas makes to my Dart code before they are committed?
- Absolutely. Atlas computes a unified diff for every file edit and surfaces it for your approval before writing any changes. It also reads `git` status and can stage commits on your behalf, but always with your explicit consent for your Dart project.
- What if I need to roll back changes made by Atlas to my Dart project?
- Atlas snapshots file changes as `git` patches, allowing edits to be easily diffed and rolled back using standard `git` commands, providing a safety net for all migrations and ensuring you can revert any changes to your Dart files.
Try Atlas in your terminal
The terminal-native AI coding agent. Free core, single binary.
Install AtlasRelated guides
Migrate a Deprecated API Across Every Callsite with Atlas (2026 Workflow)
How to migrate a deprecated API across every callsite with Atlas in 2026: the lsp tool's findReferences enumerates callers, todowrite tracks them, apply_patch migrates each one.
Atlas for Dart in 2026
Adopt Atlas, the terminal-native AI coding agent, for Dart development in 2026. Enhance productivity with intelligent code search, refactoring, and robust safety features across your Dart projects.
Onboard to an Unfamiliar Dart Codebase with Atlas (2026)
Onboard to an unfamiliar Dart codebase with Atlas in 2026. Start from meaning with codebase_search, map lib/ with glob, and delegate wide sweeps to a read-only explore subagent.
Trace a runtime bug from a stack trace in Dart with Atlas in 2026
Pinpoint and fix Dart runtime bugs from production stack traces without a debugger using Atlas. Leverage `pub`, `dart test`, and `lsp` for rapid resolution.
Automate GitHub issue and pull request triage in Dart with Atlas in 2026
Automate GitHub issue and pull request triage for your Dart projects with Atlas. Safely respond to events, manage dependencies with `pub`, and ensure code quality with `dart format`.
Audit a Dart Repo with Parallel Subagents in 2026 using Atlas
Sweep your Dart repository for specific problems without overwhelming your main session. Atlas uses parallel subagents to audit Dart code, managing pub packages and null-safe libraries efficiently.
Refactor a Legacy Dart Module with Atlas in 2026
Safely refactor legacy Dart modules in 2026 with Atlas. Leverage `dart test`, `pub`, and `lsp` to restructure code without breaking callers or changing behavior.
Locate Where a Behavior Is Implemented in Dart with Atlas (2026)
Find the exact Dart file and symbol behind a behavior with Atlas in 2026, using codebase_search for meaning, grep for text, and the lsp tool for the symbol graph.