diff --git a/lib/api.dart b/lib/api.dart index b76e935..93170bc 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 8b13789..0000000 --- a/lib/functions.dart +++ /dev/null @@ -1 +0,0 @@ - diff --git a/lib/home.dart b/lib/home.dart index acab5e6..7ae2b59 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 { +class _HistoryListScreenState extends State + 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 { // 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 { ))); } - 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 { // var tata = _scrollController; + notifyListeners(); + setState(() { print('setPubkey: ' + pubkey); pubkey = pubkey; diff --git a/lib/main.dart b/lib/main.dart index bec1bed..cc3fb1f 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: { + // 'Content-Type': 'application/json', + // }, ); final _client = ValueNotifier( diff --git a/pubspec.lock b/pubspec.lock index fb835d8..50dc01d 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 dc05e71..cf4992a 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: