feat: add mutation and mutation builder with example
This commit is contained in:
@@ -77,8 +77,10 @@ class _QueryBuilderState<DataType, ErrorType, KeyType>
|
||||
jsonConfig: widget.jsonConfig,
|
||||
);
|
||||
|
||||
dataSubscription = query!.dataStream.listen(widget.onData);
|
||||
errorSubscription = query!.errorStream.listen(widget.onError);
|
||||
if (widget.onData != null)
|
||||
dataSubscription = query!.dataStream.listen(widget.onData);
|
||||
if (widget.onData != null)
|
||||
errorSubscription = query!.errorStream.listen(widget.onError);
|
||||
|
||||
removeListener = query!.addListener(update);
|
||||
});
|
||||
@@ -123,11 +125,13 @@ class _QueryBuilderState<DataType, ErrorType, KeyType>
|
||||
}
|
||||
if (oldWidget.onData != widget.onData) {
|
||||
dataSubscription?.cancel();
|
||||
dataSubscription = query!.dataStream.listen(widget.onData);
|
||||
if (widget.onData != null)
|
||||
dataSubscription = query!.dataStream.listen(widget.onData);
|
||||
}
|
||||
if (oldWidget.onError != widget.onError) {
|
||||
errorSubscription?.cancel();
|
||||
errorSubscription = query!.errorStream.listen(widget.onError);
|
||||
if (widget.onError != null)
|
||||
errorSubscription = query!.errorStream.listen(widget.onError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user