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:camera/camera.dart'; | |
| List<CameraDescription> cameras; | |
| class CameraWidget extends StatefulWidget { | |
| @override | |
| CameraState createState() => CameraState(); | |
| } |
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
| child: new FutureBuilder( | |
| future: | |
| DefaultAssetBundle.of(context).loadString('assets/beers.json'), | |
| builder: (context, snapshot) { | |
| var beers = json.decode(snapshot.data.toString()); |
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
| return new ListView.builder( | |
| itemBuilder: (BuildContext context, int index) { | |
| var beer = beers[index]; | |
| return new Card( | |
| child: new Column( | |
| crossAxisAlignment: CrossAxisAlignment.stretch, | |
| children: <Widget>[ | |
| new Text("Name: " + beer['name'], | |
| style: TextStyle( | |
| fontWeight: FontWeight.bold, fontSize: 24)), |
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
| final widgetOptions = [ | |
| new BeerListPage(), | |
| Text('Add new beer'), | |
| Text('Favourites'), | |
| ]; |
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:convert'; | |
| import 'package:flutter/material.dart'; | |
| import 'package:flutter/foundation.dart'; | |
| class BeerListPage extends StatefulWidget { | |
| BeerListPage({Key key}) : super(key: key); | |
| @override |
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
| assets: | |
| - assets/beers.json |
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
| [ | |
| { | |
| "id": "d320a502-5371-4707-927f-d53ca36b972f0", | |
| "name": "Barcelona beer", | |
| "country": "Spain", | |
| "image": "https://www.barcelonabeercompany.com/archivos/beer-barcelona-beer_140716141755.jpg", | |
| "abv": "5%" | |
| }, | |
| { | |
| "id": "d320a502-5371-4707-927f-d53ca36b972f1", |
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 'package:Liquorie/screens/home/home_screen.dart'; | |
| import 'package:flutter/material.dart'; | |
| void main() => runApp(MyApp()); | |
| class MyApp extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { | |
| return MaterialApp( | |
| title: 'Liquorie', |
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 'package:flutter/material.dart'; | |
| import 'package:flutter/widgets.dart'; | |
| class HomePage extends StatefulWidget { | |
| HomePage({Key key}) : super(key: key); | |
| @override | |
| HomePageState createState() => HomePageState(); | |
| } |
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 React, { Component } from 'react'; | |
| import { StyleSheet, Text, View, Button, TextInput } from 'react-native'; | |
| import { ApolloClient, HttpLink, InMemoryCache } from 'apollo-boost'; | |
| import { ApolloProvider, Mutation } from 'react-apollo'; | |
| import gql from 'graphql-tag'; | |
| const client = new ApolloClient({ | |
| link: new HttpLink({ | |
| uri: 'https://mysterious-harbor-82544.herokuapp.com' | |
| }), |