Search code examples
flutterdartwebrtcdart-pubdart-packages

What is the difference between these packages?


I am looking at functionality for Dart/Flutter. Learning they do not have HTTP3/QUIC yet I have opted for WebRTC instead. I understand Dart is the language and Flutter is just a framework on top of the language but I am confused as there are two packages that seem to do the same thing, are even published by the same account but are still different packages. Can someone explain why?

  • There is flutter_webrtc which seems to be designed for Flutter (and not Dart?). It says in the description it does support Web but at the top, as I'm reading it now, it is not listed as supporting Web. Why this discrepancy? Maybe just a typo?
  • Then there is dart_webrtc which seems to be designed for Dart and I'm assuming therefore also usable in Flutter. This one says it is usable for Web at the top but doesn't mention support for any other platform.

They're even published by the same account: flutter-webrtc.org why then are there two separate packages one of them is confused if it covers Web and the other covers nothing but Web? I'm confused. Why should one pick one over the other?


Solution

  • Actually the package flutter_webrtc is the one which you should use because this package has support for mobile, desktop platforms and web and this package utilises the dart_webrtc package to implement the support for running webrtc in flutter for web. In the readme of the dart_webrtc package is specifically writes that:

    Use the dart/js library to re-wrap the webrtc js interface of the browser, to adapted common browsers. This library will be used for flutter-webrtc for flutter web plugin.

    If you are developing a cross platform application or even a flutter web application you should use the flutter_webrtc package. In simpler terms flutter_webrtc implements support for mobile and desktop platform but utilises dart_webrtc package to provide support for web application (inherits).