Merge branch 'develop' into hotfix/messageHighlight

This commit is contained in:
Salvatore Giordano
2021-10-13 10:22:04 +02:00
committed by GitHub
3 changed files with 22 additions and 14 deletions
@@ -5,6 +5,7 @@
🐞 Fixed 🐞 Fixed
- Fixed message highlight animation alignment in `MessageListView` - Fixed message highlight animation alignment in `MessageListView`
- [[#491]](https://github.com/GetStream/stream-chat-flutter/issues/491): Fix `MediaListView` showing media in wrong order.
✅ Added ✅ Added
@@ -1,5 +1,6 @@
import 'dart:ui' as ui; import 'dart:ui' as ui;
import 'package:collection/collection.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
@@ -145,21 +146,24 @@ class _MediaListViewState extends State<MediaListView> {
} }
Future<void> _getMedia() async { Future<void> _getMedia() async {
final assetList = await PhotoManager.getAssetPathList().then((value) { final assetList = (await PhotoManager.getAssetPathList(
if (value.isNotEmpty) { filterOption: FilterOptionGroup(
return value.singleWhere((element) => element.isAll); orders: [
} const OrderOption(
}); // ignore: avoid_redundant_argument_values
type: OrderOptionType.createDate,
),
],
),
onlyAll: true,
))
.firstOrNull;
if (assetList == null) { final media = await assetList?.getAssetListPaged(_currentPage, 50);
return;
}
final media = await assetList.getAssetListPaged(_currentPage, 50); if (media?.isNotEmpty == true) {
if (media.isNotEmpty) {
setState(() { setState(() {
_media.addAll(media); _media.addAll(media!);
}); });
} }
++_currentPage; ++_currentPage;
@@ -118,8 +118,11 @@ class MessageListViewThemeData with Diagnosticable {
properties properties
..add(ColorProperty('backgroundColor', backgroundColor)) ..add(ColorProperty('backgroundColor', backgroundColor))
..add( ..add(
DiagnosticsProperty<DecorationImage>('backgroundImage', backgroundImage, DiagnosticsProperty<DecorationImage>(
defaultValue: null), 'backgroundImage',
backgroundImage,
defaultValue: null,
),
); );
} }
} }