|
| 1 | +import 'package:flutter/material.dart'; |
| 2 | +import 'package:stream_chat_flutter/stream_chat_flutter.dart'; |
| 3 | + |
| 4 | +/// A full screen media widget |
| 5 | +@Deprecated('Use StreamFullScreenMedia instead.') |
| 6 | +class StreamFullScreenMediaBuilder extends StatelessWidget { |
| 7 | + /// Instantiate a new StreamFullScreenMediaBuilder |
| 8 | + const StreamFullScreenMediaBuilder({ |
| 9 | + super.key, |
| 10 | + required this.mediaAttachmentPackages, |
| 11 | + required this.startIndex, |
| 12 | + required this.userName, |
| 13 | + this.onShowMessage, |
| 14 | + this.onReplyMessage, |
| 15 | + this.attachmentActionsModalBuilder, |
| 16 | + this.autoplayVideos = false, |
| 17 | + }); |
| 18 | + |
| 19 | + /// The url of the image |
| 20 | + final List<StreamAttachmentPackage> mediaAttachmentPackages; |
| 21 | + |
| 22 | + /// First index of media shown |
| 23 | + final int startIndex; |
| 24 | + |
| 25 | + /// Username of sender |
| 26 | + final String userName; |
| 27 | + |
| 28 | + /// Callback for when show message is tapped |
| 29 | + final ShowMessageCallback? onShowMessage; |
| 30 | + |
| 31 | + /// Callback for when reply message is tapped |
| 32 | + final ReplyMessageCallback? onReplyMessage; |
| 33 | + |
| 34 | + /// Widget builder for attachment actions modal |
| 35 | + /// [defaultActionsModal] is the default [AttachmentActionsModal] config |
| 36 | + /// Use [defaultActionsModal.copyWith] to easily customize it |
| 37 | + final AttachmentActionsBuilder? attachmentActionsModalBuilder; |
| 38 | + |
| 39 | + /// Auto-play videos when page is opened |
| 40 | + final bool autoplayVideos; |
| 41 | + |
| 42 | + @override |
| 43 | + Widget build(BuildContext context) { |
| 44 | + return StreamFullScreenMedia( |
| 45 | + mediaAttachmentPackages: mediaAttachmentPackages, |
| 46 | + startIndex: startIndex, |
| 47 | + userName: userName, |
| 48 | + onShowMessage: onShowMessage, |
| 49 | + onReplyMessage: onReplyMessage, |
| 50 | + attachmentActionsModalBuilder: attachmentActionsModalBuilder, |
| 51 | + autoplayVideos: autoplayVideos, |
| 52 | + ); |
| 53 | + } |
| 54 | +} |
0 commit comments