add paginationLimit to message list core and ui package

This commit is contained in:
Salvatore Giordano
2021-07-19 12:05:57 +02:00
parent 4f3c44f6f7
commit f50ea0bac4
4 changed files with 42 additions and 8 deletions
@@ -2309,6 +2309,7 @@ class __PickerWidgetState extends State<_PickerWidget> {
return InkWell(
onTap: () async {
print('on tap');
PhotoManager.openSetting();
},
child: Container(
@@ -166,11 +166,15 @@ class MessageListView extends StatefulWidget {
this.showFloatingDateDivider = true,
this.threadSeparatorBuilder,
this.messageListController,
this.paginationLimit = 20,
}) : super(key: key);
/// Function used to build a custom message widget
final MessageBuilder? messageBuilder;
/// Limit used during pagination
final int paginationLimit;
/// Function used to build a custom system message widget
final SystemMessageBuilder? systemMessageBuilder;
@@ -328,6 +332,7 @@ class _MessageListViewState extends State<MessageListView> {
@override
Widget build(BuildContext context) => MessageListCore(
paginationLimit: widget.paginationLimit,
messageFilter: widget.messageFilter,
loadingBuilder: widget.loadingBuilder ??
(context) => const Center(
@@ -640,7 +645,9 @@ class _MessageListViewState extends State<MessageListView> {
);
Future<void> _paginateData(
StreamChannelState? channel, QueryDirection direction) =>
StreamChannelState? channel,
QueryDirection direction,
) =>
_messageListController.paginateData!(direction: direction);
int? _getTopElementIndex(Iterable<ItemPosition> values) {