add message configuration properties to message list view
This commit is contained in:
@@ -63,6 +63,9 @@ class MessageListView extends StatefulWidget {
|
|||||||
this.threadBuilder,
|
this.threadBuilder,
|
||||||
this.onThreadTap,
|
this.onThreadTap,
|
||||||
this.showOtherMessageUsername = false,
|
this.showOtherMessageUsername = false,
|
||||||
|
this.showVideoFullScreen = true,
|
||||||
|
this.onMentionTap,
|
||||||
|
this.onMessageActions,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
/// Function used to build a custom message widget
|
/// Function used to build a custom message widget
|
||||||
@@ -84,6 +87,15 @@ class MessageListView extends StatefulWidget {
|
|||||||
/// If true show the other users username next to the timestamp of the message
|
/// If true show the other users username next to the timestamp of the message
|
||||||
final bool showOtherMessageUsername;
|
final bool showOtherMessageUsername;
|
||||||
|
|
||||||
|
/// True if the video player will allow fullscreen mode
|
||||||
|
final bool showVideoFullScreen;
|
||||||
|
|
||||||
|
/// Function called on message mention tap
|
||||||
|
final void Function(User) onMentionTap;
|
||||||
|
|
||||||
|
/// Function called on message long press
|
||||||
|
final Function(BuildContext, Message) onMessageActions;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_MessageListViewState createState() => _MessageListViewState();
|
_MessageListViewState createState() => _MessageListViewState();
|
||||||
}
|
}
|
||||||
@@ -138,6 +150,11 @@ class _MessageListViewState extends State<MessageListView> {
|
|||||||
nextMessage: null,
|
nextMessage: null,
|
||||||
onThreadTap: _onThreadTap,
|
onThreadTap: _onThreadTap,
|
||||||
isParent: true,
|
isParent: true,
|
||||||
|
showVideoFullScreen: widget.showVideoFullScreen,
|
||||||
|
showOtherMessageUsername:
|
||||||
|
widget.showOtherMessageUsername,
|
||||||
|
onMentionTap: widget.onMentionTap,
|
||||||
|
onMessageActions: widget.onMessageActions,
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 32),
|
padding: const EdgeInsets.symmetric(horizontal: 32),
|
||||||
@@ -197,6 +214,9 @@ class _MessageListViewState extends State<MessageListView> {
|
|||||||
nextMessage: nextMessage,
|
nextMessage: nextMessage,
|
||||||
onThreadTap: _onThreadTap,
|
onThreadTap: _onThreadTap,
|
||||||
showOtherMessageUsername: widget.showOtherMessageUsername,
|
showOtherMessageUsername: widget.showOtherMessageUsername,
|
||||||
|
showVideoFullScreen: widget.showVideoFullScreen,
|
||||||
|
onMentionTap: widget.onMentionTap,
|
||||||
|
onMessageActions: widget.onMessageActions,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -330,6 +350,10 @@ class _MessageListViewState extends State<MessageListView> {
|
|||||||
message: message,
|
message: message,
|
||||||
nextMessage: nextMessage,
|
nextMessage: nextMessage,
|
||||||
onThreadTap: _onThreadTap,
|
onThreadTap: _onThreadTap,
|
||||||
|
showVideoFullScreen: widget.showVideoFullScreen,
|
||||||
|
showOtherMessageUsername: widget.showOtherMessageUsername,
|
||||||
|
onMentionTap: widget.onMentionTap,
|
||||||
|
onMessageActions: widget.onMessageActions,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -365,6 +389,10 @@ class _MessageListViewState extends State<MessageListView> {
|
|||||||
message: message,
|
message: message,
|
||||||
nextMessage: null,
|
nextMessage: null,
|
||||||
onThreadTap: _onThreadTap,
|
onThreadTap: _onThreadTap,
|
||||||
|
showVideoFullScreen: widget.showVideoFullScreen,
|
||||||
|
showOtherMessageUsername: widget.showOtherMessageUsername,
|
||||||
|
onMentionTap: widget.onMentionTap,
|
||||||
|
onMessageActions: widget.onMessageActions,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user