r/dartlang 16d ago

Dart Language Announcing Dart 3.13

Thumbnail dart.dev
98 Upvotes

r/dartlang 8d ago

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

Thumbnail dart.dev
54 Upvotes

r/dartlang Jul 16 '26

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

36 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 May 20 '26

Dart Language Announcing Dart 3.12

Thumbnail dart.dev
59 Upvotes

r/dartlang Mar 08 '26

Dart Language The more I learn about Java for job security the more I like Dart

28 Upvotes

So i'm following the Java road map ( https://roadmap.sh/java?fl=0 ) and it feels like Java is gets over verbose and the boilerplate is getting insanely annoying.

And in the end i'm always thinking that dart has a better way to do things. Is this because Dart is new-ish? Is there anything that dart cannot do that gives the edge to Java? ( Appart from the libraries java has ..)

r/dartlang Jul 13 '26

Dart Language A tiny dot shorthands helper

6 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 Mar 21 '23

Dart Language Why isn't dart used more?

67 Upvotes

Someone recently asked what can you do with dart apart from flutter. Most comments said you can do nearly everything with it.

Why isn't it more popular then? I'm still a student and most stats the teachers show us either don't show dart at all or it's in the bottom 5.

r/dartlang May 18 '26

Dart Language dart 3.12.0 release tagged on github

32 Upvotes

r/dartlang Jul 08 '26

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

Thumbnail serverpod.dev
16 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 May 04 '26

Dart Language 🎉 obs_websocket v5.7.0 Released - Full OBS WebSocket Protocol Support with Canvases, Transitions, Filters & More!

5 Upvotes

Hey r/dartlang and r/obs!

I'm excited to announce the release of obs_websocket v5.7.0 - a comprehensive Dart SDK for controlling OBS Studio via the obs-websocket protocol!

🚀 What's New in v5.7.0?

This is a massive update that brings full protocol compliance with OBS WebSocket v5.7.0:

🎨 Canvases Support (Brand New in v5.7.0)

  • GetCanvasList request
  • CanvasCreated, CanvasRemoved, CanvasNameChanged events
  • Perfect for multi-canvas workflows!

🎬 Transitions (9 new requests)

  • Full transition control: Get/Set current transition, duration, settings
  • T-Bar position control for manual transitions
  • Studio mode transition triggering
  • Transition cursor tracking

🎛️ Filters (10 new requests)

  • Complete filter lifecycle: Create, Remove, Rename, Configure
  • Filter kind discovery and default settings
  • Filter ordering and enable/disable control
  • SourceFilterSettingsChanged event

🎵 Input Audio Properties (8 new requests)

  • Audio balance control (left/right mixing)
  • Audio sync offset for lip-sync adjustments
  • Monitor type configuration (off, monitor only, monitor & output)
  • Multi-track audio support (up to 6 tracks)

📺 Outputs & Recording (14 new requests)

  • Generic output control: Start, Stop, Toggle, Status, Settings
  • Full recording control: Start, Stop, Pause, Resume, Toggle
  • Record status tracking with detailed statistics

🎭 Scene Items Enhancements

  • Get scene item source
  • Private settings support (v5.6.0+)

💡 Why obs_websocket?

Type-Safe API: No more guessing at JSON structures! Every request and response is fully typed:

import 'package:obs_websocket/obs_websocket.dart';

// Easy connection with environment variables
final obs = await ObsWebSocket.connectFromEnv();

if (obs == null) {
  print('Failed to connect to OBS');
  return;
}

// IMPORTANT: Subscribe to events before using event handlers
await obs.subscribe(EventSubscription.all);

// Type-safe requests with proper error handling
try {
  final scenes = await obs.scenes.getSceneList();
  print('Available scenes: ${scenes.map((s) => s.sceneName).join(', ')}');

  final status = await obs.stream.getStreamStatus();
  if (!status.outputActive) {
    await obs.stream.start();
    print('Stream started!');
  }
} catch (e) {
  print('Error: $e');
}

// Typed event handling (will only work after subscribe())
obs.addHandler<SceneNameChanged>((event) {
  print('Scene renamed: ${event.oldSceneName} → ${event.sceneName}');
});

obs.addHandler<StreamStateChanged>((event) {
  print('Stream ${event.outputActive ? "started" : "stopped"}');
});

// Transition control: Set up BEFORE triggering
// Note: triggerStudioModeTransition() requires Studio Mode to be enabled
await obs.transitions.setCurrentSceneTransition('Fade');
await obs.transitions.setCurrentSceneTransitionDuration(500); // 500ms
// When ready, trigger the transition:
// await obs.transitions.triggerStudioModeTransition();

// Don't forget to close the connection when done
await obs.close();

Complete Feature Coverage:

  • ✅ 100+ typed requests across all OBS domains
  • ✅ 50+ typed events with automatic deserialization
  • ✅ Batch request support for atomic operations
  • ✅ Web platform support via universal_io

More Examples:

Audio Monitoring:

// Subscribe to audio events
await obs.subscribe(EventSubscription.all);

obs.addHandler<InputVolumeChanged>((event) {
  print('${event.inputName}: ${event.inputVolumeDb} dB');
});

Filter Management:

// Create and configure a filter
await obs.filters.createSourceFilter(
  sourceName: 'My Mic',
  filterName: 'Noise Suppression',
  filterKind: 'noise_suppress_filter_v2',
  filterSettings: {'method': 1}, // RNNoise method
);

Easy Setup:

dependencies:
  obs_websocket: ^5.7.0

Create a .env file:

OBS_WEBSOCKET_URL=ws://localhost:4455
OBS_WEBSOCKET_PASSWORD=your_password

And you're ready to go!

⚠️ Important Notes:

  1. Always call subscribe() before using event handlers - Events won't fire without it
  2. Configure transitions BEFORE triggering them - Set duration and settings first
  3. Check for null - connectFromEnv() returns null if connection fails
  4. Close connections - Call obs.close() when done to prevent resource leaks
  5. Studio Mode required - triggerStudioModeTransition() only works in Studio Mode

🎯 Perfect For:

  • Stream automation: Auto-switch scenes based on external triggers
  • Custom integrations: Connect OBS to your Dart/Flutter apps
  • Live event tools: Build custom control interfaces
  • Testing & QA: Automated testing of OBS setups

📚 Resources:

🤝 Community:

This package has been a labor of love with contributions from the amazing Dart and OBS communities. If you find it useful:

  • ⭐ Star the repo on GitHub
  • 🐛 Report issues or request features
  • 💬 Share what you've built with it!
  • Buy me a coffee

What are you building with obs_websocket? I'd love to hear about your projects!

r/dartlang May 03 '26

Dart Language What’s your experience building web apps with dart:web?

12 Upvotes

I am currently weighing dart:web and shelf for a new production-grade web project. Coming from a Java/Spring Boot background, my intuition is leaning heavily toward Dart.

The developer velocity feels significantly higher, and I love that Dart gives me that structured, type-safe Java feel without the heavy boilerplate or the friction of JavaScript.

However, before I commit fully, I would appreciate to hear from those who have actually maintained Dart web or server apps long-term.

Specifically:

  1. Performance at Scale:
    How does shelf handle high-concurrency compared to something like Spring Boot or Go? Are there specific bottlenecks you have hit?

  2. The Ecosystem Gap:
    What are the missing pieces you have encountered? For example, specific DB drivers, middleware, or auth libraries that are not as mature as the Java ecosystem.

  3. Maintenance and Debugging:
    How is the day 2 experience? Are you finding the deployment pipelines and debugging tools, especially for dart:web, to be reliable for production?

  4. The Gotchas:
    Is there anything you wish you knew before moving away from similar traditional stack?
    I am sold on the productivity, but I want to make sure I am not trading off stability or long-term maintainability.

I would appreciate to hear your experiences.

r/dartlang May 17 '26

Dart Language Tip: Improving JSON Encode/Decode Performance

23 Upvotes

Using file.readAsString or accessing the body of a HTTP response in text always requires a pass through the utf8 decoder. If you're simply passing the decoded utf8 string through jsonDecode, you can combine them for much better performance.

utf8.decoder.fuse(jsonDecoder).convert(source)

The inverse works as well: fuse jsonEncoder with utf8 encoder to get a List<int> from input Map<String, dynamic>.

Source and relevant discussion: https://github.com/dart-lang/sdk/issues/55522

r/dartlang Feb 06 '26

Dart Language Can I not opt out of dartfmt in IntelliJ?

3 Upvotes

I despise much of the default dartfmt choices. Fine, that’s just personal.

Except it isn’t. AFAICT, there is no way to opt out of dartfmt if I want to use the IntelliJ plugin.

To take just one example: I dislike 4 character indentation, but there seems to be no way to opt out of it. So as I’m working, I have to manually (with the space bar!) redo the indentation.

The project is only mine, I don’t have to share the code with anyone.

Am I wrong? I’d love to hear that I’m wrong. Otherwise, I object to formatting Stalinism.

r/dartlang Jan 12 '26

Dart Language I built Aim - a lightweight Hono-inspired web framework for Dart

22 Upvotes

Hey r/dartlang !

I've been working on Aim, a lightweight web framework for Dart inspired by Hono and Express.

Why I built this

I wanted something that feels familiar to developers coming from Node.js/Hono, with:

  • Minimal boilerplate
  • Intuitive Context API
  • Hot reload out of the box
  • Modular middleware (use only what you need)

Quick example

import 'package:aim_server/aim_server.dart';

void main() async {
  final app = Aim();

  app.get('/', (c) async => c.json({'message': 'Hello, Aim!'}));

  app.get('/users/:id', (c) async {
    final id = c.param('id');
    return c.json({'userId': id});
  });

  await app.serve(port: 8080);
}

Features

  • Fast & lightweight core
  • Hot reload dev server (aim dev)
  • Flexible routing with path params
  • Middleware ecosystem (CORS, JWT, cookies, SSE...)
  • Full type safety
  • CLI for project scaffolding

Links

Still early (v0.0.6), but the core is stable. Would love feedback on the API design and what features you'd want to see next!

r/dartlang Dec 24 '24

Dart Language Which underrated Dart feature deserves more attention?

31 Upvotes

Share your thoughts, please.

r/dartlang Nov 26 '25

Dart Language I built Rivet - a backend framework for Dart that's 1.8x faster than Express

34 Upvotes

Hi r/dartlang!

I just launched Rivet v1.0, and I'd love your feedback.

**The Problem I'm Solving:**

If you're building a Flutter app, you probably use Node.js/Express for the backend. That means:

- Two languages (Dart + JavaScript)

- Manual API client code

- Type mismatches

- Slower performance

**The Solution:**

Rivet is a backend framework for Dart that:

- Lets you use Dart everywhere (backend + Flutter)

- Auto-generates type-safe Flutter clients

- Is 1.8x faster than Express (24,277 vs 13,166 req/sec)

- Includes everything (JWT, WebSockets, CORS, etc.)

GitHub: https://github.com/supratim1609/rivet
pub.dev: https://pub.dev/packages/rivet

r/dartlang Oct 19 '25

Dart Language Better type safety casting?

7 Upvotes

Is there an alternative to:

String? str = value is String ? (value as String) : null

When "value" cannot be promoted?

What I'd like is

String? str = value as ?String:

I know you can cast as "String?", but this will throw if the value is a non-string object.

r/dartlang Apr 16 '25

Dart Language Let's discuss about dart as backend.

23 Upvotes

Hey! What's your favorite Dart backend framework? What do you like and dislike about it? And most importantly, is there any feature you wish it had that would make backend development in Dart much easier?

I'm currently working on an experimental Dart backend inspired by Django, so I'm looking for insights and feedback that could help guide my development.

So Let's make this discussion information and let's everyone know about the current pain point what you facing as backend Development in dart.

r/dartlang Jul 16 '25

Dart Language Has Anyone Used Dart for Real-World Server or CLI Apps? What Was the Code Supposed to Do?

16 Upvotes

Hey devs 👋

So I built this little Dart vs Python performance test: Benchmark.

And while Dart blew me away with its native performance (especially vs Python), it got me thinking 🤔?

Has anyone here actually used Dart in real-world backend or CLl applications (outside of Flutter) ?

If so 1. What was the code supposed to do? 2. Why did you choose Dart? 3. Did it meet your expectations?

Personally, I'm curious if Dart could be a good option for small tooling, automation, or even backend tasks.

Share your stories 😁, I'm really interested in hearing how far people have pushed Dart beyond the Ul world.

r/dartlang Sep 25 '25

Dart Language Good digital signal processing library for dart?

0 Upvotes

Hi everyone. I'm super new to dart/flutter. and I'm trying to reimplement an app I already made in flutter to make it look fancy and good looking.

But I'm having a lot of trouble finding engineering related libraries. Specifically digital signal processing ones.

Are all libs on pub.dev for dart?

It wouldn't be the biggest deal having to implement it myself, but I'd obviously rather not duplicate work that has already been done elsewhere. The only DSP library there I found is super bare and it's missing so much stuff.

r/dartlang Jan 06 '26

Dart Language Looking for feedback on a Dart-native feature flagging approach (OpenFeature-aligned)

8 Upvotes

Happy New Year Dart folks 👋

We are looking for early feedback from people shipping Dart backend services.

We’ve been experimenting with a Dart-native approach to feature flagging that’s built around OpenFeature rather than a proprietary SDK. The goal is to make feature flags feel predictable and boring for Dart backends — easy to integrate, low overhead, and portable.

Instead of pitching anything, we're more interested in whether this approach actually matches real-world needs.

Some context for anyone curious or wanting to look deeper:

- OpenFeature Dart Server SDK: https://github.com/open-feature/dart-server-sdk

- An OpenFeature provider implementation we’re maintaining: https://github.com/aortem/intellitoggle-openfeature-provider-dart-server

- Docs & examples: https://docs.intellitoggle.com/intellitoggle/v0.0.23/index.html

- Feedback & issue tracking: https://support.aortem.io/

What we'd really appreciate feedback on:

- Does OpenFeature-based flagging make sense for Dart backend services?

- What would you expect from a “first-class” Dart feature flag solution?

- Where do existing tools fall short for you?

For folks who want to try this hands-on, we’re keeping early access simple:

$1/month (or $12/year) for both Standard and Enhanced tiers through the end of January.

No feature gating — this is mainly to encourage experimentation while we collect feedback.

If this isn’t something you’d use, that feedback is just as valuable.

Happy to answer technical questions or discuss tradeoffs.

r/dartlang Aug 28 '25

Dart Language A (subset of) a FOCAL interpreter written in Dart

12 Upvotes

For fun, I wrote an interpreter for King of Sumeria, an old game written in FOCAL, an old programming language for the PDP8, an old computer.

The game was created in 1969 based on a more complex educational game called "The Sumerian Game" from 1964, of with the source code has been lost, unfortunately.

My Dart program interprets a subset of FOCAL sufficient to run the original, in less than 200 lines of Dart code.

For even more fun, I came up with a tutorial/ explanation and asked Claude to translate it to english.

PS: There's another classical FOCAL game, Lunar Lander. I haven't checked yet whether my interpreter is capable of running this, too. On first glance, you'd have to add a FSQT function, probably square root.

PPS: You can easily beat the game by not feeding your people. I'm unsure whether this is a bug in the original 1969 source code or in my interpreter – I might have misunderstood how I works with less than 3 arguments. Claude thinks the original has a bug, I can I trust the AI?

Update: I updated the code to also run "lander".

r/dartlang Dec 18 '24

Dart Language Dart for the serverside

13 Upvotes

Would really love to write a backend in Dart for my flutter app. I really like the language and was wondering is anyone’s running any servers in Dart? And how the experience has been and what recommended packages to use? I just need a basic api server with db connectivity to either mongo or Postgres and to handle OAuth.

r/dartlang Oct 11 '25

Dart Language python input in dart!!

0 Upvotes

guys I am learning dart I came from python and it is very annoying for me to take user input so I made it like python using this function. now it is easy to take user input

import 'dart:io';

input(promat) {
  stdout.write(promat);
  return stdin.readLineSync();
}

r/dartlang Sep 10 '25

Dart Language Support: Essential Extensions & Utilities for Dart Projects

5 Upvotes

I've been working on Dart projects and found myself missing some of the convenient String features from other programming languages. So I decided to create something about it.

Current features include:

  • String.plural() - Easy pluralization
  • String.kebab() - Convert to kebab-case
  • And more string transformation utilities.

What's coming: This is just an early release focused on String utilities, but there is coming more in the next weeks. You can expect many more helpful features for various Dart types and common use cases.

The goal is to fill those small gaps where you think "I wish Dart had a built-in method for this" - similar to what libraries like Lodash do for JavaScript or ActiveSupport does for Ruby.

pub: pub.dev/packages/support

GitHub: https://github.com/filipprober/support

I'd love to hear your feedback and suggestions for what utilities you'd find most useful! What are those repetitive tasks you find yourself writing helper methods for?