Open
Description
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(),
body: GraphQLProvider(
client: client,
child: Subscription(operationName, subscription, builder: ({
bool loading,
dynamic payload,
dynamic error,
}) {
if (loading==true) {
return LoadingAnimation();
}
print("Subscription payload: $payload");
return Query(
options: QueryOptions(
document: playDuel,
variables: {},
pollInterval: 10000,
),
builder: (QueryResult result, {VoidCallback refetch}) {
if (result.errors != null) {
print(result.errors);
}
if (result.loading) {
return LoadingAnimation();
}
print(result.data['playDuel']);
return Container();
});
}),
),
);
}
this loading function do not gives me live update about the connection.
it always returns true.
So all i want is to get data printed by Subscription widget on console get stored in some variable.