StreamFullScreenMediaBuilder constructor

const StreamFullScreenMediaBuilder({
  1. Key? key,
  2. required List<StreamAttachmentPackage> mediaAttachmentPackages,
  3. required int startIndex,
  4. required String userName,
  5. ShowMessageCallback? onShowMessage,
  6. ReplyMessageCallback? onReplyMessage,
  7. AttachmentActionsBuilder? attachmentActionsModalBuilder,
  8. bool autoplayVideos = false,
})

A wrapper widget for conditionally providing the proper StreamFullScreenMedia widget when writing an application that targets all available Flutter platforms (Android, iOS, macOS, Windows, Linux, & Web).

This is required because:

  • package:video_player and package:chewie do not support macOS, Windows, & Linux, but do support Android, iOS, & Web.
  • package:dart_vlc does support macOS, Windows, & Linux via FFI. This has the unfortunate consequence of not supporting Web.

This widget makes use of dart's conditional imports to ensure that Stream's desktop implementation of StreamFullScreenMedia is not imported when building applications that target web. Additionally, this widget ensures that applications targeting mobile platforms do not build the version of StreamFullScreenMedia that targets desktop platforms (even though package:dart_vlc technically supports iOS).

Implementation

const StreamFullScreenMediaBuilder({
  super.key,
  required this.mediaAttachmentPackages,
  required this.startIndex,
  required this.userName,
  this.onShowMessage,
  this.onReplyMessage,
  this.attachmentActionsModalBuilder,
  this.autoplayVideos = false,
});