Skip to content

Instantly share code, notes, and snippets.

@simoales
Created June 11, 2020 15:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simoales/05a97d7d4f8fe4d8f455370b1cc30628 to your computer and use it in GitHub Desktop.
Save simoales/05a97d7d4f8fe4d8f455370b1cc30628 to your computer and use it in GitHub Desktop.
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Future Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: FuturePage(),
);
}
}
class FuturePage extends StatefulWidget {
@override
_FuturePageState createState() => _FuturePageState();
}
class _FuturePageState extends State<FuturePage> {
String result;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Back from the Future'),
),
body: Center(
child: Column(children: [
Spacer(),
RaisedButton(
child: Text('GO!'),
onPressed: () {
},
),
Spacer(),
Text(result.toString()),
Spacer(),
CircularProgressIndicator(),
Spacer(),
]),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment