Skip to content
CAI
Software that uses CAICheck a score

trevorwang/retrofit.dart

65.1

Adequate · 17 November 2026

5.6k

lines of production code

Dart

with C++

5

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Features

Add Protobuf example demonstrating message serialization

This location introduces a new example that demonstrates how to use Protobuf for request and response bodies. It includes the \params.proto\ and \result.proto\ schema definitions, the generated Dart code (\params.pb.dart\, \result.pb.dart\, etc.), and an \example.dart\ file showing a \RestClient\ interface configured to send \Params\ messages and receive \Result\ messages via POST requests.

_example\protobuf · high confidence

Add example demonstrating dart\_mappable parser integration

This change introduces a new example project that demonstrates how to integrate the \dart\_mappable\ library with Retrofit for automatic type conversion. It includes a \Task\ model using \@MappableClass\, an \ApiService\ configured with \parser: Parser.DartMappable\, and a \build.yaml\ file setting the global parser option. The example also provides a runnable main script and tests to verify that API responses are correctly deserialized into \Task\ objects using the \dart\_mappable\ mapper.

_example\dartmappable · high confidence

Add example demonstrating relative base URL configuration

This change introduces a new example project (\example\_relative\_base\_url\) that demonstrates how to configure the \@RestApi\ annotation with a relative base path (e.g., \baseUrl: 'tasks'\). The example includes the necessary Dart source files, build configuration, and tests to show how the generated client resolves endpoints relative to the provided base path.

_example\_relative\_base\url · high confidence

Added Flutter example project scaffolding

Introduced a new Flutter example application (\flutter\_example\) that demonstrates the \retrofit\ library's integration with \dio\. The project includes platform-specific configurations for Android (using Kotlin and Gradle 8.3) and iOS (Xcode project with Swift), along with a \lib/example.dart\ file defining a \RestClient\ interface. This example utilizes the \Parser.FlutterCompute\ setting for model parsing and includes a \MockAdapter\ to simulate API responses for testing.

_flutter\example · high confidence

Added local code coverage script for the retrofit package

A new shell script (retrofit/tool/coverage.sh) has been added to the project, allowing developers to locally generate code coverage reports for the retrofit package. The script automates the process of activating the coverage package, running tests with coverage collection enabled, and formatting the results into an lcov.info file.

retrofit/tool · high confidence

Example app now supports Dart JSON Mapper alongside standard JSON serialization

The example application in example\_dartmapper now demonstrates the use of the Dart JSON Mapper library for parsing API responses. A new json\_mapper\_example.dart file introduces an ApiService configured with Parser.DartJsonMapper, requiring the initialization of reflectable code via initializeReflectable(). This adds a second, reflection-based serialization path to the example alongside the existing example.dart which uses standard json\_annotation, allowing users to see how to integrate and initialize the Dart JSON Mapper package with the generated REST client.

_example\dartmapper/lib · high confidence

New library exports for CallAdapter, Dio extras, and HTTP annotations

The \retrofit/lib\ package now exposes a new public API surface via \retrofit.dart\, importing and exporting \call\_adapter.dart\, \dio.dart\, \error\_logger.dart\, and \http.dart\. This introduces the \CallAdapter\ interface and \@UseCallAdapter\ annotation, allowing users to wrap API responses (e.g., into a \Result\ type) for custom error handling or logging. It also adds \@Extras\, \@TypedExtras\, and \Extra\ annotations for passing custom data to Dio interceptors, along with \@DioOptions\, \@CancelRequest\, \@ReceiveProgress\, and \@SendProgress\ for finer control over request execution. The \ParseErrorLogger\ abstract class is provided for logging parsing errors, and \HttpMethod\ now includes a \QUERY\ constant. The \@RestApi\ annotation has been updated to accept a \callAdapter\ parameter and global \headers\.

retrofit/lib · high confidence

Removals

Removal of example application entry point

The example application's main entry point (example/bin/main.dart) has been removed, eliminating the ability to run the standalone example client directly from this location.

example/bin · high confidence

Removal of legacy HTTP annotation definitions

The \annotation/lib/http.dart\ file has been deleted, removing the legacy set of HTTP annotations including \RestApi\, \Method\, \GET\, \POST\, \PATCH\, \PUT\, \DELETE\, \Headers\, \Header\, \Body\, \Field\, \Path\, \Query\, and \QueryMap\. Users relying on these specific annotation classes for defining API endpoints will need to migrate to the current annotation structure provided in the library.

annotation/lib · high confidence

Behavioural changes

27 commits (6 fixes) modifying retrofit

A change to existing behaviour in retrofit — 27 commits (6 fixs), 7 files: “feat: added \@BodyExtra\ into retrofit annotaion (\#767)”; “Remove package\_api\_docs rule from analysis options”; “docs: add Google Analytics tracking to dart doc output (\#942)”; and 24 more (refs \#767, \#942, \#509, \#865, \#729, …).

retrofit · medium confidence · unverified

Added CI, coverage, and contributor generation tooling scripts

The repository now includes shell scripts to automate continuous integration and code quality workflows. A new Travis CI script (tool/travis.sh) manages multi-package builds by running dart analyze and other tasks across specified packages. A coverage script (tool/coverage.sh) automates the collection and formatting of Dart test coverage reports into lcov format. Additionally, a Python script (tool/gen\_contributors.py) was added to automatically update the project's contributor list using the all-contributors tool.

tool · high confidence

Enforced commit message linting via Husky

The project now enforces commit message standards by adding a Husky commit-msg hook that runs commitlint on every commit. This ensures that all commit messages adhere to the configured conventional commit format before they are accepted, improving consistency in the version history and changelog generation.

.husky · high confidence

Example app updated to modern Retrofit and Dio patterns

The example application has been refactored to demonstrate current best practices. The legacy \demo.dart\ and its generated code have been removed and replaced with a new \example.dart\ that uses the \@RestApi\ annotation with explicit \Dio\ injection and supports \ParseErrorLogger\. The new example showcases advanced features including nullable generic types (e.g., \ApiResult\<Task?\>\), extension types for query parameters, \Uint8List\ and \Stream\ return types, and runtime content-type handling via \@PartMap\. Additionally, a new \auth\_client.dart\ demonstrates authentication flows, and \api\_result.dart\ provides a generic wrapper for API responses.

example/lib · high confidence

Retrofit generator refactored to use new RetrofitOptions and build\_runner API

The code generator's entry point and configuration handling have been restructured. The old \builder.dart\ file was removed and replaced by \retrofit\_generator.dart\, which exposes a \retrofitBuilder\ that delegates to a new \generatorFactoryBuilder\. This new factory instantiates a \RetrofitGenerator\ using a new \RetrofitOptions\ class, which centralizes configuration parsing (such as \autoCastResponse\, \emptyRequestBody\, \className\, \useResult\, \formatOutput\, and \parser\) from \BuilderOptions\. The generator class itself now extends \GeneratorForAnnotation\<retrofit.RestApi\>\ instead of the previous \http.RestApi\, and includes logic to handle annotation-level parser overrides and global headers. Additionally, the generated code now includes \// dart format off/on\ comments by default to preserve formatting, and suppresses specific analyzer warnings via \ignore\_for\_file\ directives.

generator/lib · high confidence

Test coverage

Added integration tests for the Dart mapper example; Added integration tests for the example REST client; Added tests for generator options and output formatting; Added unit tests for core Retrofit components.

Dependencies

Major dependency and SDK version upgrades across core packages and examples

The core \retrofit\ and \retrofit\_generator\ packages have been upgraded to require Dart SDK 3.8.0+ and 3.9.0+ respectively, with \retrofit\_generator\ now depending on \analyzer\ versions 8.4.1 through 14.x and \build\ 4.0.0. The \retrofit\ library itself now targets \dio\ ^5.9.0. Several example projects (\example\_dartmappable\, \example\_dartmapper\, \example\_protobuf\, \example\_relative\_base\_url\, \flutter\_example\) have been added or updated to use \dio\ ^5.7.0, \build\_runner\ ^2.4.0, and \json\_serializable\ ^6.8.0, while the legacy \example\ directory was updated to reflect these new dependency paths and SDK constraints. Additionally, the root \package.json\ was added to manage Node.js dev dependencies including \@commitlint/cli\ ^20.1.0 and \husky\ ^9.1.7.

(dependencies) · high confidence

Housekeeping

Initial project scaffolding and documentation setup

The repository has been initialized with essential project infrastructure, including a MIT license, a Code of Conduct, and a Jekyll theme configuration for the documentation site. The README has been updated to reflect the current state of the library, providing usage examples for the \retrofit\ and \retrofit\_generator\ packages (versions ^4.9.0 and ^10.0.1 respectively) and detailing configuration options such as the \parser\ and \format\_output\ settings. Additionally, CI/CD pipelines are configured via Travis CI and commit linting rules, and contributor data is managed through the \.all-contributorsrc\ file.

(repo-wide) · high confidence

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.

Score

  • CAI 62.9 → 65.1 (+2.2)
  • Rubric changed (rubric-2026.11.2 → rubric-2026.11.4) — scores are not directly comparable.

Lenses

  • Code Health 68.4 → 65.4 (-3.0)
  • Architecture 95.0 → 93.1 (-1.9)
  • Maturity 56.7 → 60.1 (+3.4)
  • Readiness 61.2 → 64.6 (+3.4)
  • Security 67.5 → 70.1 (+2.6)
  • Performance 100.0 → 100.0 (0.0)

Resolved (4)

  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • Workflow token permissions not restricted (.github/workflows/github-pages.yml)

New (7)

  • Documentation: no build, run or usage example (example_protobuf/README.md)
  • Documentation: no build, run or usage example (flutter_example/README.md)
  • Documentation: no build, run or usage example (generator/README.md)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)

Changes since last survey

  • 1 commits — 1 feature/other, 0 fixes

By area

  • (root) — 1 commit

Notable commits

  • change: Use GitHub Actions for Pages deployment (#943)

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

trevorwang/retrofit.dart was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 17 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 8f6c3a24018420a31adab6088b56833d919a233a — the exact code this score is about.
  • Scored under rubric-2026.11.4 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.85+preprod-eba6548ac50f.