All a flutter about Flutter.io Steven Cooper - @DeveloperSteve Developer Evangelist - @TelstraDev Talk #114
@DeveloperSteve Also known as Steven Cooper Seasoned Dev/Ops/CTO /Maker/Geek/Gamer. International Speaker/MC. Hackathon Mentor/Judge. Prev @PayPalDev @XeroAPI
Telstra as a Technology Company
Github.com/telstra
dev.telstra.com TelstraDev portal
TelstraDev growing API Family
Telstra Connected Things APIs
Venture Partner Deals
Right tool for the right job
Digital Agency Challenging and rewarding
Organised Chaos
Dev disruptions
Facebook page tab apps
25 Words or less apps
Summadayze
Drag and Drop designer
Interactive games
Under da hood
Drag and Drop Yet another 25 words or less app
PhoneGap
Appcelerator
Unity
Best unity project ever
Double Peppers Ghost
CoronaSDK
LUA
My last agency app https://devstev.es/5gum
Flutter.io The new kid on the block
Flutter.io
At a glance • The advantages of reactive views, with no JavaScript bridge • Fast, smooth, and predictable; code compiles AOT to native (ARM) code • The developer has full control over the widgets and layout • Comes with beautiful, customizable widgets • Great developer tools, with amazing hot reload • More performant, more compatibility, more fun
The History
Dart for web
DART vs JS main() { } //Checking for null var myNull = null; if (myNull == null) { print('use "== null" to check null'); } var zero = 0; if (zero == 0) { print('use "== 0" to check zero'); } function main() { // Can be used as entry point } // but it has to be called manually. main(); //Checking for null var myNull = null; if (!myNull) { console.log("null is treated as false"); } var zero = 0; if (!zero) { console.log("0 is treated as false"); }
DART vs JS fn() { return true; } // Async _getIPAddress() { final url = 'https://httpbin.org/ip'; HttpRequest.request(url).then((value) { print(JSON.decode(value.responseText)['origi n']); }).catchError((error) => print(error)); } function fn() { return true; } // Async _getIPAddress = () => { const url="https://httpbin.org/ip"; return fetch(url) .then(response => response.json()) .then(responseJson => { console.log(responseJson.origin); }) .catch(error => { console.error(error); }); };
Everything is a widget
Expressive UI
Virtual Dom Webview React-native Flutter
STATEFUL HOT RELOAD!!! Android and iOS at the same time
Moar features
First App Hello World for reals
Assumptions • iOS and Android are set up at CLI • Android studio installed and is the prod latest ver • Xcode installed and is the prod latest ver • IntelliJ idea is installed • Brew installed the world • NPM installed the world
Setup Flutter Env Clone flutter repo and set path Flutter doctor Update Path
Setup Flutter editor(s) Android Studio TerminalVS • Browse repos • Search for Flutter • Invoke View>Command Palette… • Type ‘install’, and select the ‘Extensions: Install Extension’ action • Enter dart code in the search field, select ‘Dart Code’ in the list, and click Install • Select ‘OK’ to reload VS Code • Flutter create myapp • Cd myapp
Setup React Env Npm install –g react-native-cli
Setup react-native editor(s) Android Studio TerminalVS • Browse repos • Search for react • Install the extension in VS Code: • Press Ctrl + Shift + X (Cmd + Shift + X on macOS), wait a moment while the list of available extensions is populated • Type react-native and install React Native Tools • For more guidance view VS Code Extension Gallery • If you haven't already, install React Native: • Run npm install -g react-native-cli to install React Native CLI • Set up React Native using the steps detailed on the React Native getting started documentation • Open your React Native project root folder in VS Code. • react-native init myapp • Cd myapp
Create and run apps flutter create --org com.test.demo myapp Flutter run -d all react-native init myapp react-native run-ios react-native run-android
Hello World void main() { print('Hello, World!'); } export default class Project extends Component { render() { return ( <View style={styles.container}> <Text style={styles.hello}> Hello World </Text> </View> ); } }
Fancy Hello World import 'package:flutter/material.dart'; void main() => runApp(new MyApp()); class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return new MaterialApp( title: 'Welcome to Flutter', home: new Scaffold( appBar: new AppBar( title: new Text('Welcome to Flutter'), ), body: new Center( child: new Text('Hello World'), ), ), ); } }
Mac Air
Demo Time
Counter widget class CounterState extends State<Counter> { int counter = 0; void increment() { setState(() { counter++; }); } Widget build(BuildContext context) { return new Row( children: <Widget>[ new RaisedButton( onPressed: increment, child: new Text('Increment'), ), new Text('Count: $counter'), ], ); } } export default class App extends Component< {}, { count: number } > { state = { count: 0 }; render() { return ( <View style={styles.container}> <Text>{this.state.count}</Text> <Button title="increase" onPress={() => this.setState({ count: this.state.count + 1 })} /> </View> ); } } const styles = StyleSheet.create({ container: { flex: 1, justifyContent: "center", alignItems: "center", backgroundColor: "#F5FCFF" } }); https://github.com/ThrowJojo/VanillaCounter
Demo Time
In closing
Be ye warned
First Use Case
Recent beta 1 https://devstev.es/flutterbeta
Cross platform vs Native
Further Reading https://devstev.es/ReactFlutter
Further Video-ing https://devstev.es/dartconf18
dev.telstra.com TelstraDev portal
Github.com/telstra SDKs / Code Samples
Thank you Steven Cooper - @DeveloperSteve Developer Evangelist - @TelstraDev

All a flutter about Flutter.io

Editor's Notes

  • #30 World hello
  • #33 The first version of Flutter was known as "Sky" and ran on the Android operating system. It was unveiled at the 2015 Dart developer summit which is good news for recruiters who can ask for a minimum 2 years experience and be safe
  • #35  Dart is an open-source, scalable programming language for building web, server, and mobile apps. It is an object-oriented, single inheritance language that uses a C-style syntax that is AOT-compiled into native and also transcompiles optionally into JavaScript. It supports interfaces, abstract classes and strong types.
  • #36  Dart is an open-source, scalable programming language for building web, server, and mobile apps. It is an object-oriented, single inheritance language that uses a C-style syntax that is AOT-compiled into native and also transcompiles optionally into JavaScript. It supports interfaces, abstract classes and strong types.
  • #37 The first version of Flutter was known as "Sky" and ran on the Android operating system. It was unveiled at the 2015 Dart developer summit which is good news for recruiters who can ask for a minimum 2 years experience and be safe
  • #38 with composable widget sets, rich animation libraries, and a layered, extensible architecture but in a way that wont eat the battery
  • #39 Webview - virtual DOM is immutable React-native – virtual tree of native widgets Flutter – virtual widget tree is now a widget tree
  • #42 World hello
  • #48 Pubspec.yaml is your package.json
  • #52 Demo1 and demo2
  • #54 Demotest and RN-counter
  • #55 World hello
  • #57 Hmilton the official app was built and deployed in 3 months which is really fast for a major app build, Google also uses it for internal facing apps
  • #63 react native / lottie (animations) / mixing native code + react-native together