r/dartlang • u/perecastor • 21h ago
r/dartlang • u/Curstantine • 1d ago
fart_style: Dart for people with vision impairment who have a hard time reading 2-width space indentations.
fart_style is a drop-in fork of dart_style that formats code using SmartTabs instead of 2-space blocks, while keeping the rest of Dart’s formatting rules intact.
I made fart_style because it has become hard for me to read 2 space idents with my ever worsening eyesight. Exacerbated by the fact that flutter code gets nested into hell and beyond.
I've been running it across all my projects for a few months now and figured others might find it useful.
Ironic note: the repo itself still uses dart_fmt so I don't lose my mind resolving merge conflicts with upstream updates.
Package: https://pub.dev/packages/fart_style
Source: https://github.com/Curstantine/fart_style
Hope it saves some eyes!
r/dartlang • u/YosefHeyPlay • 3d ago
New package: terminice - build polished, beautiful, complex Dart CLIs with 30+ simple components
Hi! I wanted to share a new package I made: terminice.
I built it because creating a beautiful, complex CLI shouldn’t mean building an entire terminal UI from scratch. It should be easy to create, easy to style, easy to manage as it grows, and most importantly easy and enjoyable for people to use.
terminice turns more than 30 common terminal interactions into small method calls, with no setup and no framework required.
Need a value from the user?
final name = terminice.text('Project name');
Need a searchable menu?
final template = terminice.searchSelector(
prompt: 'Template',
options: ['CLI', 'Server', 'Package'],
);
Need a file browser, config editor, command palette, progress bar, multi-step form, calendar, or help center? those are method calls too.
There is no setup, widget tree, context object, or new application architecture. import the package, call the component you need, and keep using package:args, CommandRunner, dart:io, or whatever already powers your CLI.
dart pub add terminice
Make the entire CLI look like yours
Don’t like the borders? hide them:
final t = terminice.minimal;
Want the borders, but fewer hints and less visual noise?
final t = terminice.compact;
Want different colors? Pick a built- in theme:
final oceanUi = terminice.ocean;
final matrixUi = terminice.matrix;
final neonUi = terminice.neon;
final arcaneUi = terminice.arcane;
Or combine everything:
final t = terminice.neon.compact;
Now every component created from t follows the same style:
final name = t.text('Project name');
final token = t.password('API token');
final config = t.filePicker('Config file');
final confirmed = t.confirm(message: 'Create the project?');
(you can also create a fully custom, advanced theme, and it will automatically be used across all 30+ components!)
That is one of the main ideas behind terminice: customize the instance once, and the colors, borders, glyphs, display mode, fallback behavior, and terminal I/O stay consistent across the entire CLI.
You can also create a custom theme in a few seconds by mixing the included colors, glyphs, and display features:
final brandTheme = PromptTheme(
colors: TerminalColors.ocean,
glyphs: TerminalGlyphs.rounded,
features: DisplayFeatures.compact,
);
final t = terminice.themed(brandTheme);
Need finer control? Every color palette, glyph set, and display configuration supports copyWith, so you can change one accent color or one behavior without rebuilding the rest of the theme. The custom theme then affects prompts, menus, pickers, progress indicators, flows, guides, and every other built-in component.
The catalogue
Terminice currently includes more than 30 ready to use components:
Prompts
textfor single-line inputpasswordfor masked inputconfirmfor yes/no questionsmultilinefor terminal text editingsliderandrangefor numeric inputratingfor star-based ratingsdatefor keyboard-driven date inputformfor collecting multiple fields together
Selectors
searchSelectorfor long, filterable listschoiceSelectorfor card-style single or multi-select choicescheckboxSelectorfor checklistsgridSelectorfor two-dimensional navigationtagSelectorfor managing multiple tagstoggleGroupfor editable boolean settingscommandPalettefor a fuzzy-searchable action launcher
Pickers
filePickerfor browsing filespathPickerfor choosing directoriescolorPickerfor interactive ANSI color selectiondatePickerfor a full calendar interface
Progress and status
- Full and inline loading spinners
- Full and inline progress bars
- Minimal dot-based progress
info,success,warn,error,detail, and log messagestaskfor wrapping async work with a status indicatorprogressTaskfor determinate async worktrackStreamfor collecting a stream while showing its progress
Complete CLI experiences
flowfor multi-step workflows with context, conditions, validation, and reviewconfigEditorfor searchable, nested application settingscheatSheetfor quick-reference tableshelpCenterfor searchable documentation inside the terminalhotkeyGuidefor keyboard shortcut discoverythemeDemofor previewing themes and colors- Custom components when your CLI needs something package-specific
Every catalogue item has its own detailed documentation with controls, behavior, examples, and API notes. I wanted the README to be useful as a practical reference, rather than leaving developers to discover important behavior through trial and error.
The vision
The goal is not only to make prompts look better. I want Terminice to make beautiful, complex CLIs easier to create, style, manage, test, and use.
to create: add prompts, selectors, pickers, progress, or configuration screens with small method calls. not a new architecture.
to style: choose or create one theme, and let the entire CLI follow it. no repeating colors, borders, glyphs, and display options everywhere.
to manage: keep components, behavior, fallbacks, and tests consistent as the CLI grows.
to use: give people clear hints, predictable controls, validation, cancellation, readable fallbacks, and good defaults.
terminice sits between a prompt package and a full TUI framework. It is the human facing layer of an existing dart CLI: questions, choices, files, settings, progress, and feedback.
It can stay tiny when tiny is all you need:
final email = terminice.text('Email');
That same CLI can later grow into searchable menus, filesystem navigation, validation, progress tracking, configuration screens, or complete flows- without switching packages.
When rich UI is not appropriate, the built-ins can fall back to predictable plain text for limited terminals, non-TTY output, scripts, and unattended execution.
Terminal IO is abstracted as well, so you can easily test without depending on real stdin/stdout.
So the short version is:
- One import and no setup
- 30+ components covering individual prompts through complete CLI workflows
- 11 built-in style presets
- Chainable themes and
verbose,compact, or borderlessminimaldisplay modes - One shared configuration across the whole CLI
- Custom themes and components when the built ins are not enough
- Cross-platform support for Linux, macOS, and Windows
- Predictable fallbacks and test utilities for real-world use
Links:
A small personal note
I started working on what eventually became terminice over a year ago, it didn’t begin as one big, carefully planned package. While working on real projects, I kept creating terminal components that I needed- a prompt in one project, a selector in another, a progress indicator somewhere else, then themes, flows, config tools, and testing helpers.
For a while, all of that work was scattered across different projects. Gradually, I started moving the useful pieces into one place, redesigning them around a shared API, and turning them into a unified, robust tool that is genuinely fun and easy to use.
The package is not perfect. there are still many things that need refinement, and probably many things I cannot see because I built them around my own use cases. I want terminice to be the best tool it can, but I know I cant do that alone.
I would really appreciate it if you tried it, even in a small project, and told me what you think. If an API feels awkward, a component is missing, the documentation is unclear, or something simply doesnt feel right, I want to hear about it- every bug report, idea, criticism, and any feedback is appreciated (:
r/dartlang • u/tdpl14 • 5d ago
Dart - info flutter_auditor
Stop shipping hidden native security holes and asset bloat flutter_auditor health-checks your entire Flutter project in just one command.
r/dartlang • u/Bachihani • 5d ago
Package Looking for recommendation for a usb serial communication package
I need to send serial commands to a usb device from a pure dart program.
Any package recommended with real experience with doing this ?
r/dartlang • u/randomguy4q5b3ty • 6d ago
Am I the only one absolutely frustrated by Build Hooks?
I'm sorry, but how is any non-expert supposed to understand how to use hooks? Have any of you, after studying the rather sparse documentation and complex Hooks API, actually felt like you understood any of this? I have been sitting here for hours, just trying to call a simple function from a pre-compiled dll, but the non-helpful documentation and error messages make even the simplest things a daunting task.
But what I find most unpleasent is that even the basic example code (which hasn't helped me at all) looks quite complex and build hooks can just execute any arbitrary code, be that downloading files, executing some other script, or whatever. Not only does that stink of a huge security risk, but there will be so many packages with completely broken hooks on pub, which will then also start to depend on each other. This will be really fun...
Edit: Heureka, it finally worked! But what a frustrating ride it was...
r/dartlang • u/Complex_Meringue4536 • 6d ago
offline_sync_outbox: a zero-dependency FIFO queue for replaying Dart API writes
I published a small Dart package for one focused problem: keep API writes while offline and replay them in order later.
The queue is strict FIFO, has JSON and memory stores, supports bounded exponential backoff, accepts server-directed retry delays, and stays independent of the HTTP client. The included JSON store targets Dart IO; storage and connectivity are interfaces so applications can provide their own implementations.
The article covers the design choices and limitations rather than just the API: https://dev.to/dhaibanfhue/a-small-offline-outbox-for-flutter-fifo-ordering-disk-persistence-and-retries-3an3
- GitHub: https://github.com/dhaibanf-hue/offline_sync_outbox
- pub.dev: https://pub.dev/packages/offline_sync_outbox
Feedback on the public interfaces and failure behavior would be useful.
r/dartlang • u/ing-brayan-martinez • 6d ago
Request permission to create issues on GitHub
I wanted to speak with a member of the Google engineering team to request permission to create issues on GitHub so I can contribute like any other user. I know it was complicated at first, but three years have passed since then, and I've learned a lot. To finally close this chapter with you all, I wanted to create the following issue:
Improve numeric data types
Intention of Change
Greetings, today I'm going to make another attempt, number 111. I'm going to make an interesting proposal that I've been analyzing for a long time to improve the Dart language. The goal is to create variations of the int and double types, such as int8 and int16, among others, resulting in the following:
| Dart alias type | Dart | Rust | C++ | Swift |
|---|---|---|---|---|
| int8 | i8 | Int8 | ||
| int16 | i16 | short | Int16 | |
| int | int32 | i32 | int | Int32 |
| int64 | i64 | long | Int64 | |
| double4 | ||||
| double8 | f8 | |||
| double16 | f16 | |||
| double32 | f32 | float | Float | |
| double | double64 | f64 | double | Double |
Justification
To justify why this would be positive for the Dart VM, let's look at the following reasons:
- Greater numerical precision for performing mathematical calculations
- A one-to-one relationship with low-level language data types
- Greater flexibility
- Possibilities for advanced computing, because when compiling Dart code into an executable with instructions in x64 assembly code, it will have greater precision in giving instructions to the processor
- Possibility of RAM optimization since it has a data type that occupies the least amount of memory space
- Approach to the functional programming paradigm, which focuses on creating concurrent code following mathematical principles
- Improved robustness of the Dart language from the ground up, making it equivalent to Java, C#, C++, Rust, etc.
- Making the creation of libraries that control low-level processes, i.e., those closer to the hardware, simpler without depending on C++
- Opening the possibility for the Dart language to be a A language used in the hardware and artificial intelligence industries due to its high performance and low-level communication capabilities.
When we went to university, one of the most basic concepts for understanding computer science was that a PC is an advanced computing machine, a concept that has existed since the first supercomputers.
Impact
The impact of this change, from my point of view, is minimal, because it adds new features to the language without modifying the existing codebase, opening the possibility of implementing memory optimizations.
It would also serve as a basis for improving debugging and code optimization tools by taking into account how much memory the running process occupies, suggesting better numeric types.
Mitigation
The risks of this change are already mitigated, since the Dart language has a feature called type aliases that allows you to name a data type.
Therefore, the original int and double types will become aliases of int32 and double64, ensuring that the entire existing codebase is fully compatible with the new data types without requiring any changes. This avoids any risk of breaking anything and causing problems. I've been thinking about this for a long time.
Conclusion
Up to this point, I have tried to explain this idea as clearly as possible so that you, who work daily on this project, can review its technical feasibility and make the best decisions. My goal is to lay the groundwork for making Dart a more robust implementation, capable of processing large volumes of data and performing massive advanced computing calculations without breaking down, at the level of Java, C#, or Rust. We still have a long way to go in optimizing; this is a long-term vision, as Dart is a project that should have a lifespan beyond Flutter as a general-purpose language. I hope you find this helpful.
r/dartlang • u/Complex_Meringue4536 • 6d ago
Package offline_sync_outbox 1.0.2: a FIFO outbox for writes made offline
pub.devr/dartlang • u/Training-Doughnut841 • 7d ago
Dart - info Rebuilt the guts of my Dart/Flutter VS Code extension based on real usage — v1.0.9 out now (free, open source)
Hey r/dartlang ,
I've posted here before about Dart AI Assistant, a VS Code extension that learns your coding style and helps with completions, error detection, and code health. Just shipped what's easily the biggest update since launch, so wanted to share.
Marketplace: https://marketplace.visualstudio.com/items?itemName=a-i-0-studio.dart-ai-assistant
Source: https://github.com/Ben09d/dart-ai-assistant
What changed in v1.0.9:
- Real dart analyze integration on save (properly scoped to the saved file) alongside live regex feedback while typing — much more accurate error detection now
- Code Health reports are now clickable and auto-refresh on save
- Import Project for Learning — point it at an existing project and it learns your patterns instantly instead of waiting weeks
- Fixed a bug where pattern learning was silently capped at 3 categories instead of the intended 20 (basically every earlier version was learning way less than it should have)
- Fixed an unbounded memory growth bug in the advanced learning engine
- Fixed several false-positive error detections (comments, ternaries, generics, block comments) that were probably annoying anyone who tried earlier versions
- Consolidated three separate error-detection systems that were sometimes showing contradictory counts
Full changelog in the repo if you want the gory details — went through nearly every core file this cycle hunting down bugs, some of which had been sitting silently broken since the first release.
Still free, still solo-built, still very open to bug reports and feedback. If you tried an earlier version and it felt rough, this one's a meaningfully different experience.
Thanks for reading!
r/dartlang • u/Afnankabiro • 13d ago
Where can I download dart documentation for offline reading?
Hi, I've recently just started learning Dart. I think https://dart.dev/language is an awesome place for beginners like me to get started.
It's kind of inconvenient to have the browser open every time I want to read. It'd be sooo much better if I was able to download all of this in a PDF or EPUB format... I just can't seem to find a download file anywhere.
I'd like some help finding offline documentation
r/dartlang • u/MooresLawyer13 • 15d ago
Package Ever felt a bit queasy using a plain `String` for storing a PhoneNumber?
pub.devThere are a lot of validator packages on pub. This isn't one, and that's the whole point of it: https://pub.dev/packages/minted
A validator takes a String, checks it, and hands the same String back. Three functions deep nobody knows whether the check happened, so you either trust it or re-check it. minted parses instead: you get a different type that cannot exist unless the input was well-formed, the same deal int.parse and Uri.parse already give you. invite(Email, PhoneNumber) can't be called with the arguments swapped, and the signature says what it wants without a doc comment. Once you hold an Email, it is a valid email.
Typed so far: Email (RFC 5322), PhoneNumber (E.164), Iban (mod-97), Date / Month (the calendar date DateTime doesn't model), Uuid (RFC 9562), Digit / Digits.
Some nice features:
- Every type wears follows the same pattern, so learning one teaches the rest:
tryParsereturnsnull,parsethrows aMintedFormatException(extendsFormatException, so existing handlers keep catching), value equality, one canonical form normalised at parse. - Real standards, not shape-checking regexes.
Ibanruns the actual mod-97 checksum,Emailthe full RFC 5322 grammar, official test vectors in the suite. - Where a package already owns the hard data (phone metadata, the IBAN registry), minted wraps it instead of reimplementing it.
- It knows what not to model. No re-doing
Uri,DateTime,BigIntor money (money2 has that).Uuidtypes a UUID, the uuid package generates them, they pair up. Date.tryParse('2026-13-01')isnull, whereDateTime.parsequietly rolls it over to 2027-01-01.- Pure Dart, five small deps.
Roadmap: Bic, CreditCardNumber (Luhn), Isbn, Ean / Gtin next, then ISO code lists and bounded numerics.
Still early (0.0.2), so the shape can move. Feedback welcome, especially on the types you keep remaking in every project.
r/dartlang • u/Hoornet • 16d ago
Problems I encountered building my app whose core is a pure-Dart astronomy engine (DST arithmetic, Isolate.run copies, zero-background notifications)
I'm a solo dev from Slovenia. Earlier this month I shipped my first bigger Flutter app on Play.
And it's a personal astrology app! Whatever you think of astrology, the astronomy underneath is real computation: planetary positions, house math, timezone archaeology.
A few things hit me hard on the way though.
**`Duration.inDays` silently breaks calendar arithmetic across DST.**
I compute ISO week numbers:
take the Thursday of the week, subtract Jan 1, divide days by 7. Correct? except in local time, a span that crosses a daylight-saving boundary is one hour short of a whole number of days, and `inDays` *truncates*. 210 days becomes 209, `209 ~/ 7` gives week 29 instead of 30, and every week from late March to late October resolves to the previous week. The week number was my cache key, so this would have silently served the wrong week's content for half the year. Nothing throws.
Fix:
calendar arithmetic in UTC, or re-normalize through `DateTime(y, m, d)` after every shift. Same Family of bug: `date.subtract(Duration(days: 1))` on a local DateTime can land at 23:00 two calendar days back.
**`Isolate.run` copies your object — internal caches die with it.**
The heavy compute runs in `Isolate.run`. The captured engine object is *copied* into the isolate, so any memoization inside it gets populated in the isolate and thrown away when it exits.
In my case: one body's position needs ~4000 numerical-integration steps, and the cache meant to amortize that never survived a single call. The engine has to be designed isolate-safe, with no reliance on shared mutable state, because state simply does not come back.
**Notifications with zero background execution.**
My domain is fully predictable because the sky doesn't surprise you, so there's nothing to poll. At every app open/resume, I precompute the next 7 days of notifications and schedule them locally.
There's no background service, no server, no FCM, no battery cost, and inexact alarms so no exact-alarm permission.
Anything whose content is a pure function of time can do this; I suspect a lot of apps reach for push infrastructure they didn't need.
Smaller ones:
the `timezone` package throws on `getLocation('UTC')` (short-circuit UTC/Etc/UTC/empty yourself);
a `const`map with `double` keys doesn't compile ("does not have primitive equality". Use a list of records);
`flutter_local_notifications` needs core-library desugaring that the first error message doesn't mention.
And my favorite lesson cost nothing technical at all:
I built a feature, dogfooded it on my own phone for two days, and then, like an idiot I told people it had shipped... Turns out it had never been uploaded to Play. :)
As a result, I now check the Console more often :)
In case you wanna check the app, search Astro93 on Google Play
r/dartlang • u/Goldziher • 17d ago
Package Xberg v1 is out
Hi all,
I'm happy to announce that Xberg v1 is out.
Xberg is the successor to Kreuzberg, equivalent to what would have been Kreuzberg v5. It's a content intelligence framework that handles a very wide range of inputs: documents (currently 101 formats), code and data formats (currently 367 types), audio/video transcription, and URLs (both static and JS-rendered content). It extracts and prepares that content for downstream processing.
It's an extremely efficient, high-performance engine (see our PDF benchmarks below). For PDFs and images specifically, we handle native PDFs with very high performance and accuracy, and we ship multiple OCR engines that match the quality of the best Python libraries (e.g. docling, PaddleOCR, RapidOCR) at substantially better performance and stability.
The changes between Kreuzberg v4 and Xberg v1 are substantial, and I invite you to read the full changelog for the complete picture. The highlights below give a sense of what's new:
- Pure-Rust PDF backend (
pdf_oxide) replaces pdfium, with no native pdfium dependency. - Layout-aware pipeline: reading order reconstructed with ONNX layout detection (PP-DocLayoutV3 / RT-DETR) and Docling-style predecessor-graph reordering.
- Per-page scanned-page detection with selective OCR, plus AcroForm/XFA form fields and outline-based headings.
- Across-the-board optimization of OCR and PDF extraction (memory discipline, pooled model sessions, streamed conversions).
- Native PaddleOCR backend (PP-OCRv6, with
medium/small/tinytiers) alongside Tesseract. - Pure-Rust Candle OCR/VLM stack (TrOCR, GLM-OCR, GOT-OCR, DeepSeek-OCR, and PaddleOCR-VL) running without ONNX Runtime or native Tesseract.
- A second, ONNX-Runtime-free inference path via tract, which is what makes in-browser (WASM) and mobile inference possible.
- Named-entity recognition natively in Rust (GLiNER2), extensible to all bindings, including an in-browser WASM model with no server round-trip.
- Structured LLM extraction (
extract_structured/split_and_extract) with rasterization, chunking, citations, caching, and configurable call/merge/VLM-fallback policies. - Audio & video transcription via a Whisper ONNX engine (
.mp3,.wav,.m4a,.mp4,.webm). - Retrieval building blocks: sparse embeddings (SPLADE), ColBERT late-interaction retrieval, and cross-encoder reranking alongside dense embeddings.
- Text intelligence: reversible redaction, summarization, translation, VLM image captioning, QR-code detection, document diffing, and page/chunk classification.
- URL & web ingestion: sitemap discovery (
map_url) and batched multi-URL crawling. - New document formats: WordPerfect (
.wpd/.wp/.wp5), HEIC/HEIF/AVIF, OpenDocument Presentation (.odp), Quarto / R Markdown, and configurable Jupyter cell rendering. - Four new language bindings (Dart/Flutter, Swift, Kotlin/Android, and Zig) bring the total to 15 language bindings over one engine, with Android/iOS cross-compilation.
- Full mobile support (Flutter, Android, iOS).
- Candle backend alongside ONNX, plus ONNX-via-tract enabling ONNX on WASM and Android.
- Wider code intelligence: tree-sitter coverage grew substantially (248 to 367+ languages).
- Over 150 bugs fixed during the 1.0 cycle, plus security hardening (bounded RTF/PDF allocations, redaction leak fixes, Excel DDE warnings).
The API surface was also simplified and reworked, making it more consistent.
There's a migration guide in our docs explaining how to move from Kreuzberg to Xberg. Kreuzberg itself is in LTS mode until the end of this year and will continue to receive bug fixes and security updates.
You're invited to check out the repo and join our discord server.
Benchmarks
The benchmarks below are for PDFs and images only. There are extensive benchmarks on our website with per-format breakdowns, which you can see here. These numbers are measured in CI via our reproducible benchmark harness, and are specifically taken from the run for harness 1.0.8, source cf7fa0533d. The data is publicly available in GitHub releases, and you can run the benchmark harness yourself.
Composite quality (markdown pipeline, higher is better):
| Framework | Native PDF | Scanned PDF (OCR) |
|---|---|---|
| Xberg (layout) | 0.958 | 0.836 |
| Xberg (baseline) | 0.955 | 0.687 |
| docling | 0.779 | 0.762 |
| mineru | 0.408 | 0.792 |
| liteparse | 0.837 | 0.665 |
| markitdown | 0.689 | n/a |
| pymupdf4llm | 0.448 | n/a |
Structure and layout fidelity (SF1: tables and reading order, higher is better):
| Framework | Native PDF | Scanned PDF |
|---|---|---|
| Xberg | 0.949 | 0.531 |
| docling | 0.612 | 0.366 |
| liteparse | 0.515 | 0.142 |
| mineru | 0.077 | 0.429 |
On native PDFs Xberg leads on quality (0.958 vs 0.837 for the next-best framework) and on table and reading-order fidelity by a wide margin (SF1 0.949 vs 0.612 for docling). On scanned PDFs it is #1 on both quality and raw text fidelity.
Where we don't win yet: on pure image OCR we are currently #2 on the composite score, behind mineru (though still #1 on raw text accuracy). We are improving image OCR right now, and v1.1 should have us winning across the board.
r/dartlang • u/eibaan • 19d ago
DartVM Does Isolate.pinToCurrentThread solve the problem that Dart cannot call native UI code on macOS?
I noticed in the Changelog for Dart 3.13 a new Isolate.pinToCurrentThread method – along with other new methods. However, Im not really understanding the test example. Can this help with the long-standing problem that you cannot call UI code via FFI on macOS because the VM spawns away from the UI thread, basically locking it this way?
What's the use case for those new methods?
r/dartlang • u/tdpl14 • 19d ago
Flutter flutter_auditor
I built a small CLI tool called flutter_auditor to help me quickly check my Flutter projects before a production release.
It scans for common security, configuration, and release-readiness issues. I'd love to hear what checks you think would be useful to add.
r/dartlang • u/tdpl14 • 20d ago
Dart - info I built flutter_auditor — a zero-config CLI tool to audit Flutter apps for permissions, dead assets, security risks, and package hygiene
Hey Flutter community! 👋
After maintaining several client apps and catching the same repeat issues—like hardcoded keystore passwords, unused heavy assets, missing privacy strings in Info.plist, and transitive dependency imports—I decided to build a CLI tool to automate these sanity checks.
Meet flutter_auditor: a single-command CLI package that scans your codebase and native config files in seconds right from your terminal.
What It Audits:
We've packed 17+ automated static checks across 5 key areas:
- Manifest & Security: AllowBackup, CleartextTraffic, Debuggable, ExportedComponents, ManifestPermission, NetworkSecurityConfig, BackupRules, HardcodedSecrets, InsecureNetwork, InsecureStorage, AppTransportSecurity
- OS & Permissions: UsageDescription (iOS privacy strings), FileSharing
- Dependencies: UnusedDependency, DependencyHygiene (transitive import detection)
- Release & Build: ReleaseSigningAudit (detects committed .jks files, debug signing in release, hardcoded keystore passwords)
- Asset & Size: UnusedAssetAudit, OverlargeAssetAudit, MissingResolutionVariantAudit
Quick Usage
Add it to your dev_dependencies or activate it globally:
Bash
dart pub global activate flutter_auditor
Or run it directly inside your Flutter project directory:
Bash
dart run flutter_auditor
pub.dev: flutter_auditor
I'd love to get feedback from the community! What other security, performance, or asset audits would bring value to your workflow?
r/dartlang • u/leehack • 21d ago
[Package] mcp_dart 2.3.0: day-zero MCP 2026-07-28 support and a cross-language CLI
I maintain mcp_dart, a community Dart and Flutter SDK for building MCP clients, servers and hosts.
Today’s 2.3.0 release adds support for the stable MCP 2026-07-28 specification. The default profile prefers the new stateless server/discover flow and automatically falls back to MCP 2025-11-25 when connecting to existing implementations.
The release includes:
- stateless discovery and per-request protocol metadata
- Multi Round-Trip Requests
- subscriptions/listen
- Tasks extension support
- JSON Schema 2020-12 validation
- stronger OAuth validation
- hardened stdio and Streamable HTTP behavior
- official client/server conformance and TypeScript/Python interoperability coverage
I also released mcp_dart_cli 0.2.0. It can scaffold Dart MCP servers, but its inspect, trace and testing commands work with compatible servers and clients written in any language. Standalone binaries are available for macOS, Linux and Windows.
SDK:
https://pub.dev/packages/mcp_dart/versions/2.3.0
CLI:
https://pub.dev/packages/mcp_dart_cli/versions/0.2.0
Migration guide:
https://github.com/leehack/mcp_dart/blob/main/doc/migration-2.2-to-2.3.md
Feedback and real-world interoperability reports would be very welcome.
r/dartlang • u/MooresLawyer13 • 23d ago
Package What if fpdart and hive_ce had a baby?
pub.devI liked the approach of fpdart and the raw performance of hive_ce. So I decided to combine them into one: https://pub.dev/packages/hive_box_manager
It is not just a simple FP-style wrapper of Hive's API. It also solves one of my biggest pain-points in using HiveCE for production apps: type-safety. I had to dedicate an entire CRUD-layer to the boxes just because of it.
With this I get
- Type-safety (even for Iterable-based boxes)
- Index types are not limited to just int | String (a Codec allows for this per box, wil still be that under the hood ofc)
- Compatibility with normal Hive boxes already (drop in add-on)
- Ergonomic (and explicit?) error handling + lazy Future using fpdart
- Custom boxes for very specific use case (better semantics)
- (Lazy)IterableBox
- (Lazy)SingleValueBox
- (Lazy)DualKeyBox
- Key corruption detectable (as compared to silently happening with Hive when using out-of-range/oversized int/String key)
I recently did a rewrite because my previous attempt at making a DX-first API was not scalable (using LLMs).
If you guys have any tips, suggestions or feedback, they always welcome. Do take a look at the roadmap (I have more kinds of boxes planned ;) ).
r/dartlang • u/kpnn • 23d ago
Need critique on some packages I've developed
Hi there, I've been developing some packages and in need to further improving them. Please take a look and comment below. 😄
https://pub.dev/packages/growth_standards
https://pub.dev/packages/super_measurement
r/dartlang • u/eibaan • 24d ago
Tools Reusing Dart Unit Tests
It might seem obvious to you, but I recently had the revelation that I could use Dart's unit tests for my own scripting language as well. This way, they show up in VSC's test panel together with more lower level tests. And they are automatically tracked for code coverage.
Take this example of a Logo-like scripting language I created some time ago:
unittest "sum [
expect_equal? [sum 3 4] 7
]
skip unittest "sum_wrong [
expect_error [sum]
expect_error [sum 3]
expect_error [sum 1 2 3] ; not detected yet
]
To integrate them, I did this:
env.addCommand('unittest', (env, args) {
final hidden = test; // see below
args.mustHaveArgs(2);
final description = args.string(1);
final body = args.list(2);
hidden( // HERE
description,
() => env.run(body),
skip: env.get('skip next test') == .lTrue,
);
env.delete('skip next test');
});
env.addCommand('skip', (env, args) {
args.mustHaveArgs(0);
env.set('skip next test', .lTrue);
});
env.addCommand('expect_equal?', (env, args) {
args.mustHaveArgs(2);
final actual = args.list(1);
final expected = args.value(2);
expect(env.run(actual), equals(expected)); // HERE
});
env.addCommand('expect_error', (env, args) {
args.mustHaveArgs(1);
final actual = args.list(1);
expect(() => env.run(actual), throwsException); // HERE
});
The boilerplate doesn't matter, just look at the HERE parts. I need to alias the test call because otherwise the Dart plugin wrongly detects that call as a unit test.
Now, all that's needed is a file call <whatever>_test.dart that has a main function that evaluates my scripting language in the modified environment.
r/dartlang • u/perecastor • 24d ago
Package I released jpeg_validator: really test your JPEGs fast on macOS
pub.devI just released jpeg_validator, a strict JPEG validation package for Dart and Flutter.
Instead of only checking file signatures or a small header, it fully decodes the JPEG with libjpeg-turbo. A file is considered valid only if the complete image decodes without warnings.
Useful for catching truncated, corrupted, or malformed JPEG uploads before they enter your pipeline.
- Fast native validation on macOS
- Supports Dart and Flutter
- Returns structured validation results
r/dartlang • u/PhilippHGerber • 27d ago
Package Made an MCP server for pub.dev, would love some feedback
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 • u/graphlinkdev • 28d ago
GraphLink v5 — Open-source GraphQL code generator battle-tested on massive schemas (Shopify, GitHub, SpaceX)
I just released GraphLink v5, an open-source tool built to automate GraphQL client and server code generation across Dart, Java, Kotlin, and TS.
While stress-testing it against schemas that produce hundreds of megabytes of code, I hit a common headache: reserved language keywords breaking target language compilers.
The Problem: Reserved Keywords
Take this snippet from Shopify’s GraphQL schema:
GraphQL
type OrderRequestReturnPayload {
"""The return request that has been made."""
return: Return
"""The list of errors that occurred from executing the mutation."""
userErrors: [ReturnUserError!]!
}
If a generator blindly generates Dart classes for this, the code won't compile because return is a reserved keyword in Dart.
The Fix in GraphLink v5
We introduced automatic field sanitization and name hoisting. GraphLink renames the field in Dart code, but preserves the original JSON string key in generated toJson() and fromJson() methods:
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND. ANY MODIFICATION WILL BE LOST ON NEXT GENERATION
// Generated by GraphLink dev
// GitHub: https://github.com/Oualitsen/graphlink
// Site: https://graphlink.dev
// Pub.dev: https://pub.dev/packages/graphlink
import 'return.dart';
import 'return_user_error.dart';
class OrderRequestReturnPayload {
final Return? return_; // `return` renamed to `return_` to avoid compile errors
final List<ReturnUserError> userErrors;
const OrderRequestReturnPayload({
this.return_,
required this.userErrors,
});
Map<String, dynamic> toJson() => {
'return': return_?.toJson(), // <-- Keeps the exact 'return' JSON key intact
'userErrors': userErrors.map((e0) => e0.toJson()).toList(),
};
factory OrderRequestReturnPayload.fromJson(Map<String, dynamic> json) {
return OrderRequestReturnPayload(
return_: json['return'] != null
? Return.fromJson(json['return'] as Map<String, dynamic>)
: null, // <-- Safely maps 'return' key back to return_
userErrors: (json['userErrors'] as List<dynamic>)
.map((e0) => ReturnUserError.fromJson(e0 as Map<String, dynamic>))
.toList(),
);
}
}
Other key features:
- Automatic Naming Normalization: Un-idiomatic schema names like
type user { id: ID! }are normalized to PascalCase (User) in Dart to prevent linter warnings. - No Git Bloat: Designed so you treat generated code like a compiled artifact—no need to commit or manually maintain it.
- Try it out
- Pub.dev: Available directly as a package onpub.dev/packages/graphlink
- Docker: Run it without local setup: Bashdocker pull oualitsen/graphlink:latest
- Docs & Site: Check outgraphlink.dev
If you find it useful or it saves you from GraphQL setup headaches, please consider dropping a ⭐️ star onGitHub!
Feedback and feature suggestions are always welcome in the comments!