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) {
|
void didUpdateWidget(ChannelListCore oldWidget) {
|
||||||
super.didUpdateWidget(oldWidget);
|
super.didUpdateWidget(oldWidget);
|
||||||
|
|
||||||
if (widget.filter?.toString() != oldWidget.filter?.toString() ||
|
if (jsonEncode(widget.filter) != jsonEncode(oldWidget.filter) ||
|
||||||
jsonEncode(widget.sort) != jsonEncode(oldWidget.sort) ||
|
jsonEncode(widget.sort) != jsonEncode(oldWidget.sort) ||
|
||||||
widget.state != oldWidget.state ||
|
widget.state != oldWidget.state ||
|
||||||
widget.watch != oldWidget.watch ||
|
widget.watch != oldWidget.watch ||
|
||||||
widget.presence != oldWidget.presence ||
|
widget.presence != oldWidget.presence ||
|
||||||
widget.messageLimit != oldWidget.messageLimit ||
|
widget.messageLimit != oldWidget.messageLimit ||
|
||||||
widget.memberLimit != oldWidget.memberLimit ||
|
widget.memberLimit != oldWidget.memberLimit ||
|
||||||
widget.pagination.toJson().toString() !=
|
jsonEncode(widget.pagination) != jsonEncode(oldWidget.pagination)) {
|
||||||
oldWidget.pagination.toJson().toString()) {
|
|
||||||
loadData();
|
loadData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -185,13 +185,13 @@ class MessageSearchListCoreState extends State<MessageSearchListCore> {
|
|||||||
@override
|
@override
|
||||||
void didUpdateWidget(MessageSearchListCore oldWidget) {
|
void didUpdateWidget(MessageSearchListCore oldWidget) {
|
||||||
super.didUpdateWidget(oldWidget);
|
super.didUpdateWidget(oldWidget);
|
||||||
if (widget.filters.toString() != oldWidget.filters.toString() ||
|
if (jsonEncode(widget.filters) != jsonEncode(oldWidget.filters) ||
|
||||||
jsonEncode(widget.sortOptions) != jsonEncode(oldWidget.sortOptions) ||
|
jsonEncode(widget.sortOptions) != jsonEncode(oldWidget.sortOptions) ||
|
||||||
widget.messageQuery?.toString() != oldWidget.messageQuery?.toString() ||
|
widget.messageQuery != oldWidget.messageQuery ||
|
||||||
widget.messageFilters?.toString() !=
|
jsonEncode(widget.messageFilters) !=
|
||||||
oldWidget.messageFilters?.toString() ||
|
jsonEncode(oldWidget.messageFilters) ||
|
||||||
widget.paginationParams.toJson().toString() !=
|
jsonEncode(widget.paginationParams) !=
|
||||||
oldWidget.paginationParams.toJson().toString()) {
|
jsonEncode(oldWidget.paginationParams)) {
|
||||||
loadData();
|
loadData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -209,11 +209,10 @@ class UserListCoreState extends State<UserListCore>
|
|||||||
@override
|
@override
|
||||||
void didUpdateWidget(UserListCore oldWidget) {
|
void didUpdateWidget(UserListCore oldWidget) {
|
||||||
super.didUpdateWidget(oldWidget);
|
super.didUpdateWidget(oldWidget);
|
||||||
if (widget.filter?.toString() != oldWidget.filter?.toString() ||
|
if (jsonEncode(widget.filter) != jsonEncode(oldWidget.filter) ||
|
||||||
jsonEncode(widget.sort) != jsonEncode(oldWidget.sort) ||
|
jsonEncode(widget.sort) != jsonEncode(oldWidget.sort) ||
|
||||||
widget.presence != oldWidget.presence ||
|
widget.presence != oldWidget.presence ||
|
||||||
widget.pagination.toJson().toString() !=
|
jsonEncode(widget.pagination) != jsonEncode(oldWidget.pagination)) {
|
||||||
oldWidget.pagination.toJson().toString()) {
|
|
||||||
loadData();
|
loadData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import 'package:stream_chat_flutter_core/stream_chat_flutter_core.dart';
|
|||||||
import 'matchers/get_message_response_matcher.dart';
|
import 'matchers/get_message_response_matcher.dart';
|
||||||
import 'mocks.dart';
|
import 'mocks.dart';
|
||||||
|
|
||||||
const testFilter = Filter.custom(operator: '\$test', value: 'testValue');
|
const testFilter = Filter.custom(key: 'test', value: 'testValue');
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
List<GetMessageResponse> _generateMessages({
|
List<GetMessageResponse> _generateMessages({
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import 'package:stream_chat_flutter_core/stream_chat_flutter_core.dart';
|
|||||||
|
|
||||||
import 'mocks.dart';
|
import 'mocks.dart';
|
||||||
|
|
||||||
const testFilter = Filter.custom(operator: '\$test', value: 'testValue');
|
const testFilter = Filter.custom(key: 'test', value: 'testValue');
|
||||||
const testMessageFilter = Filter.custom(operator: '\$test', value: 'testValue');
|
const testMessageFilter = Filter.custom(key: 'test', value: 'testValue');
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
List<GetMessageResponse> _generateMessages({
|
List<GetMessageResponse> _generateMessages({
|
||||||
|
|||||||
Reference in New Issue
Block a user