Created
June 21, 2022 11:15
-
-
Save velotiotech/07a3c636efaff55c194fe31e9ba1607d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyHomePage extends StatelessWidget { @override Widget build(BuildContext) { return Query( options: QueryOptions( document: gql(readCounters), variables: { 'counterId': 23, }, pollInterval: Duration(seconds: 10), ), builder: (QueryResult result, { VoidCallback refetch, FetchMore fetchMore }) { if (result.hasException) { return Text(result.exception.toString()); } if (result.isLoading) { return Text('Loading'); } // it can be either Map or List List counters = result.data['counter']; return ListView.builder( itemCount: repositories.length, itemBuilder: (context, index) { return Text(counters\[index\]['name']); }); },) }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment