From e5680bb35074365f26278f56cc9dad0d42577979 Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Tue, 30 Aug 2022 21:28:49 +0200 Subject: [PATCH] http minimal client --- covas_mobile/lib/main.dart | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/covas_mobile/lib/main.dart b/covas_mobile/lib/main.dart index 202509b..6673588 100644 --- a/covas_mobile/lib/main.dart +++ b/covas_mobile/lib/main.dart @@ -1,4 +1,7 @@ +import 'dart:io'; + import 'package:flutter/material.dart'; +import 'package:http/http.dart' as http; void main() { runApp(const MyApp()); @@ -50,7 +53,12 @@ class MyHomePage extends StatefulWidget { class _MyHomePageState extends State { int _counter = 0; - void _incrementCounter() { + Future _incrementCounter() async { + var url = Uri.http("localhost:8083", "api/v1/token"); + var response = await http.get(url); + stderr.writeln('Response status: ${response.statusCode}'); + stderr.writeln('Response body: ${response.body}'); + setState(() { // This call to setState tells the Flutter framework that something has // changed in this State, which causes it to rerun the build method below