Skip to content
Snippets Groups Projects
Commit 8ccddfea authored by poka's avatar poka
Browse files

Add error handling information when no endpoint is configure. Build GVA...

Add error handling information when no endpoint is configure. Build GVA history query only if pubkey is not empty;
parent 0210dfd5
No related branches found
No related tags found
No related merge requests found
...@@ -22,7 +22,7 @@ T getRandomElement<T>(List<T> list) { ...@@ -22,7 +22,7 @@ T getRandomElement<T>(List<T> list) {
} }
Future<String> getRandomEndpoint() async { 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()); // final _json = json.decode(await getJsonEndpoints());
// print('JSON !! :'); // print('JSON !! :');
// print(_json); // print(_json);
......
...@@ -110,7 +110,7 @@ class HistoryScreenState extends State<HistoryScreen> { ...@@ -110,7 +110,7 @@ class HistoryScreenState extends State<HistoryScreen> {
disabledBorder: InputBorder.none, disabledBorder: InputBorder.none,
), ),
style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold)), style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold)),
historyQuery(), if (this.pubkey != '') historyQuery(),
])); ]));
} }
...@@ -138,11 +138,18 @@ class HistoryScreenState extends State<HistoryScreen> { ...@@ -138,11 +138,18 @@ class HistoryScreenState extends State<HistoryScreen> {
} }
if (result.hasException) { 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) { 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 = final List<dynamic> blockchainTX =
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment