Skip to content
pubscout

dart_webrtc

1.8.2, released 3 months ago by flutter-webrtc.org

WebRTC API wrapper for Dart, enabling browser-based audio/video communication.

WASM-ready
$ flutter pub add dart_webrtc
Source repository

What it does

Provides a Dart-friendly interface to the browser's WebRTC API, exposing peer connections, media streams, data channels, and E2EE support. It wraps the native JS objects using dart/js for cross-browser compatibility.

AI-written summary of version 1.8.2, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need real-time audio/video or data communication in a Flutter web app.
  • You want to use WebRTC without writing JavaScript interop yourself.
  • You need E2EE or advanced media stream handling in the browser.

Skip it when

  • You are targeting mobile or desktop platforms only; this package is web-only.
  • You need a native WebRTC implementation for iOS/Android; use flutter-webrtc instead.

Strengths

  • Pure Dart wrapper, no native plugins required.
  • Supports E2EE and advanced WebRTC features like priority control and data channel buffering.
  • Regularly updated with bug fixes and new browser support.

Weaknesses

  • Web-only; not usable on mobile or desktop.
  • Requires manual compilation of the E2EE worker for wasm compatibility.
  • Relies on dart/js, so no type safety for all JS interop.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
6

Add dependency in pubspec, import package, no additional build steps needed.

import 'package:dart_webrtc/dart_webrtc.dart';

final pc = RTCPeerConnection();
await pc.createOffer();
await pc.setLocalDescription();

Alternatives

Packages that do the same job and could replace dart_webrtc.

Works with

Packages commonly used together with dart_webrtc: ones it builds on, ones built on it, and its own family.