r/dartlang • u/South-Reception-1251 • 12h ago
[ Removed by Reddit ]
[ Removed by Reddit on account of violating the content policy. ]
r/dartlang • u/South-Reception-1251 • 12h ago
[ Removed by Reddit on account of violating the content policy. ]
r/dartlang • u/aj-zinkyaw • 6h ago
A few years ago, I tried Flutter for mobile development and really enjoyed writing Dart.
Since I mainly work on the backend, I started looking for a good backend framework written in Dart, but couldn't find one that suited my needs. So, I decided to build my own framework called DartOnDox (Dox).
But I found Dart wasn't fast enough for my backend framework, and it used too much memory and CPU. Eventually, I stopped working on it.
Fast forward to today. With AI getting so good, I decided to revisit the project and give it another shot.
This time, I rewrote the HTTP server in Rust, and the results surprised me. Dox is now 5× faster than Dart's HttpServer, close to Rust, and 2.7× faster than Go in my benchmarks.
Curious about the numbers? Here's how I run the benchmarks:
https://dartondox.dev/latest/digging-deeper/performance/#benchmark
r/dartlang • u/GMP10152015 • 1d ago
I’ve released brotli_fast, a fast Brotli encoder and decoder implemented entirely in pure Dart, without native libraries or FFI.
It works across all Dart platforms, including web/JS. It handles JavaScript’s numerical limitations safely, making it suitable for Brotli compression and decompression in browser apps.
Brotli can produce significantly smaller files than Gzip. For text, JSON, and WebAssembly (WASM), Gzip typically achieves around 30–35% compression, while Brotli can reach around 20–25%, resulting in roughly 20-30% smaller output compared to Gzip.
The goal is to provide fast, portable Brotli compression and decompression with a single pure Dart implementation.
Package: https://pub.dev/packages/brotli_fast
Feedback, benchmarks, and contributions are welcome!
r/dartlang • u/birjuvachhani • 3d ago
This is Dartpad Web!
Runs #Dart compiler, analyzer, LSP and compiles and runs your code in your browser directly. No server needed! Works offline too!
You can use any pure Dart package from pub.dev too that compiles to web.
r/dartlang • u/eibaan • 2d ago
The age of AI makes this possible: Because the Dart VM blocks the UI thread on macOS, I figured I could ask GPT to write me a new VM - of course using Rust, because that's the goto language for rewrites – that would allow me to run small Dart programs.
And it worked.
I spent years studying compiler construction and VMs, working in that field for a couple of years, and while I would probably be able to do this on my own, that would take days if not weeks and hence, I wouldn't consider doing it just for fun.
Now, I got a working PoC in less than two hours.
Here's my prompt, in case you want to create your own personal VM, too.
[after explaining the problem and the wish to write 1980s games]
So, why not create a new VM using Rust that runs on the UI thread and provides a special library (i.e. based on
minifb) that can be used to do display simple retro pixel graphics.For a PoC, only a subset of Dart needs to be supported. The VM must support hot reload, though. I can use the usual Dart IDE tooling to write the program, but run the code with a new VM. That VM can assume that all code is valid. Also, execution speed isn't an issue.
Start by inventing a simple API to create a window, access its pixmap, set or get ARGB pixels, update the window's content, receive mouse and key events and a close event. Create a typical game framework based on that, e.g. a loop to update the game, paint everything, flip the buffers. To omit async operations, we can query for events in a loop.
After we agreed upon this, design the subset of Dart required. Then design the VM instructions needed to implement that. We could either use a Dart program that uses the
analyzerpackage to parse source code and resolve types to generate a bytecode. Or do this in Rust because it is easier/faster. The latter is the final goal, but for a PoC the former might quicker to implement. Present the result for review, then implement everything.Runtime errors must contain the original line number. The format must be compatible to Dart's way so that the IDE doesn't notice that it doesn't run the original Dart VM.
Also come up with a dozen or so examples. One might be a snake game controlled by the arrow keys. While the game is running, it must be possible to for example modify the color of the snake and the VM shall automatically hot-reload the changed source code, re-compile it and replace the old methods with the new ones, and the color will change with the next screen update, keeping the state of the game.
GPT Sol medium needed 15min to come up with a first version that demo'd hot reloading to change a color. It then took 30min to implement most of Dart, extending the initial minimal compiler. It chose to write the compiler in Dart, emitting byte code in an unoptimized mnemonic format which is then re-loaded by the Rust VM. It made a simple error not correctly wiring up key events, but after me complaining about it, it continued to implement more advanced features, writing more demos (like pong or life) in another 46min. And frankly, I was surprised that its design was quite good (by the book, one could say) and quite practical.
Using Dart to compile the Dart source unfortunately imposes a 5s startup tax, but once the Dart compiler and its analyzer package have been loaded, reloading my examples happens nearly instantly.
While I'm writing these lines, GPT is adding tests, searching for (and finding) edge cases and it is quite spooky to watch it to remote control Visual Studio Code to change source code while watching the also remote controlled example app.
r/dartlang • u/Infamous-404 • 4d ago
Switching to other languages in order to write backend applications because there's a clear lack availability of the tools around that in dart ecosystem.
One such problem I kept hitting: there is no standard package like (swag for go) to generate OpenAPI specs and Swagger UI for Dart backends. Thinking about solving this problem I started working on Axle(v0.2 out now).
The core idea is small. Almost everything lives in one package, axle_core: the annotations, the OpenAPI 3.1 document model, and a tiny serving contract called AxleDocs. No framework imports, no runtime dependencies. A CLI reads your annotated Dart source with package:analyzer and emits the spec, so no build_runner and no runtime registry. Then thin adapters translate AxleDocs into framework responses. I published adapters for Serverpod 4, Shelf, and Relic, but they are intentionally boring on purpose, anyone can write one for another framework without touching core or the CLI.
It gives you openapi.json, openapi.yaml, Swagger UI assets, and an AOT-safe const string. It handles security schemes, response headers, cookies, multiple media types, multipart uploads, parameter constraints, and oneOf schemas. If a route references a security scheme that doesn't exist, generation fails instead of emitting a broken contract.
Docs are at https://axle.infms.dev if you want the full picture. There is also an agent skill that walks through setup end to end:
npx skills add infm5/axle --skill axle-openapi-setup
If you've felt the same backend-in-Dart pain, I'd genuinely like to hear what would make this useful to you. Advice, criticism, all welcome.
r/dartlang • u/Rexios80 • 7d ago
Hey there. I rebuilt https://pubstats.dev/ with Jaspr. It's a loooooot faster now. Also if you haven't heard of this site before you are able to set up alerts for when your package stats change. It's very useful for getting notified if your package loses pub points and needs updated!
r/dartlang • u/ChristianKl • 8d ago
One of the main drawbacks of dart compared to many other languages is that a lot less manhours went into optimizing the performance of dart compared to the more commonly used languages.
AI provides an opportunity to close that gap.
Program performance should be easy to evaluate for the internal AI agents that Google trains for new models. Making Dart performance better should be a good training task for the models.
r/dartlang • u/_kit_g • 9d ago
Hi all,
Wanted to share my experience with real-world server-side Dart.
A long-time Flutter + Python dev, and a linguist in a previous life, I always enjoyed the expressivity of Dart. But in my career, I live in AWS, there is no official AWS SDK in Dart, so I couldn’t write my server apps in Dart.
How sad. So clearly, had to build my own.
There is this fitness app I built for myself (yeah, I know) that was a natural Flutter choice from the start, had a bit of a twisted history on the backend. Initially I wrote the server in Go and wrapped it in an AWS Lambda function. The more I wrote Go, the less I enjoyed it.
Finally, I started researching Dart solutions. Tried a bunch, the one with the frog, obviously Shelf, Serverpod felt heavy and opinionated. And then I saw Relic and frankly, just enjoyed the Dart that it was written in. Relic is to Serverpod feels like what Starlette is to FastAPI, and I wrote a lot of Starlette in my days.
So, had to try.
Eventually, all my handler signatures stabilized in this shape
typedef ModelHandler = Future<Model?> Function(Request);
where Model is an interface for my JSON responses and Request is a Relic’s primitive. This gives me FastAPI-style typed inputs and outputs. Sure, input parsing and validation is a bit of manual work, but oh well.
As far as the AWS SDK, it ended up a boto3-shaped wrapper that signs every request to AWS API with SigV4. Really, nothing fancy.
So, high-level arch:
API Gateway → AWS Lambda + Lambda Web Adapter + Dart’s Relic server app → Postgres on Supabase.
The API app sends SQS events for background jobs, those requests are signed with the same AWS library.
Gaps I felt: no Swagger and no easy way to get there. My app has a Developer API and an MCP and I feel that absence deeply.
Some numbers from my serverless “production”:
All of that on a free Supabase instance.
Too early to celebrate, of course, but as far as compute goes, Dart surprises pleasantly, and I now get to write my apps in it.
Sensing folks from r/serverpod would appreciate the story.
r/dartlang • u/BaddiesChaser • 13d ago
As the title follows i made a dart Package for writing APIs and all without any dependencies. It has middlewares, Routes types, Response immutable models.
Why I did this ?
I saw shelf and frog but for they are kind of confusing. And shelf needs shelf router as a separate package. And syntax too some confusing.
So this Quadrant server minimises the understanding and you can write APIs without any hiccups. We can use shared models for both flutter and this backend ( Your choice completely ). It can serve static files too.
About Deployment:
We need to deploy this in vps with docker ( it will be simple ) or you can directly build service file and initialise with systemd in linux server.
Thankyou.
r/dartlang • u/creatorpiyush • 15d ago
I maintain arch_guard, an MIT CLI + library that enforces layer rules and finds circular imports in Dart projects, plus arch_guard_lint, an analyzer plugin on the new analysis_server_plugin API. A few implementation details that might interest this sub:
// or /* inside URIs, nested block comments, annotations and import-like text in later string literals don't confuse it. Dependencies are just args, glob, path and yaml.ProjectScanner.scanSources() builds the graph from in-memory contents, so cycle warnings reflect unsaved editor buffers. Quick fixes edit the directive (or just one clause of a conditional import) and can add a layer to allowed_imports in whichever config file it came from.package: imports across Dart workspace / Melos packages, so it catches cycles across package boundaries and enforces which packages may import which.dart compile exe) for Linux/macOS/Windows so CI doesn't need the SDK. CI tests on all three OSes against SDK 3.8 and stable, and the plugin is analysed against its lowest allowed dependencies.ArchAnalysis, ArchGuardConfig, LayerValidator, CycleBreaker, Baseline, exporters, and expectArchitecture() for tests.bash
dart pub add --dev arch_guard && dart run arch_guard init
Code: https://github.com/creatorpiyush/arch_guard Docs: https://creatorpiyush.github.io/arch_guard/
Happy to talk about the parser trade-offs (directive tokenizer vs package:analyzer), what building on the new plugin API was like, and I'd appreciate feedback on the public API.
r/dartlang • u/creatorpiyush • 17d ago
I maintain arch_guard, an MIT CLI + library that enforces layer rules and finds circular imports in Dart projects, plus arch_guard_lint, an analyzer plugin on the new analysis_server_plugin API. A few implementation details that might interest this sub:
// or /* inside URIs, nested block comments, annotations and import-like text in later string literals don't confuse it. Dependencies are just args, glob, path and yaml.ProjectScanner.scanSources() builds the graph from in-memory contents, so cycle warnings reflect unsaved editor buffers. Quick fixes edit the directive (or just one clause of a conditional import) and can add a layer to allowed_imports in whichever config file it came from.package: imports across Dart workspace / Melos packages, so it catches cycles across package boundaries and enforces which packages may import which.dart compile exe) for Linux/macOS/Windows so CI doesn't need the SDK. CI tests on all three OSes against SDK 3.8 and stable, and the plugin is analysed against its lowest allowed dependencies.ArchAnalysis, ArchGuardConfig, LayerValidator, CycleBreaker, Baseline, exporters, and expectArchitecture() for tests.bash
dart pub add --dev arch_guard && dart run arch_guard init
Code: https://github.com/creatorpiyush/arch_guard Docs: https://creatorpiyush.github.io/arch_guard/
Happy to talk about the parser trade-offs (directive tokenizer vs package:analyzer), what building on the new plugin API was like, and I'd appreciate feedback on the public API.
r/dartlang • u/julemand101 • 22d ago
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 • u/aortem • 22d ago
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 • u/GMP10152015 • 25d ago
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 • u/joshuaayson • Sep 28 '26
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 • u/Bloby77 • Sep 27 '26
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 • u/AqironSecurity • Sep 22 '26
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:
The source is public, and contributions are welcome.
r/dartlang • u/AqironSecurity • Sep 22 '26
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:
The source is public, and contributions are welcome.
r/dartlang • u/AqironSecurity • Sep 22 '26
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:
The source is public, and contributions are welcome.
r/dartlang • u/leswahn • Sep 15 '26
r/dartlang • u/_XYZT_ • Sep 15 '26
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 • u/all_natural_toast • Sep 13 '26
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 • u/Key-Communication865 • Sep 07 '26
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:
{count} or {name}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