Skip to content

Instantly share code, notes, and snippets.

@Bilguun132
Last active March 15, 2019 15:26
Show Gist options
  • Select an option

  • Save Bilguun132/191620cf0f75aba1490303b31e9746ff to your computer and use it in GitHub Desktop.

Select an option

Save Bilguun132/191620cf0f75aba1490303b31e9746ff to your computer and use it in GitHub Desktop.
crypto_list-FlutterDemo-main-2
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
//material app widget
return MaterialApp(
title: 'Crypto Price List',
theme: new ThemeData(primaryColor: Colors.white),
home: CryptoList(),
); //use our widget instead of the text previously
}
}
//creates a stateful widget (data inside will change once created)
class CryptoList extends StatefulWidget {
@override
CryptoListState createState() => CryptoListState();
}
class CryptoListState extends State<CryptoList> {
//will be used later to view favourited cryptos
void _pushSaved() {}
//build method
@override
Widget build(BuildContext context) {
//Implements the basic Material Design visual layout structure.
//This class provides APIs for showing drawers, snack bars, and bottom sheets.
return Scaffold(
appBar: AppBar(
title: Text('CryptoList'),
actions: <Widget>[
// will be used to view favourites
new IconButton(icon: const Icon(Icons.list), onPressed: _pushSaved),
],
),
body: new Center(
// body of the scaffold
child: new Text('my crypto app'),
));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment