fix(core): match oldWidget objects using jsonEncode
Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
@@ -214,15 +214,14 @@ class ChannelListCoreState extends State<ChannelListCore> {
|
||||
void didUpdateWidget(ChannelListCore oldWidget) {
|
||||
super.didUpdateWidget(oldWidget);
|
||||
|
||||
if (widget.filter?.toString() != oldWidget.filter?.toString() ||
|
||||
if (jsonEncode(widget.filter) != jsonEncode(oldWidget.filter) ||
|
||||
jsonEncode(widget.sort) != jsonEncode(oldWidget.sort) ||
|
||||
widget.state != oldWidget.state ||
|
||||
widget.watch != oldWidget.watch ||
|
||||
widget.presence != oldWidget.presence ||
|
||||
widget.messageLimit != oldWidget.messageLimit ||
|
||||
widget.memberLimit != oldWidget.memberLimit ||
|
||||
widget.pagination.toJson().toString() !=
|
||||
oldWidget.pagination.toJson().toString()) {
|
||||
jsonEncode(widget.pagination) != jsonEncode(oldWidget.pagination)) {
|
||||
loadData();
|
||||
}
|
||||
|
||||
|
||||
@@ -185,13 +185,13 @@ class MessageSearchListCoreState extends State<MessageSearchListCore> {
|
||||
@override
|
||||
void didUpdateWidget(MessageSearchListCore oldWidget) {
|
||||
super.didUpdateWidget(oldWidget);
|
||||
if (widget.filters.toString() != oldWidget.filters.toString() ||
|
||||
if (jsonEncode(widget.filters) != jsonEncode(oldWidget.filters) ||
|
||||
jsonEncode(widget.sortOptions) != jsonEncode(oldWidget.sortOptions) ||
|
||||
widget.messageQuery?.toString() != oldWidget.messageQuery?.toString() ||
|
||||
widget.messageFilters?.toString() !=
|
||||
oldWidget.messageFilters?.toString() ||
|
||||
widget.paginationParams.toJson().toString() !=
|
||||
oldWidget.paginationParams.toJson().toString()) {
|
||||
widget.messageQuery != oldWidget.messageQuery ||
|
||||
jsonEncode(widget.messageFilters) !=
|
||||
jsonEncode(oldWidget.messageFilters) ||
|
||||
jsonEncode(widget.paginationParams) !=
|
||||
jsonEncode(oldWidget.paginationParams)) {
|
||||
loadData();
|
||||
}
|
||||
|
||||
|
||||
@@ -209,11 +209,10 @@ class UserListCoreState extends State<UserListCore>
|
||||
@override
|
||||
void didUpdateWidget(UserListCore oldWidget) {
|
||||
super.didUpdateWidget(oldWidget);
|
||||
if (widget.filter?.toString() != oldWidget.filter?.toString() ||
|
||||
if (jsonEncode(widget.filter) != jsonEncode(oldWidget.filter) ||
|
||||
jsonEncode(widget.sort) != jsonEncode(oldWidget.sort) ||
|
||||
widget.presence != oldWidget.presence ||
|
||||
widget.pagination.toJson().toString() !=
|
||||
oldWidget.pagination.toJson().toString()) {
|
||||
jsonEncode(widget.pagination) != jsonEncode(oldWidget.pagination)) {
|
||||
loadData();
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:stream_chat_flutter_core/stream_chat_flutter_core.dart';
|
||||
import 'matchers/get_message_response_matcher.dart';
|
||||
import 'mocks.dart';
|
||||
|
||||
const testFilter = Filter.custom(operator: '\$test', value: 'testValue');
|
||||
const testFilter = Filter.custom(key: 'test', value: 'testValue');
|
||||
|
||||
void main() {
|
||||
List<GetMessageResponse> _generateMessages({
|
||||
|
||||
@@ -6,8 +6,8 @@ import 'package:stream_chat_flutter_core/stream_chat_flutter_core.dart';
|
||||
|
||||
import 'mocks.dart';
|
||||
|
||||
const testFilter = Filter.custom(operator: '\$test', value: 'testValue');
|
||||
const testMessageFilter = Filter.custom(operator: '\$test', value: 'testValue');
|
||||
const testFilter = Filter.custom(key: 'test', value: 'testValue');
|
||||
const testMessageFilter = Filter.custom(key: 'test', value: 'testValue');
|
||||
|
||||
void main() {
|
||||
List<GetMessageResponse> _generateMessages({
|
||||
|
||||
Reference in New Issue
Block a user