diff --git a/lib/api.dart b/lib/api.dart index b76e935271b7394e5790ac24ddd49541f2f01b87..93170bc1768bab9acdd5aa35e5a4b104e2af156e 100644 --- a/lib/api.dart +++ b/lib/api.dart @@ -7,7 +7,8 @@ import "package:gql_link/gql_link.dart"; import 'package:intl/intl.dart'; // Configure node -const graphqlEndpoint = "https://g1.librelois.fr/gva"; +// const graphqlEndpoint = "https://g1.librelois.fr/gva"; +const graphqlEndpoint = 'http://127.0.0.1:10060/gva'; // // Check node connection // Future getHttp() async { diff --git a/lib/functions.dart b/lib/functions.dart deleted file mode 100644 index 8b137891791fe96927ad78e64b0aad7bded08bdc..0000000000000000000000000000000000000000 --- a/lib/functions.dart +++ /dev/null @@ -1 +0,0 @@ - diff --git a/lib/home.dart b/lib/home.dart index acab5e67cff0391660d58c17b0bbfcc4476e17b9..7ae2b59a4e86e2b6b8ad29a5c7fd4cf224988ceb 100644 --- a/lib/home.dart +++ b/lib/home.dart @@ -5,7 +5,7 @@ import 'dart:ui'; import 'package:permission_handler/permission_handler.dart'; import 'package:qrscan/qrscan.dart' as scanner; import 'api.dart'; -import "package:dio/dio.dart"; +// import "package:dio/dio.dart"; import 'package:graphql_flutter/graphql_flutter.dart'; import 'query.dart'; @@ -15,13 +15,14 @@ class HistoryListScreen extends StatefulWidget { _HistoryListScreenState createState() => _HistoryListScreenState(); } -class _HistoryListScreenState extends State<HistoryListScreen> { +class _HistoryListScreenState extends State<HistoryListScreen> + with ChangeNotifier { Uint8List bytes = Uint8List(0); TextEditingController _outputPubkey; TextEditingController _outputBalance; final nRepositories = 3; var pubkey = ''; - var titi = 'totooooooop'; + bool isBuilding = true; // Just for debug ScrollController _scrollController = new ScrollController(); @override @@ -42,7 +43,7 @@ class _HistoryListScreenState extends State<HistoryListScreen> { // var pubkey = ''; print('Build state : ' + pubkey); - print(titi); + print('isBuilding: ' + isBuilding.toString()); return MaterialApp( home: Scaffold( backgroundColor: Colors.grey[300], @@ -278,11 +279,11 @@ class _HistoryListScreenState extends State<HistoryListScreen> { ))); } - Future checkNode() async { - final response = await Dio().post(graphqlEndpoint); - showHistory(response); - return response; - } + // Future checkNode() async { + // final response = await Dio().post(graphqlEndpoint); + // showHistory(response); + // return response; + // } Future _scan() async { await Permission.camera.request(); @@ -310,6 +311,8 @@ class _HistoryListScreenState extends State<HistoryListScreen> { // var tata = _scrollController; + notifyListeners(); + setState(() { print('setPubkey: ' + pubkey); pubkey = pubkey; diff --git a/lib/main.dart b/lib/main.dart index bec1bed17efa3d959e929c60dcc0c162d7b9a88d..cc3fb1f8dc180351ecd0f36c6d17425be52c1f59 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -5,15 +5,16 @@ import 'package:flutter/material.dart'; import 'home.dart'; import 'package:graphql_flutter/graphql_flutter.dart'; -void main() { - runApp(Gecko()); -} +void main() => runApp(Gecko()); class Gecko extends StatelessWidget { @override Widget build(BuildContext context) { final _httpLink = HttpLink( - 'https://g1.librelois.fr/gva', + 'http://127.0.0.1:30901/gva', + // defaultHeaders: <String, String>{ + // 'Content-Type': 'application/json', + // }, ); final _client = ValueNotifier( diff --git a/pubspec.lock b/pubspec.lock index fb835d82578f6800e057615ab0c5a0c2d1980360..50dc01dc0179538f115a36dc44abc5bcbcc8cbac 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -218,14 +218,14 @@ packages: name: graphql url: "https://pub.dartlang.org" source: hosted - version: "4.0.0-beta.5" + version: "4.0.0-beta.6" graphql_flutter: dependency: "direct main" description: name: graphql_flutter url: "https://pub.dartlang.org" source: hosted - version: "4.0.0-beta.5" + version: "4.0.0-beta.6" hive: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index dc05e71174c82f55ee8b627e667c45ddb87f91aa..cf4992a7594303a85c15da5b5a786405098baada 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 0.0.0+4 +version: 0.0.0+5 environment: sdk: ">=2.7.0 <3.0.0" @@ -34,7 +34,7 @@ dependencies: intl: flutter_launcher_icons: "^0.8.0" infinite_scroll_pagination: ^2.2.3 - graphql_flutter: ^4.0.0-beta.5 #^3.1.0 + graphql_flutter: ^4.0.0-beta.6 #^3.1.0 flutter_icons: