diff --git a/lib/home.dart b/lib/home.dart index a2bc529..acab5e6 100644 --- a/lib/home.dart +++ b/lib/home.dart @@ -100,17 +100,17 @@ class _HistoryListScreenState extends State { children: [ Query( options: QueryOptions( - documentNode: gql(getHistory), + document: gql(getHistory), variables: { 'pubkey': pubkey, // pubkey, 'number': nRepositories, // set cursor to null so as to start at the beginning - // 'cursor': 0 + // 'cursor': null }, ), builder: (QueryResult result, {refetch, FetchMore fetchMore}) { - if (result.loading && result.data == null) { + if (result.isLoading && result.data == null) { return const Center( child: CircularProgressIndicator(), ); @@ -167,7 +167,7 @@ class _HistoryListScreenState extends State { ..addListener(() { if (_scrollController.position.pixels == _scrollController.position.maxScrollExtent) { - if (!result.loading) { + if (!result.isLoading) { print('DEBUG NULL scrollController: ' + fetchMoreCursor); fetchMore(opts); @@ -245,7 +245,7 @@ class _HistoryListScreenState extends State { ), ), ), - if (result.loading) + if (result.isLoading) Row( mainAxisAlignment: MainAxisAlignment.center, children: [ @@ -310,12 +310,11 @@ class _HistoryListScreenState extends State { // var tata = _scrollController; - // setState(() { - // print('setPubkey: ' + pubkey); - // pubkey = pubkey; - // // fetchMoreCursor = fetchMoreCursor; - // titi = 'lourd'; - // }); + setState(() { + print('setPubkey: ' + pubkey); + pubkey = pubkey; + // // fetchMoreCursor = fetchMoreCursor; + }); return pubkey; } else { diff --git a/lib/main.dart b/lib/main.dart index 59d00b3..bec1bed 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -13,12 +13,12 @@ class Gecko extends StatelessWidget { @override Widget build(BuildContext context) { final _httpLink = HttpLink( - uri: 'https://g1.librelois.fr/gva', + 'https://g1.librelois.fr/gva', ); final _client = ValueNotifier( GraphQLClient( - cache: InMemoryCache(), + cache: GraphQLCache(), link: _httpLink, ), ); diff --git a/pubspec.lock b/pubspec.lock index 5239b57..fb835d8 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -63,7 +63,7 @@ packages: name: connectivity url: "https://pub.dartlang.org" source: hosted - version: "0.4.9+5" + version: "2.0.2" connectivity_for_web: dependency: transitive description: @@ -163,6 +163,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.12.4" + gql_dedupe_link: + dependency: transitive + description: + name: gql_dedupe_link + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.10" gql_dio_link: dependency: "direct main" description: @@ -170,6 +177,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.0.4" + gql_error_link: + dependency: transitive + description: + name: gql_error_link + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.1-alpha+1601131172858" gql_exec: dependency: "direct main" description: @@ -177,6 +191,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.2.5" + gql_http_link: + dependency: transitive + description: + name: gql_http_link + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.2" gql_link: dependency: "direct main" description: @@ -184,20 +205,34 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.3.1" + gql_transform_link: + dependency: transitive + description: + name: gql_transform_link + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.5" graphql: dependency: transitive description: name: graphql url: "https://pub.dartlang.org" source: hosted - version: "3.1.0" + version: "4.0.0-beta.5" graphql_flutter: dependency: "direct main" description: name: graphql_flutter url: "https://pub.dartlang.org" source: hosted - version: "3.1.0" + version: "4.0.0-beta.5" + hive: + dependency: transitive + description: + name: hive + url: "https://pub.dartlang.org" + source: hosted + version: "1.4.4+1" http: dependency: transitive description: @@ -268,13 +303,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.3.0-nullsafety.3" - mime: + normalize: dependency: transitive description: - name: mime + name: normalize url: "https://pub.dartlang.org" source: hosted - version: "0.9.7" + version: "0.4.5" path: dependency: transitive description: @@ -373,13 +408,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.2.21" - quiver: - dependency: transitive - description: - name: quiver - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.5" rxdart: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 66dacaa..dc05e71 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -34,7 +34,7 @@ dependencies: intl: flutter_launcher_icons: "^0.8.0" infinite_scroll_pagination: ^2.2.3 - graphql_flutter: ^3.0.1 + graphql_flutter: ^4.0.0-beta.5 #^3.1.0 flutter_icons: