Created
June 11, 2020 15:45
-
-
Save simoales/05a97d7d4f8fe4d8f455370b1cc30628 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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