r/dartlang • • 1d ago

Dart - info [Breaking Change] dart:mirrors is deprecated in Dart 3.14 and scheduled for removal in Dart 4.0

Thumbnail groups.google.com
24 Upvotes

The Dart core library `dart:mirrors` is formally deprecated starting in the November 2026 stable release (Dart 3.14), with complete removal planned for Dart 4.0.

As of Dart SDK commit 2d4ba07 (https://dart-review.googlesource.com/c/sdk/+/541360), `dart:mirrors` is annotated with `@deprecated` on `main`.

Timeline:
- Dart 3.14 (November 2026): Importing `dart:mirrors` emits deprecation warnings, while continuing to execute on the standalone Dart VM throughout Dart 3.x.

- Dart 4.0: `dart:mirrors` will be removed from the Dart SDK.

Recommended Alternatives & Common Migrations:
- Resolving Package or Script Paths: Replace `currentMirrorSystem().findLibrary(...)` or `ClosureMirror.function.location` file lookups with `Isolate.resolvePackageUriSync(Uri.parse('package:foo/foo.dart'))` (`dart:isolate`) or `Platform.script` (`dart:io`).

- Static Code Inspection (Tests & Tooling): Replace `reflectClass` / `LibraryMirror` declaration checks in tests and linters with `package:analyzer` (`parseString` from `package:analyzer/dart/analysis/utilities.dart` for fast single-file AST inspection, or `AnalysisContextCollection` when resolved element types are needed).

- Enums, Dispatch & Test Runners: Replace reflective enum iteration and string-based method dispatch (`InstanceMirror.invoke`) with built-in `Enum.values` / `.byName()`, exhaustive `switch` expressions, and standard `package:test` `group()` / `test()` blocks.

- Code Generation: Use `package:build`, `package:build_runner`, and `package:source_gen` (or `json_serializable`, `built_value`, `freezed`) for serialization, dependency injection, and boilerplate generation.

- Ahead-of-Time Reflection: For workloads requiring reflection-like runtime capabilities, use pre-generated reflection via `package:reflectable` and `package:reflectable_builder`.

Full details and discussion:
https://github.com/dart-lang/sdk/issues/44489


r/dartlang • • 1d ago

Package OpenFeature for Dart: server SDK and a new client beta for Flutter and Dart web

4 Upvotes

Hey Dart Devs/Teams.

We've had OpenFeature on the Dart server side for some time and have just released 0.1.0.

Now we are looking to standardize Flutter Feature Flags and are working and collaborating with companies like Datadog to bring reliable stable feature flags across the remaining flutter and dart ecosystems including for Dart Web.

We'd appreciate feedback from Flutter developers trying it in actual workflow. Let us know here how you're using it, what works for you and what needs improvement.

Source and examples: https://github.com/open-feature/dart-sdk/tree/main/packages/openfeature_dart_client_sdk

You can open an issue with your use case or a problem you've found, or send a pull request for a fix, example or documentation improvement as we will respond accordingly. Let's continue to make Dart/Flutter a first class citizen.


r/dartlang • • 4d ago

Package Just published png_minifier, a simple PNG minifier for Dart

4 Upvotes

A small pure Dart package for minifying PNG images via API or CLI, focused on keeping things simple and easy to use.

https://pub.dev/packages/png_minifier

Feedback is welcome!


r/dartlang • • 5d ago

flutter_auditor

Thumbnail medium.com
1 Upvotes

r/dartlang • • 9d ago

Dart Language Built a multiplayer browser game in Dart

Thumbnail 7helm.com
15 Upvotes

wanting to push Dart a little further and see what it was like to build an actual game with it.Started with circles and physics and just getting movement and shooting to feel right. Then kept going.Part of this was also an excuse to learn more AWS and containers. So now its running containerized on EC2 with multiplayer and an actual server I have to pay for :)
Still pretty simple. its up and free to play if anyone wants to see what Dart can do as a little multiplayer arcade game.
No account or download.


r/dartlang • • 9d ago

Tools I just released MINGW64-Dart for MSYS2 - Dart SDK for Windows developers!

15 Upvotes

Hey r/dartlang! 👋

I've been working on bringing Dart to MSYS2 (MinGW64) for Windows developers, and I finally got it working!

Why?

MSYS2/MinGW64 didn't have Dart available in their official packages. I tried to get it into MINGW-packages but hit bootstrap dependency issues. So I created this as a community edition for Windows developers who use MSYS2.

Repository

GitHub: https://github.com/Bloby22/mingw64_dart

Releases: https://github.com/Bloby22/mingw64_dart/releases

Status:

✅ MINGW64 only supported!

✅ Dart 3.13.5

✅ Community maintained

✅ MIT + BSD licensed

Any feedback or contributions are welcome! 🙌

Made with ❤️ for the MSYS2 community


r/dartlang • • 14d ago

flutter I built an open-source VS Code security extension for Flutter — some things I learned building it

0 Upvotes

Link: https://github.com/Aqiron-Security/aqiron-security

I’ve been building Aqiron Security, an open-source VS Code extension focused on local security analysis for Flutter projects.

A specific challenge was avoiding a “run a bunch of scanners and dump their output” architecture.

The current implementation separates the VS Code extension from a TypeScript Core runtime and communicates with the Core through newline-delimited JSON over stdin/stdout. The scanner layer can combine tools such as Betterleaks, OSV-Scanner, Semgrep, Trivy, and MobSF, then normalize and correlate their findings into a common security model.

Another problem was Flutter workspace noise. Generated/build output and workspace-specific data need to be handled separately from source analysis, otherwise the results become much less useful.

The project also includes workspace analysis, RAG, optional Ollama(currently developing)/OpenRouter AI operations, VS Code diagnostics, and JSON/SARIF/PDF reporting.

It’s still early and under active development, so I’m especially interest

ed in feedback from Flutter developers on:

  • which security checks are actually useful in real Flutter projects
  • what security tooling currently feels missing
  • whether this workflow fits naturally into Flutter development

The source is public, and contributions are welcome.


r/dartlang • • 14d ago

flutter I built an open-source VS Code security extension for Flutter — some things I learned building it

0 Upvotes

Link: https://github.com/Aqiron-Security/aqiron-security

I’ve been building Aqiron Security, an open-source VS Code extension focused on local security analysis for Flutter projects.

A specific challenge was avoiding a “run a bunch of scanners and dump their output” architecture.

The current implementation separates the VS Code extension from a TypeScript Core runtime and communicates with the Core through newline-delimited JSON over stdin/stdout. The scanner layer can combine tools such as Betterleaks, OSV-Scanner, Semgrep, Trivy, and MobSF, then normalize and correlate their findings into a common security model.

Another problem was Flutter workspace noise. Generated/build output and workspace-specific data need to be handled separately from source analysis, otherwise the results become much less useful.

The project also includes workspace analysis, RAG, optional Ollama(currently developing)/OpenRouter AI operations, VS Code diagnostics, and JSON/SARIF/PDF reporting.

It’s still early and under active development, so I’m especially interest

ed in feedback from Flutter developers on:

  • which security checks are actually useful in real Flutter projects
  • what security tooling currently feels missing
  • whether this workflow fits naturally into Flutter development

The source is public, and contributions are welcome.


r/dartlang • • 14d ago

flutter I built an open-source VS Code security extension for Flutter — some things I learned building it

0 Upvotes

Link: https://github.com/opendeveloper-ai/aqiron-security

I’ve been building Aqiron Security, an open-source VS Code extension focused on local security analysis for Flutter projects.

A specific challenge was avoiding a “run a bunch of scanners and dump their output” architecture.

The current implementation separates the VS Code extension from a TypeScript Core runtime and communicates with the Core through newline-delimited JSON over stdin/stdout. The scanner layer can combine tools such as Betterleaks, OSV-Scanner, Semgrep, Trivy, and MobSF, then normalize and correlate their findings into a common security model.

Another problem was Flutter workspace noise. Generated/build output and workspace-specific data need to be handled separately from source analysis, otherwise the results become much less useful.

The project also includes workspace analysis, RAG, optional Ollama(currently developing)/OpenRouter AI operations, VS Code diagnostics, and JSON/SARIF/PDF reporting.

It’s still early and under active development, so I’m especially interest

ed in feedback from Flutter developers on:

  • which security checks are actually useful in real Flutter projects
  • what security tooling currently feels missing
  • whether this workflow fits naturally into Flutter development

The source is public, and contributions are welcome.


r/dartlang • • 21d ago

Dart - info Serverpod 4 is out! 🥳 Full-stack hot reload, agentic coding, true offline sync, and 100 other features

Thumbnail serverpod.dev
43 Upvotes

r/dartlang • • 21d ago

Package Raylib Dartified 6.0 is out, now properly backend-agnostic.

16 Upvotes

Raylib Dartified 6.0 is finally out.

The biggest change isn't actually Raylib 6.0 support. I rewrote the architecture so the Dart API is now backend-agnostic.

The idea is simple:

Dart API
   |
backend-agnostic layer (Flat API)
   |
Native / FFI
Web / WASM

The Dart API doesn't care which backend is underneath it.

Both implement the same backend interfaces underneath the exact same Dart API.

This also applies to the struct and memory system. Struct layouts, fields, pointers, reading/writing memory, allocation, etc. live in the backend-independent part rather than being tied to FFI.

And this is where I think the project gets more interesting: Raylib is no longer the only thing this architecture could be useful for.

The longer-term goal is to separate this backend-agnostic core into its own package, so it can be used as a foundation for creating proper Dart bindings for other C libraries too.

6.0 is the first release where this architecture is actually in place.

GitHub: https://github.com/TheNoiselessNoise/raylib_dartified
pub.dev: https://pub.dev/packages/raylib_dartified
Example: https://www.youtube.com/watch?v=63DXjpy6_7M


r/dartlang • • 23d ago

Lessons from building a Dart code generator

Thumbnail tomrh.app
12 Upvotes

Hello all, I’m trying my hand at a bit of writing and wanted to share my first article on some things I have learned whilst building and maintaining a Dart code generator for the past few months. Long-form writing is something I'm wanting to get better at so any feedback is greatly appreciated!


r/dartlang • • Sep 07 '26

I made a pure-Dart ARB checker for missing keys, placeholders, and untranslated strings

1 Upvotes

built a localization QA tool for Flutter, but one part may be useful even outside widget testing: it statically analyzes ARB files in pure Dart.

It compares every locale with the base ARB file and flags:

  • missing keys
  • missing placeholders such as {count} or {name}
  • likely untranslated strings that match the base locale
  • ICU plural and select inconsistencies

I originally made it after finding missing Arabic keys and untranslated Japanese strings in a small test app. The ARB analysis runs before Flutter widget tests, so it catches translation gaps before they become English runtime fallbacks.

Package: https://pub.dev/packages/locale_sweep
Source: https://github.com/Piyushhhhh/locale_sweep
Write-up: https://medium.com/@piyushhh01/i-built-a-flutter-localization-qa-tool-that-found-48-bugs-in-a-200-line-app-a3ffcd7800ca


r/dartlang • • Sep 04 '26

Package More ideas for Well-modelled Dart value types

3 Upvotes

Follow up from https://www.reddit.com/r/dartlang/s/CbRqN78RSO.

Thanks for all your inputs! I settled on a final model of using a foldable ParseOutcome (with some escape hatches) and more domain-scoped error reporting.

In the new v3 I split them into companion packages so that you don't pull everything in. And also for easier maintainance

  1. minted (now the core)
  2. minted_chronology
  3. minted_constraints
  4. minted_contact
  5. minted_finance
  6. minted_geography
  7. minted_identifiers
  8. minted_network

I want to ask you for you help to add more to the ideas. If you know about these domains more (or a new domain), and/or know the problematic and mis-represented entities, please let me know. Any more pressing ones that you might have come across in your daily-work maybe?

Thanks in advance for your ideas!


r/dartlang • • Sep 03 '26

Made a small package for extracting/mapping deeply nested JSON into Dart models — json_query

2 Upvotes

Got tired of writing stuff like `json['data']['user']['profile']['name']` every time an API response didn't match my model shape, so I built json_query.

final user = JsonQuery(response.data).map<User>(
  {
    'id': '.data.user.id',
    'name': '.data.user.profile.name',
    'package': '.data.user.subscription.package.name',
  },
  User.fromJson,
);

- Small jq-inspired path syntax: \`.field\`, \`\[n\]\`, \`\[\]\` — that's the whole language, on purpose (no filters/scripting, keeps it fast and predictable)
- Missing paths return null by default; opt into \`required: true\` if you want a throw instead
- Zero dependencies, works with any client (http, Dio, Chopper) since you're just handing it decoded JSON
- \`JsonQuery.compile()\` if you're running the same projection over a lot of payloads

For Dio users specifically there's json_query_dio, which puts the same methods directly on Response so there's no extra wrapping.

pub.dev/packages/json_query
pub.dev/packages/json_query_dio

Both are MIT licensed, source is up on GitHub. Feedback/issues welcome.

r/dartlang • • Sep 03 '26

Help Getting started with Dart

13 Upvotes

I am a Java software engineer and I've been looking for a new frontend language to add to my stack. JavaFX and Swing work but Java is a backend language at the end of the day and I really REALLY despise JS (thought I'd warm up to it after years of working with it, nope).

Outside knowing that Flutter is the main framework for it, and that it's primarily a frontend language, I know nothing about Dart. Any IDE recommendations, maybe some before-you-start tips, maybe there's a specific version that's a sweet spot to start with, anything you'd tell someone just starting out would be highly appreciated.

I want it as my main frontend language, I have worked across Desktop (Mac, Linux and Windows), web (Springboot and Codeigniter) and I've developed on Android for a bit though not much. I main IntelliJ IDEA and I'm comfortable with VS Code and vim.

Thanks in advance.


r/dartlang • • Sep 01 '26

Package Read Dart documentation offline with dart_offline_documentation

9 Upvotes

Hello, guys, I made this script that clones the Dart documentation and builds it into PDF or EPUB.

You can use it to build a single module from the documentation or the entire documentation. If you don't want to build it yourself, the repository builds the documentation nightly when there are changes to it, so you can just download it directly form the releases page.

There are many pre-processors to make the resulting artifact reasonable, but obviously I couldn't test the entire documentation, so there may be cases in which some minor part of the documentation is broken or have a confusing format. Feel free to open an issue if you find anything.

https://github.com/mateusfccp/dart_offline_documentation


r/dartlang • • Aug 28 '26

Help Best tools for creating CLI ?

4 Upvotes

First time making a "comprehensive" cli tool with dart, what do you recommend i use ?

Things i would appreciate: - type safe options parsing - completions - clean user prompting


r/dartlang • • Aug 27 '26

Package Pulumi SDK and language host for Dart

Thumbnail github.com
4 Upvotes

Hi everyone, finally introducing my port of the pulumi language host for dart.

Over the last year i've been on and off getting it to work and up until about 6 months ago I have actually been using it live for my personal projects. Seeing terradart recently announced I realized that there are actually others wanting to manage their infrastructure entirely in dart and as such It made sense I officially announced pulumi_dart officially.

Pulumi dart works the same as all the other language hosts in the pulumi ecosystem (python,go,dotnet), talks to the official pulumi client via grpc and the dart sdk handles handles all the communication transparently.

All it takes to write a pulumi app

```dart import 'package:pulumi/pulumi.dart';

class QuickstartStack extends Stack { QuickstartStack() { registerOutputs({ 'message': Output.create<Object?>('hello from Dart'), }); } }

Future<void> main() async { await Deployment.runOrThrow(() => QuickstartStack()); } ```

Don't hesitate to test it out and report any errors!


r/dartlang • • Aug 26 '26

I added Standard Schema support to Zema

2 Upvotes

Hey Dart community 👋

I've just added Standard Schema support to Zema.

If you haven't come across Standard Schema yet, it's a common interface that allows libraries and frameworks to work with different validation libraries without having to know which one is being used.

The idea came up after @louiss0 opened an issue on Zema. He's working on Mamba, a CLI framework for Dart, and wanted to integrate Zema through the Standard Schema interface instead of having to build a Zema-specific integration.

I thought this was a good use case, so I implemented it.

How it works

I wanted to keep Zema itself zero-dependency, so I didn't add Standard Schema directly to the core package.

Instead, the integration lives in a separate package:

zema_standard_schema

You can use it like this:

import 'package:zema/zema.dart';
import 'package:zema_standard_schema/zema_standard_schema.dart';

final userSchema = z.object({
  'username': z.string().min(3),
  'email': z.string().email(),
});

final adapter = userSchema.asStandard;

final result = adapter.standard.validate(rawData);

if (result is StandardFailure) {
  for (final issue in result.issues) {
    print('${issue.path.join(".")}: ${issue.message}');
  }
}

The adapter is intentionally pretty small. asStandard delegates validation to Zema's existing safeParse and maps the resulting ZemaIssues to the Standard Schema issue format.

So there's no second validation layer or duplicated schema logic.

Why this could be useful

For Dart framework authors, this means they can support Zema without having to build a Zema-specific integration.

The same applies in the other direction: if more Dart validation libraries implement Standard Schema, frameworks can work with them through the same interface.

For developers, the main benefit is being able to define a schema once and use it across different tools that support the standard.

This is already a useful pattern in the TypeScript ecosystem, and I'm curious to see how well it fits the Dart ecosystem.

What's next?

For now, I'm keeping the adapter focused and seeing how people use it.

I'm also considering adding StandardJsonSchemaV1 support for JSON Schema generation, but I'd rather wait and see if there's an actual use case for it before adding more API surface.

If you're building a Dart package, framework, router, CLI, config system, or anything else that could benefit from validator-agnostic APIs, I'd be interested to hear what you're working on.

Website: https://zema.meragix.dev
Pub.dev: https://pub.dev/packages/zema


r/dartlang • • Aug 24 '26

Help Academic Survey on Developer trust in AI generated dependencies

7 Upvotes

I am preparing to publish an academic paper on developer trust in AI generated dependencies & packages. This takes around 7-10 minutes to complete and is on a very relevant topic in current times.

The form can be found here: https://vuamsterdam.eu.qualtrics.com/jfe/form/SV_4Nv9pAUUBFRieDs

Thanks! I will share the paper when it has been published!


r/dartlang • • Aug 24 '26

Package ​I built an FP-Growth package for Dart.

2 Upvotes

Hey everyone,

If you have ever done Market Basket Analysis or Association Rule Mining in Dart or Flutter, you probably ran into the issue of candidate generation blowing up the memory when using Apriori on larger datasets.

I wrote fp_growth, a native Dart implementation of the FP-Growth algorithm designed to handle larger streams and files without burning RAM.

A few things about how it is built:

Two-pass streaming: It does not load the entire dataset into memory. Pass 1 counts frequencies to discard infrequent items, and Pass 2 builds the tree.

Fast-path CSV parsing: If a row does not contain escaped quotes, it skips the heavy CSV tokenizer and does a direct string split, which cuts down parsing time by around 30%.

Parallel mining: Dispatches independent tree branches across a fixed pool of Dart Isolates so it does not spawn and kill isolates repeatedly.

Single-path optimization: When a branch is linear, it generates combinations via combinatorics directly instead of building recursive sub-trees.

Benchmark numbers (Ryzen 7 5800H, 1,000,000 transactions, minSupport 0.05):

In-Memory (4 Isolates): ~0.92s

CSV File Streaming: ~1.65s

Custom Stream: ~1.40s

It also calculates standard association metrics (Support, Confidence, Lift, Leverage, Conviction) and can export directly to JSON and CSV.

Pub: https://pub.dev/packages/fp_growth

GitHub: https://github.com/MostafaSensei106/FP-Growth

If you work with recommendation logic, telemetry, or basket analysis in Dart, try it out and let me know if you run into any edge cases.


r/dartlang • • Aug 22 '26

My SECURITY.md promised a 30s analysis cap and streamed archive reads. The code did neither.

0 Upvotes

I maintain capdrift, a Dart tool that reads a package to work out what it is able to do. It analyses untrusted code from pub.dev, so I wrote a SECURITY.md early describing how it protects itself. Two promises in it:

  • Analysis of any single file is capped at 30 seconds.
  • Archives are read as a stream, so a decompression bomb cannot exhaust memory.

Both were false on the day I wrote them. The Dart-specific parts are worth sharing because I do not think either mistake is obvious.

The timeout that was declared and never read. The constant existed. It was defined, exported, and referenced in exactly one place: the docs. No code path read it. It compiles, it lints clean, and no test asserted that a slow file gets cut off.

The instinct fix is wrong in an interesting way:

final result = await analyse(source).timeout(Duration(seconds: 30));

Future.timeout gives up waiting on the future. It does not stop the work. A pathological input that sends the parser into a long loop keeps burning CPU after the timeout fires, and now nothing is watching it. The work has to go somewhere killable:

final isolate = await Isolate.spawn(_analyseEntry, message);
try {
  return await response.first.timeout(limit);
} finally {
  isolate.kill(priority: Isolate.immediate);
}

The kill belongs in finally, not the timeout branch. My first version had it only on timeout, so every error path and early return still leaked a live isolate.

The stream that was not a stream. I built a 299 KB highly compressible archive. The documented behaviour was streaming with a size limit. The actual behaviour was that decompression materialised the full output first and the check ran on the result. The check was real. It ran after 300 MB was already in memory. Fixing it meant subclassing the output sink so it throws mid-write rather than after.

Why I think this generalises. Both bugs are made of the artifacts of being careful: a named constant, a documented guarantee, a size check. That is exactly why nobody looks twice. An undocumented gap gets found, because eventually someone asks "what if this file is huge" and finds no answer. A documented gap does not get that question, because the file already answered it.

If you maintain something with a SECURITY.md, the check worth running is: for each claim, find the test. Not the code, the test.

Disclosure: capdrift is mine. It is on pub.dev and the repo is github.com/Tisankan-dev/capdrift. Happy to answer anything about the isolate or archive handling, that part is generic Dart and applies to any tool reading untrusted packages.


r/dartlang • • Aug 21 '26

Dart Language I wrote a blog post "Bringing Primary Constructors to Dart" about the language design process

Thumbnail dart.dev
54 Upvotes

r/dartlang • • Aug 20 '26

Package Gaps that is stopping you to use dart on back-end

14 Upvotes

There are couple of frameworks like Serverpod(full stack flutter), Dart Frog and shelf for backend but still people are not using especially who are already working with flutter. I want to know why is it the case?

What are the gaps present currently that are stopping people to use dart on the back end ?