PackageTrack
Sign in Get early access

api_to_dart

Convert any API (Postman, OpenAPI, Apidog, or YAML) into type-safe Dart actions and response models, from an interactive terminal selector or a local web UI.

0.6.0 58 downloads/mo #3522 most downloaded on pub.dev abdo-ahmed-it/api_to_dart

What this package is like to depend on

Last release 2 months ago

09 Jun 2026

Ships on a steady schedule

a new release about every 3 weeks

Most releases are documented

notes for 6 of 7 stable releases

Nothing withdrawn

no release was ever pulled

3 months old

7 releases · first in 2026

7 releases in the last 12 months

see the full history below

Release timeline

7 releases · Apr 2026 to Jun 2026
Release Pre-release

Releases

latest 7
  1. 0.6.0 09 Jun 2026
    Release notes

    Added

    • Local web UI — a browser-based, Apidog-like workspace to browse, try, and generate from your endpoints. Two ways in:
      • The interactive wizard (api2dart with no args) prints an optional web link after loading endpoints — for any source (Postman/Apidog/file). The terminal selector still works exactly as before; the link is an extra way to work in the browser. The server runs in its own isolate (so it stays responsive while the terminal selector is active) until Ctrl+C, and falls back to a free port if the default is busy.
      • api2dart serve -s <source> -c <file> opens the web UI directly for a local file (and auto-opens the browser; --no-open to skip, -p/--port to choose a port). For live Apidog/Postman fetch, use the wizard.
      • Sidebar mirrors the terminal selector's nested folder tree (collapsed by default), with live search, per-method filters, and folder/master checkboxes — selection state and scroll are preserved while you pick.
      • Request builder — editable method/URL + Params/Headers/Body/Auth tabs and a Send button that fires the real request and shows status, time, response headers, and syntax-highlighted JSON (Body/Headers tabs, expandable panel). The session token is applied automatically (Bearer) for authenticated endpoints; per-endpoint edits are preserved when switching.
      • Code preview of the generated Dart per endpoint, updated live as you edit output settings.
      • Output tab — control, per endpoint, the output directory (with a 📁 folder picker that browses your project, plus "apply to all"), file name, Action/Response class names, and mode. Settings persist to .api2dart/config.yaml and prefill on the next run.
      • Generate selected writes the exact same *_action.dart / *_response.dart files and Markdown logs as the terminal generate.
      • Responsive layout (mobile drawer), keyboard shortcuts (/ focuses search, Ctrl/Cmd+Enter sends), and an "already generated" marker. Loopback-only; works in non-TTY environments.
    • Guided browser token capture — when no saved token exists, the Postman/Apidog sign-in opens a small local page that links to the provider's token page; paste the token there and it returns straight to the CLI (no terminal paste). Falls back to a terminal prompt when headless or unavailable.

    Fixed

    • Apidog endpoints whose paths use a URL-variable prefix (e.g. /system_user_url/login) are now resolved consistently across the terminal and web flows: the prefix is stripped, the correct per-endpoint base URL is applied, and the name is rebuilt from the clean path. The logic lives in a shared UrlVariableResolver used by both.
    • Saved settings no longer corrupt .api2dart/config.yaml. Stored values are now properly YAML-escaped, so values containing quotes round-trip safely instead of breaking the file (which previously wiped saved tokens on the next read). A config that fails to parse is preserved as a .bak rather than silently overwritten.
    • A custom output file name can no longer escape the chosen output directory (path separators and .. are stripped to a single safe segment).
    Open source →
  2. 0.5.0 09 Jun 2026

    Nothing published for this version

  3. 0.4.0 09 Jun 2026
    Release notes

    Added

    • New api2dart resend <log-file.md> command. Every generated request log now ends with a ## Resend section and a hidden machine-readable request block. Running resend on a log file replays the exact request (method, URL, headers, query, body) and overwrites the same file in place with the fresh status, response and timing. The file stays replayable indefinitely. The human-facing ## cURL snippet is preserved for manual copy/paste.
      • On a failed request (no response), the file is left unchanged.
      • Older log files without the metadata block report a clear error pointing the user to re-run generate.
    Open source →
  4. 0.3.2 03 Jun 2026
    Release notes

    Co-Authored-By: Claude Opus 4.8 (1M context) [email protected]

    Open source →
    Release notes

    Fixed

    • Endpoints sharing a path but differing in HTTP method (e.g. GET /users and POST /users) no longer overwrite each other. Generated action and file names are now prefixed with the method (GetUsersAction / get_users_action.dart, PostUsersAction / post_users_action.dart). The prefix is skipped when the name already starts with the method to avoid duplication like GetGetUsers.
    • Fixed structural equality in the json_to_dart model deduplication. TypeDefinition / ClassDefinition declared a method named operator instead of overriding operator ==, so == fell back to identity and identical nested objects were never merged — emitting duplicate suffixed classes (Data2, Links2) plus orphan, never-referenced classes. Structurally identical objects now collapse to one class while distinct same-named objects still get distinct names.
    Open source →
  5. 0.3.1 21 May 2026
    Release notes

    Document the bare-invocation wizard launch in the changelog.

    Co-Authored-By: Claude Opus 4.7 (1M context) [email protected]

    Open source →
    Release notes

    Changed

    • Running api2dart with no arguments now launches the interactive wizard directly instead of printing the usage screen. All other commands and flags (--help, version, upgrade, etc.) behave exactly as before.
    Open source →
  6. 0.3.0 21 May 2026
    Release notes

    New

    • version subcommand — prints the installed version.
    • upgrade subcommand — pulls the latest release from pub.dev.
    • Automatic update notice after any command when a newer version is available on pub.dev.

    Changed

    • Request logs are now Markdown (.md) instead of plain .log, with formatted sections for URL, headers, request body, status code, and response body.
    • Generated files are written under a dated subfolder (<output>/<YYYY-MM-DD>/actions/ and .../logs/) so repeated runs don't overwrite previous outputs. The default --output is now api2dart (was lib/actions).
    Open source →
  7. 0.2.0 27 Apr 2026
    Release notes

    Renamed package from api_request_generator to api_to_dart. The executable is now api2dart and the per-project config directory is .api2dart/ (the previous .apigen/ is no longer read or written).

    New

    • reset subcommand for clearing saved settings. Defaults to wiping wizard selections only; pass --all to also remove saved Postman/Apidog tokens, or -y to skip the confirmation prompt.
    • Postman environments — after picking a workspace the wizard now fetches its environments, lets you pick one (or skip), and merges the variables on top of any collection-level variables before resolving base_url / token.
    • Response-only output mode for projects that don't depend on api_request. Auto-detected from the host pubspec.yaml; override with -m, --mode={auto,action,response-only}. In response-only mode files are written as *_response.dart (no api_request import) and endpoints with no response data are skipped.

    Fixed

    • Postman collections list parsing: the API returns the array under the collections key (plural). The previous code read collection (singular) and always saw an empty list.
    • Stop auto-clearing saved API tokens after a failed request. Network glitches or rate limits used to wipe a valid key; now the user is pointed at api2dart reset --all instead.

    Changed

    • The --reset flag on generate was replaced by the standalone reset subcommand.
    • Wizard banner, help text, and saved-settings paths updated for the new name.
    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive