| Type of future | When it's ready, I'll have a ... |
|---|---|
| Future<String> | ... string |
| Future<Foo> | ... Foo |
| Future> | ... Map whose keys are Strings and whose values are dynamic. |
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
| ^\d[A-Z]\d{16}$|^\d{14,15}$|^9[2-4]\d{2}( ?\d{4}){4} ?\d{2}$ |
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'; // <-- 1 | |
| import { Button, Image, SafeAreaView, ScrollView, Text, View } from 'react-native'; | |
| import { store } from './store/store'; // <-- 2 | |
| import { DatePicker } from './DatePicker'; // <-- 3 | |
| import { FilmBrief } from './FilmBrief'; // <-- 3 | |
| import { FilmDetails } from './FilmDetails'; // <-- 3 | |
| import { ShowingTimes } from './ShowingTimes'; // <-- 3 | |
| export class Landing extends Component { // <-- 4 | |
| constructor(props) { // <-- 5 |
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'; // <-- 1 | |
| import 'package:flutter_redux/flutter_redux.dart'; | |
| import 'package:redux/redux.dart'; // <-- 2 | |
| import 'store/Actions.dart'; // <-- 2 | |
| import 'store/AppState.dart'; // <-- 2 | |
| import 'FilmBrief.dart'; // <-- 3 | |
| import 'FilmDetails.dart'; // <-- 3 | |
| import 'DatePicker.dart'; // <-- 3 | |
| import 'ShowingTimes.dart'; // <-- 3 |
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
| render() { | |
| const {showings,films,selected_date,selected_film,showFilmDetails}= {...this.state}; // <-- 9 | |
| return ( | |
| <SafeAreaView> // <-- 10 | |
| <ScrollView> // <-- 11 | |
| <View> // <-- 12 | |
| <View style={styles.header}> // <-- 12 | |
| <Image source={require(`./assets/daam.png`)} style={styles.logo} /> // <-- 13, 14 | |
| <Title>Dinner And A Movie</Title> | |
| </View> |
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
| @override | |
| Widget build(BuildContext context) { | |
| return StoreProvider<AppState>( | |
| store: this.store, | |
| child: StoreConnector<AppState, AppState>(converter: (store) { | |
| return store.state; | |
| }, | |
| builder: (context, callback) { | |
| if (store.state.showFilmDetails) // <-- 9 | |
| return showFilmDetails(this.store.state.selectedFilm); // <-- 9 |
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
| void myCallback(Foo theIncomingData) { | |
| doSomethingWith(theIncomingData); | |
| } |
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
| Bar someFunction() { | |
| Foo theIncomingData = someFunction(); | |
| return new Bar(); | |
| } |
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
| Future<Bar> someFunction() async { | |
| Foo theIncomingData = await somethingThatReturnsAFuture(); | |
| return new Bar(); | |
| } |
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
| class FooState extends State<FooComponent> { | |
| String _firstName; // <-- A variable known by the whole class | |
| Widget build(BuildContext context) { | |
| // return a widget | |
| } | |
| void _myCallback(String someVar) { | |
| _firstName = someVar; // <-- Getting a value OUT of an async callback | |
| } | |
| } |
OlderNewer