http minimal client
This commit is contained in:
parent
7a0731ba85
commit
e5680bb350
@ -1,4 +1,7 @@
|
|||||||
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:http/http.dart' as http;
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
runApp(const MyApp());
|
runApp(const MyApp());
|
||||||
@ -50,7 +53,12 @@ class MyHomePage extends StatefulWidget {
|
|||||||
class _MyHomePageState extends State<MyHomePage> {
|
class _MyHomePageState extends State<MyHomePage> {
|
||||||
int _counter = 0;
|
int _counter = 0;
|
||||||
|
|
||||||
void _incrementCounter() {
|
Future<void> _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(() {
|
setState(() {
|
||||||
// This call to setState tells the Flutter framework that something has
|
// This call to setState tells the Flutter framework that something has
|
||||||
// changed in this State, which causes it to rerun the build method below
|
// changed in this State, which causes it to rerun the build method below
|
||||||
|
Loading…
x
Reference in New Issue
Block a user