Merge remote-tracking branch 'origin/develop' into feat/localization

This commit is contained in:
xsahil03x
2021-07-22 17:19:10 +05:30
14 changed files with 108 additions and 30 deletions
@@ -166,11 +166,23 @@ class MessageListView extends StatefulWidget {
this.showFloatingDateDivider = true,
this.threadSeparatorBuilder,
this.messageListController,
this.reverse = true,
this.paginationLimit = 20,
}) : super(key: key);
/// Function used to build a custom message widget
final MessageBuilder? messageBuilder;
/// Whether the view scrolls in the reading direction.
///
/// Defaults to true.
///
/// See [ScrollView.reverse].
final bool reverse;
/// Limit used during pagination
final int paginationLimit;
/// Function used to build a custom system message widget
final SystemMessageBuilder? systemMessageBuilder;
@@ -329,6 +341,7 @@ class _MessageListViewState extends State<MessageListView> {
@override
Widget build(BuildContext context) => MessageListCore(
paginationLimit: widget.paginationLimit,
messageFilter: widget.messageFilter,
loadingBuilder: widget.loadingBuilder ??
(context) => const Center(
@@ -446,7 +459,7 @@ class _MessageListViewState extends State<MessageListView> {
initialAlignment: initialAlignment ?? 0,
physics: widget.scrollPhysics,
itemScrollController: _scrollController,
reverse: true,
reverse: widget.reverse,
addAutomaticKeepAlives: false,
itemCount: itemCount,
@@ -622,7 +635,8 @@ class _MessageListViewState extends State<MessageListView> {
}
Positioned _buildFloatingDateDivider(int itemCount) => Positioned(
top: 20,
top: widget.reverse ? 20 : null,
bottom: widget.reverse ? null : 20,
left: 0,
right: 0,
child: BetterStreamBuilder<Iterable<ItemPosition>>(
@@ -656,7 +670,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) {
@@ -716,9 +732,13 @@ class _MessageListViewState extends State<MessageListView> {
);
}
},
child: StreamSvgIcon.down(
color: _streamTheme.colorTheme.textHighEmphasis,
),
child: widget.reverse
? StreamSvgIcon.down(
color: _streamTheme.colorTheme.textHighEmphasis,
)
: StreamSvgIcon.up(
color: _streamTheme.colorTheme.textHighEmphasis,
),
),
if (showUnreadCount)
Positioned(
@@ -37,6 +37,18 @@ class StreamSvgIcon extends StatelessWidget {
height: size,
);
/// [StreamSvgIcon] type
factory StreamSvgIcon.up({
double? size,
Color? color,
}) =>
StreamSvgIcon(
assetName: 'Icon_up.svg',
color: color,
width: size,
height: size,
);
/// [StreamSvgIcon] type
factory StreamSvgIcon.attach({
double? size,