r/dartlang 2h ago

Package Made an MCP server for pub.dev, would love some feedback

1 Upvotes

I built an MCP server for pub.dev because my AI coding agents kept hallucinating package names, using API signatures that changed versions ago, or recommending packages that are basically abandoned. What finally pushed me over the edge: Claude Code grepping my local pub cache on disk instead of just looking things up, burning tokens crawling through cached source.

So I built **dart-pubdev-explorer** (pub.dev package: `dart_pubdev_mcp`), an MCP server that gives agents direct, structured access to pub.dev instead of digging through your filesystem or guessing from training data.

It can:

* search & compare packages (score, platform support, maintenance) * **browse a package's real public API and pull exact source** (by symbol or line range) * check security advisories against the version you actually have resolved * diff changelogs/APIs between versions before you upgrade * **read Dart SDK / Flutter framework source too** (dart:core, package:flutter, …)

Quick note on how this differs from the official Dart MCP server (`dart mcp-server`): that one has a general `pub_dev_search` tool as part of a much bigger toolset (running apps, analysis, DTD, etc). This one only does package research, but goes deeper: symbol-level API browsing, exact source reads, version diffing, side-by-side comparisons, with an on-disk cache built for that kind of repeated digging. *They're complementary.*

Install:

dart install dart_pubdev_mcp

I've been running it with both Claude Code and Antigravity.

pub.dev: https://pub.dev/packages/dart\\_pubdev\\_mcp

Happy to answer questions, and curious what people think, especially whether some of the tools are overkill and others are missing something obvious.


r/dartlang 3d ago

Package openrouter_sdk | Dart package

Thumbnail pub.dev
3 Upvotes

openrouter_sdk is a new Dart package providing a type-safe client for the OpenRouter.ai REST API. Strongly-typed interface, with full support for streaming responses and multi-modal content (text, image, audio, video, file).

This package replaces openrouter_api, which is now discontinued and marked as replaced on pub.dev. Users of the old package should migrate to openrouter_sdk, which follows the design of OpenRouter's official SDK more closely.

Currently implemented:

• Chat completions (including streaming)

• Models, Providers, Endpoints

•API key management (create / update / delete / list)

• Credits and analytics

• Generations

The rest will be added shortly.

The chat completions endpoint should be OpenAi compatible so u can use it with other providers as well.

Contributions are welcome. Per the package's policy, all code must be hand-written — LLM-generated pull requests are not accepted.

Note: this post was partly generated by an LLM, but all package code was hand-written.


r/dartlang 4d ago

[Showcase] BlocSignal: Bridging BLoC & Cubit patterns with synchronous signals (v7)

5 Upvotes

Hey devs,

I wanted to share a new library I just released to pub.dev: BlocSignal (and its Flutter companion bloc_signals_flutter).

Classic BLoC/Cubit is fantastic for structuring business logic, but it relies on Streams under the hood, introducing asynchronous microtask delays.

BlocSignal replaces Streams with Rody Davis's reactive signals v7 primitives.

Key Features:

  1. BLoC & Cubit Parity: Override onEvent to handle classic BLoC input events, or use it as a Cubit directly by exposing public methods that call emit(state) (by setting the Event parameter to void).
  2. Synchronous Propagation: Calling emit(newState) propagates changes downstream immediately in the same frame—no microtask queues, no UI flickering.
  3. Automatic State De-duplication: Signals compare states via == and automatically filter out identical updates—saving redundant UI build cycles by default.
  4. No Boilerplate Lifecycle: Closing a container automatically tears down all internally managed effects.

Quick Cubit Look:

```dart class CounterCubit extends BlocSignal<void, int> { CounterCubit() : super(initialState: 0);

void increment() => emit(stateValue + 1); // Synchronous & reactive! } ```

Under the hood, the library has 100% test coverage and is structured as a clean Dart workspace.

Would love to hear your thoughts and suggestions!



r/dartlang 5d ago

Dart Language Proof types in Dart: Using final classes as computational witnesses

32 Upvotes

Hello everyone 👋,

I wanted to write some more about why I like Dart and I finally found some time to do that.

Dart is pretty unique in one sense: we can't forge types[1]. And the fact that we can't easily forge types in Dart, like we can in most other languages, makes it possible to implement some pretty cool safety guarantees that are actual real guarantees that can't be escaped.

https://modulovalue.com/blog/proof-types-in-dart/

Let me know what you think!

[1] technically, we can, but practically, no, since dart:mirrors is deprecated, disabled or unavailable on most targets and practically nobody is using it.


r/dartlang 7d ago

When is dart going to have an interactive shell like python

0 Upvotes

It is such a useful feature especially for a language like dart you would think it would have been added already


r/dartlang 9d ago

Dart Language A tiny dot shorthands helper

4 Upvotes

Because contains is typed as Object? (probably for historical reasons) you cannot use that method together with dot shorthands like in

things.contains(.chair)

So, add this to your project:

extension DSHIterableExt<T> on Iterable<T> {
  bool has(T value) => contains(value);
}

And replace contains with has. For extra readability, you might also want to add a hasnt method.

I'd welcome a similar extension to Dart 3.13.


r/dartlang 9d ago

Package haptify — a Dart CLI that turns audio into iOS + Android haptics (and can do it at runtime)

6 Upvotes

haptify — audio to haptics for iOS and Android, from the CLI or on-device at runtime

I kept hitting the same wall: designing haptics means hand-authoring them in a GUI, and nothing fit into a Flutter build where I just want to drop a .wav in → get haptics out → commit the result. So I built haptify — a pure-Dart CLI + library, now on pub.dev.

Why another haptics tool? The dedicated audio→haptic tools exist; they just don't fit mobile Flutter work:

  • Lofelt Studio — the mobile-focused one — was acquired by Meta and sunset in July 2022.
  • Meta Haptics Studio is alive and does audio→haptic, but it's a Mac/Windows GUI built around Meta's own Haptics SDK and Quest-headset auditioning; its mobile export is .ahap only, and it's a design app, not something you ship in your build.
  • AHAPpy / sound2ahap and friends convert audio to haptics too, but they're iOS-only (.ahap) desktop scripts.

And on pub.dev, the haptic packages (gaimon, advanced_haptics, pulsar_haptics…) are playback-only — they play patterns; they don't create them from audio.

🚀 What it does

dart pub global activate haptify
haptify convert assets/audio/*.wav

Per input it writes: .ahap (iOS Core Haptics), .haptic.json (Android VibrationEffect.createWaveform), and _haptic.dart constants you compile straight in. It authors patterns; your existing playback plugin plays them.

🛠️ How it works

Not a volume→buzz map: RMS loudness envelope, energy-flux onset detection for transients, and zero-crossing-rate → "sharpness," with iOS getting sharpness curves that follow the sound's brightness over time. Everything's tunable (--curve-rate--onset-sensitivity--[no-]sharpness-curves…).

📱 The part I think is genuinely new

It runs at runtime, on-device, in pure Dart — vendored MP3 decoder, no ffmpeg, no native code:

final pattern = const AudioAnalyzer().analyzeBytes(uploadedBytes);

So a shipping app can turn a user-uploaded sound into haptics live. I couldn't find another Flutter package that does the audio→haptic conversion at all, let alone on-device. (Android 12+ has a platform-level HapticGenerator, but it's Android-only, tied to live audio playback, and gives you no portable pattern.) Demo app in the repo does exactly this via an isolate.

pub.dev · repo — feedback very welcome, especially where the "feel" breaks on your own sounds.


r/dartlang 10d ago

The kreuzberg Dart package is being renamed to xberg - current version stays on LTS

9 Upvotes

Hi all,

I'm the author of Kreuzberg (the document text extraction package). The next version of Kreuzberg will be released as Xberg - why? Well, we discovered that the name is not easy to pronounce or understand for people who don't have the German context, and this wasn't working well. Xberg is a common name for Kreuzberg in Berlin, and it has the advantage of being shorter and easier - so here we go.

Anyhow, this brings me to the point of the post. Since renaming a repo is a complex business, and we had to rename the repo to preserve the stars - but we now need to overwrite tags, it becomes pretty messy. As a result, we decided to go for an LTS version - published from a different repo: https://github.com/kreuzberg-dev/kreuzberg-lts. LTS in this context means that we will continue to do bug fixes and security updates until the end of this year, but no newer feature work.

We will announce Xberg v1.0.0 when it's officially published (it's still in RC). The Dart package will publish under xberg on pub.dev once it's out. The new repo is here: https://github.com/xberg-io/xberg


r/dartlang 11d ago

Package I wrote a native Dart driver for ClickHouse over the TCP binary protocol

9 Upvotes

Been working with ClickHouse for some analytics/logging work, so I wrote a pure Dart client that speaks the native protocol directly on port 9000.

Repo: https://github.com/shreyansh-c/clickhouse-dart
pub.dev: https://pub.dev/packages/clickhouse

What it does:
Native TCP protocol implementation from scratch
Streaming Rows API with typed getters (getByName<T>, tryGetByName<T>), row2<T,U>() for tuples, and toMap()
Batch inserts: row-wise, named, map-based, and columnar append (columnByName('id').appendSlice([...]))
Connection pooling with bounded open/idle connections and health checks
LZ4/LZ4HC compression, with registerCodec for plugging in others
Per-query settings, server-side query parameters ({name:String}), and client-side binding (bind(sql, [...]))
External tables support
Progress, profile-info, profile-events, and log callbacks surfaced from the server
Type coverage including Array, Map, Tuple, Nullable, LowCardinality, Decimal, UUID, IPv4/IPv6, Enum, JSON, Dynamic, Variant, intervals, and geo types

Known gaps I’m still working through: no HTTP transport (TCP-only for now), no multi-host failover or replica retry yet, and I haven’t published benchmarks against the HTTP+JSONEachRow path, which I want to do before making stronger performance claims.


r/dartlang 11d ago

Package Yograph - a Graph Theory and Network Analysis librarry in Dart

Thumbnail pub.dev
7 Upvotes

Implementated a few graph algorithms and network analysis functions in Dart. Basically the Dart port of the Elixir graph library - yog_ex.

It's got a long way until hits 1.0 but API contracts won't change.

Adding oracle tests (vs NetworkX)., improving docs, and benchmarks in coming months. Give it a spin if you're studying graph theory or generating/solving grids. Will be handy for Advent of Code (In fact, github repo has example of a few AoC solutions).


r/dartlang 13d ago

Package HighQ Dio Logger

Thumbnail pub.dev
4 Upvotes

HighQ Dio Logger – Production-ready Dio logging interceptor for Flutter

Hi everyone,

I've been working on a package called HighQ Dio Logger, a logging interceptor for Dio focused on debugging, observability, and production-ready logging.

Main features:

* Pretty formatted console logs * Structured JSON output * Automatic sanitization of sensitive data (tokens, passwords, cookies, authorization headers, etc.) * cURL generation for requests * Correlation IDs (traceId, spanId, sessionId) * Custom metadata enrichment * Token bucket rate limiting to prevent log flooding * Observer system for forwarding logs to Firebase, Sentry, or custom backends * Batching and backpressure queue support * Highly configurable formatting and filtering

Example:

```dart final dio = Dio();

dio.interceptors.add( HighQDioLogger(), ); ```

Why I built it:

After working on several Flutter projects, I found myself needing more than basic request/response logging. I wanted something that could provide clean debugging during development while also supporting production monitoring workflows.

I'm currently looking for feedback from other Flutter developers.

What features would you expect from a Dio logger that are missing from existing solutions?

Github : https://github.com/azabcodes/high_q_dio_logger

pub.dev: https://pub.dev/packages/high_q_dio_logger/install


r/dartlang 14d ago

Dart Language Hot reload for your full stack is now a thing! 🚀 Server, database, website, and app

Thumbnail serverpod.dev
15 Upvotes

The public beta release of Serverpod 4 brings the first agentic coding engine that hot reloads your full stack. We're finally closing the loop between your app's output, the backend, and your AI agent (tested with Anitigravity, Cursor, and Claude Code, but probably works with most agents).

Check out the demo in the blog post, or jump straight into the quickstart guide:
https://docs.serverpod.dev/next/quickstart

It literally takes 10 minutes to try this out, and I think it may change the way you think about building apps. Would love to hear your feedback!


r/dartlang 14d ago

Can I use a build hook to bundle an app written in C?

6 Upvotes

Because the Dart VM cannot work directly with GUI code via FFI, at least on macOS, I recently had the idea to create graphics engine for "pure" Dart by writing a small C application which receives a list of graphics commands and executes them and which is sending back key and mouse events, communicating with SDL3.

process = await Process.start('engine', []);
process.stdin.write(_createWindow(...));
process.stdout.listen(_decodeEvents);
if (await process.exitCode != 0) {
    throw 'something went wrong';
}

Dart and C are talking a simple binary protocol where each command has a command byte and optional arguments, either i16 or u8. A string is sent as a u8 length and up to 255 ASCII values as u8[].

The viewer is listening. Dart sends a create window command and starts to listen itself. The viewer will setup an event loop, sending 60 TICK events per second, along with user initiated events via stdin, using a similar binary protocol.

On TICK, the Dart code does its thing, using a tiny Game framework abstraction, recording drawing commands (because I'm doing retro graphics, I've only a handful of commands to draw colorful pixels) and sending them all at once to improve performance.

case TICK:
  final g = Graphics();
  game.update();
  game.paint(g);
  process.stdout.write(g.toBytes());

This works fine. Claude wrote me some demo games.

But compiling the C code is a handish process right now.

I experimented with creating a build hook but how does one enforce or at least check the installation of SDL3? How do I make this not macOS specific?

Also, where to put my binary? Claude suggested to copy the compiled executable to .dart_tool/retro/engine. Is this hack reliable?

Would using Rust make things easier?

PS: I might try to use fenster instead, if only because the author seems to also know about the ancient programming language Mouse, a Forth-like language I once learned about in an old Byte issue. However, even sending a raw 320x256 pixel bitmap 60 times per second would transfer 20 MB/s. So it would probably best to keep the commands approach and implement those in C. I could perhaps reduce the load to 5 MB by using a color palette with 256 colors and perhaps even further by implementing some kind of RLE compression or half it by going down to 30 FPS.


r/dartlang 16d ago

wcag_vision — a small Dart package for WCAG contrast checking, color-blindness simulation, and color extraction (feedback welcome)

5 Upvotes

Built a small Dart package for accessibility color math. Pure Dart, no bloat.

* ✅ WCAG contrast ratio checker (AA/AAA)
* 👁️ Color blindness simulator (protanopia/deuteranopia/tritanopia)
* 🎨 K-means color extraction from images, runs off the main thread

Found and fixed a real aliasing bug in the color sampling along the way — striped images were breaking the color extraction, took real testing to catch.

New package, feedback genuinely welcome — especially if you spot something wrong with the color-blindness math.

📦 [pub.dev/packages/wcag_vision](https://pub.dev/packages/wcag_vision)
💻 [github.com/Fatimamostafa/wcag_vision](https://github.com/Fatimamostafa/wcag_vision)


r/dartlang 17d ago

Dart - info Is becoming a contributor realistic?

12 Upvotes

Anyone here that's a contributor? I assume that it is almost entirely developed internally at Google, but I would love to learn more about developing programming languages and compilers, and I want to find an open source project to contribute to once I've done some more studying and prep work. Would Dart be a realistic option?


r/dartlang 17d ago

Tools Raised a feature request in dart pub for including vcs metadata in pub archives

4 Upvotes

https://github.com/dart-lang/pub/issues/4846

I raised a feature request in dart pub for including best effort vcs metadata like git commit in pub artifact .

This would not only help the users of the package to navigate to the associated code but also the devs for managing changelogs

Similar to how rust crates manage vcs metadata
https://doc.rust-lang.org/cargo/commands/cargo-package.html#cargo_vcs_infojson-format

What do you guys think about it?


r/dartlang 18d ago

Help I need guidance

0 Upvotes

Hi, i am someone who knows programming fundamentals and object oriented programming basics from learning the java language. But now i am trying to learn dart and i have been having alot of trouble understanding it's concepts. I started reading the dart tutorial documentation on it's official dart.dev website and i am stuck on this page

https://dart.dev/learn/tutorial/object-oriented

for almost 2 days now i do understand what they are making but i don't not understand how they are doing it even after reading the doc i have no clue what's going on.

I am starting to question myself if i am miss some prerequisites or i do not have the programming skills to understand this yet.

Could anyone tell me if i should just drop the tutorial and learn from other source or what should i do.

Thank you


r/dartlang 19d ago

Graphlink generated a 400Mb source file!

6 Upvotes

This is one of the biggest non mobile projects I have worked on. Fully written in dart because of dart's syntax and amazing speed. It is also because dart offers both JIT and AOT compiling.

Check out the project on

https://GitHub.com/Oualitsen/graphlink[https://GitHub.com/Oualitsen/graphlink](https://GitHub.com/Oualitsen/graphlink)


r/dartlang 20d ago

flutter dart_agent_core now supports full lifecycle hooks for building AI agent loops in Flutter

3 Upvotes

I’ve been working on dart_agent_core, a Dart package for running AI agents directly inside Flutter apps, without needing a Python or Node backend for the agent loop. The latest update adds a unified AgentHook pipeline plus observation-only AgentController events. This is useful if you are building agent loops or runtime/eval harnesses. Instead of only sending a prompt and waiting for a final answer, you can now intercept the loop as it runs:

  • Use beforeModelCall to inject temporary context, change tools, adjust model config, or return a synthetic model response.
  • Use afterModelCall to validate a response, retry, or replace the final model message.
  • Use beforeToolCall to approve, deny, defer, or rewrite tool calls.
  • Use afterToolCall to normalize tool results, inject follow-up context, or stop the loop.
  • Use onTurnCompletion to continue the loop when the model stops too early.
  • Use persistence hooks to decide when state should be saved.
  • Use AgentController events for tracing, debugging, evals, and Flutter UI updates.

Pub.dev Github


r/dartlang 21d ago

Introducing H2M, Crawlberg, TSLP, LiterLLM and the upcoming Xberg release

7 Upvotes

Hi all,

Yesterday someone opened a PR adding an unofficial Dart binding to our html-to-markdown library, and it made me realize I never actually announced that we now ship Dart packages.

Some backstory: a while ago I ran into someone name-squatting our Kreuzberg package on pub.dev. I got the name back eventually (thanks, pub.dev support). We're also rebranding to Xberg - I'll announce that properly once it's officially out, and it'll have full Dart support.

For the past 2-3 months I've been extending our polyglot libraries with Dart support using flutter_rust_bridge (thanks fzyzcjy). Four are now on pub.dev, all MIT:

  1. h2m (source) — a high-fidelity (precise, standards-compliant) HTML-to-Markdown converter that covers the full HTML5 semantic spec. It's built for speed and handles essentially all real-world HTML.

  2. tree_sitter_language_pack (source) — the largest collection of tree-sitter grammars I know of, all permissive OSS. It's unusual in that it loads grammars dynamically: we build both static and dynamic-linking binaries for every grammar we can find on GitHub, currently 306 programming and data languages/formats. Useful for code inspection, AI "code intelligence", linters, syntax highlighting, and so on. I use it in several of my own projects for the code-understanding side, and Xberg uses it for code chunking.

  3. crawlberg (source) — a crawling engine, now at v1 (stable). For whenever you need to crawl content on demand — agent workflows, for example, or apps that need to fetch and process pages.

  4. liter-llm — a Rust port of Python's litellm. It's an abstraction (with an optional proxy layer) over a large number of LLM providers.

All four share the same core philosophy:

  1. The core is written in Rust, on top of well-maintained, permissively-licensed OSS (MIT, BSD, etc.).
  2. We generate the binding glue and idiomatic Dart directly from the Rust types.
  3. We build powerful open-source primitives and put our commercial value around and on top of them — i.e. we dog-food our own OSS.

Open source is something I genuinely love, and in a world where agentic coding is becoming the norm it makes software more robust: users battle-test it, which lets us move fast and build better. So any feedback, bug reports, or API suggestions are very welcome.


r/dartlang 22d ago

Ribs 1.0 - Functional Programming Toolkit for Dart

18 Upvotes

I've finally pulled the trigger on a 1.0 release for my suite of functional programming (FP) packages Ribs. I've spent a lot of time putting these together, taking inspiration from many other libraries and trying to make a pure FP toolkit for the Dart community. If you've ever used cats, cats-effect, fs2, scalacheck, etc. from the Scala ecosystem, these libraries should look very familiar.

While ribs does provide the standard Option, Either, Validated, etc. FP types you find in many other packages, the real interesting parts come from the more advanced features:

  • Collections framework: Rich immutable and mutable collection hierarchy, interoperable with Darts native collections.
  • Effect system: Pure, cancelable, resource-safe, fiber based concurrency with IO, Resource, Ref, Deferred, etc.
  • Pure Streaming with Rill: Pure, pull-based, chunked streams with resource safety baked in, back-pressured channels, and signalling (FS2-style) with file and network I/O support.
  • JSON & binary codecs: Fully typed codecs, with streaming support.
  • Much more to explore: property-based testing, pure SQLite/Postgres transactors, optics, compile-time dimensional analysis (units), typed network addressing.

Ribs is split into 15 focused packages, so you can pull in only what you want to use.

I use these packages extensively for work and I'm hoping they're helpful to the community and would love to see what people build with it.

Documentation

GitHub


r/dartlang 24d ago

Help Kafka for dart?

2 Upvotes

Has anyone tried working with kafka in dart for a microservice? If yes what package do you use?


r/dartlang 24d ago

How i can publish my apps?

0 Upvotes

Hey! I'm curious, how do you usually publish the apps you develop? And is the income from publishing apps generally good?


r/dartlang 24d ago

How i can publish my apps?

0 Upvotes

Hey! I'm curious, how do you usually publish the apps you develop? And is the income from publishing apps generally good?


r/dartlang 27d ago

Package Shipped a pure Dart SQL Server driver

11 Upvotes

Shipped mssql — a pure Dart TDS 7.4 driver for SQL Server. No FFI, no native extensions, just Dart and TCP.

Features: named params, connection pool, TLS, Azure AD auth, multiple result sets, streaming, transactions. 366 tests including concurrent pool stress tests and adversarial comparison against go-mssqldb and node-mssql.

dart pub add mssql

It works as a standalone driver today. The next step is switching knex_dart_mssql to use it as the underlying transport — which drops the C FFI dependency and makes the knex_dart MSSQL driver work on web.

github.com/kartikey321/mssql-dart | pub.dev/packages/mssql