diff --git a/lib/main.dart b/lib/main.dart index 736ccd980f299f0bdc9456da07893ded26654328..6ca2db6a3404c6d42be96929fdf1c4afbf7d0a42 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -22,7 +22,7 @@ T getRandomElement<T>(List<T> list) { } Future<String> getRandomEndpoint() async { - // TODO: Improve implemention of getRandomEndpoint() with JSON and error handling + // TODO: Improve implemention of getRandomEndpoint() // final _json = json.decode(await getJsonEndpoints()); // print('JSON !! :'); // print(_json); diff --git a/lib/ui/historyScreen.dart b/lib/ui/historyScreen.dart index d13b15f5cb218f6dcfc0a4b1613b44124f1d5945..36cfa469b6cd7802172b088ce412a12900dd1892 100644 --- a/lib/ui/historyScreen.dart +++ b/lib/ui/historyScreen.dart @@ -110,7 +110,7 @@ class HistoryScreenState extends State<HistoryScreen> { disabledBorder: InputBorder.none, ), style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold)), - historyQuery(), + if (this.pubkey != '') historyQuery(), ])); } @@ -138,11 +138,18 @@ class HistoryScreenState extends State<HistoryScreen> { } if (result.hasException) { - return Text('\nErrors: \n ' + result.exception.toString()); + print('Error GVA: ' + result.exception.toString()); + return Column(children: <Widget>[ + SizedBox(height: 50), + Text( + "Aucun noeud GVA valide n'a pu être trouvé.\nVeuillez réessayer ultérieurement.", + style: TextStyle(fontSize: 17.0), + ) + ]); } if (result.data == null && result.exception.toString() == null) { - return const Text('Both data and errors are null'); + return const Text('Aucune donnée à afficher.'); } final List<dynamic> blockchainTX =