swyxio / swyxdotio

This is the repo for swyx's blog - Blog content is created in github issues, then posted on swyx.io as blog pages! Comment/watch to follow along my blog within GitHub
https://swyx.io
MIT License
336 stars 45 forks source link

Flutter for React Native Devs in 30 Seconds #276

Closed swyxio closed 2 years ago

swyxio commented 2 years ago

source: devto devToUrl: "https://dev.to/swyx/flutter-for-react-native-devs-in-30-seconds-78g" devToReactions: 50 devToReadingTime: 2 devToPublishedAt: "2017-12-03T16:06:18.671Z" devToViewsCount: 6018 title: Flutter for React Native Devs in 30 Seconds published: true tags: inthirtyseconds, flutter, react native

You may have heard of Flutter, Google's answer to React Native. What should you know?

FLUTTER COMES WITH ROUTING!!!1!!!

{% youtube CEcFnqRDfgw %}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: new Text(widget.title),
      ),
      body: new Center(
        child: new Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            new Text(
              'You have pushed the button this many times:',
            ),
            new Text(
              '$_counter',
              style: Theme.of(context).textTheme.display1,
            ),
          ],
        ),
      ),
      floatingActionButton: new FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: new Icon(Icons.add),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}
git clone -b alpha https://github.com/flutter/flutter.git
export PATH=`pwd`/flutter/bin:$PATH
flutter doctor

Give it a shot! http://flutter.io and the Google Codelab tutorial is here. or watch the Google I/O video!

{% youtube w2TcYP8qiRI %}