Fireship · @fireship

Flutter in 100 seconds

Uploaded April 14, 2020 · Length 2:10

Flutter in 100 seconds

Summary

learn flutter UI framework for building apps on multiple platforms in 100 seconds

  • flutter
  • ui framework
  • mobile app development
  • dart programming
  • cross-platform development

Transcript preview

The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.

  1. 0:00

    flutter a UI framework for building apps

  2. 0:02

    on iOS Android the web and desktop at

  3. 0:04

    its core flutter combines a high

  4. 0:06

    performance graphics engine with the

  5. 0:08

    dart programming language in development

  6. 0:10

    dart provides full type safety and

  7. 0:11

    stateful hot reload to help you build

  8. 0:13

    reliable apps quickly in production dart

  9. 0:16

    compiles to native machine code which

  10. 0:18

    means your graphics will render

  11. 0:19

    beautifully on any platform install

  12. 0:21

    flutter then run flutter create to

  13. 0:23

    create a new project now open the main

  14. 0:25

    dart file this is where you build your

  15. 0:27

    app the UI is laid out as a tree of

  16. 0:29

    widgets and the framework provides

  17. 0:30

    hundreds of pre-built widgets to handle

  18. 0:32

    things like animations scrolling

  19. 0:34

    responsive layout and more you can build

  20. 0:36

    your own widget by extending the

  21. 0:38

    stateless widget class you then define

  22. 0:40

    your UI by overriding its build method

  23. 0:41

    now it's important to understand that

  24. 0:43

    everything in flutter is a widget this

  25. 0:45

    method returns a widget and it's

  26. 0:47

    children return widgets and their

  27. 0:48

    children return widgets giving us an

  28. 0:50

    expressive declarative UI structure

  29. 0:52

    which you can easily Traverse using

  30. 0:54

    flutters awesome tool whenever the input

  31. 0:56

    data to this widget changes flutter will

  32. 0:58

    rebuild the UI by calling your build

  33. 1:00

    method stateless widgets are immutable

  34. 1:01

    and don't have any internal data when

  35. 1:03

    you have an interactive widgets where

  36. 1:05

    the internal data might change based on

  37. 1:06

    user input you can extend a stateful

  38. 1:08

    widget properties defined on this class

  39. 1:10

    can be reactive for example we might

  40. 1:12

    have a counter that starts at zero then

  41. 1:14

    in our build method we have one of

  42. 1:16

    flutters built-in buttons that cause a

  43. 1:17

    function whenever it's pressed it

  44. 1:19

    increments the counter by coin set state

  45. 1:21

    which tells the framework that the

  46. 1:22

    widgets data has changed causing the UI

  47. 1:24

    to re-render with the latest data you

  48. 1:26

    can now play with this app on a real

  49. 1:27

    device using the flutter run command

  50. 1:29

    that's cool and all but let's make some

  51. 1:31

    changes we'll go back to our source code

  52. 1:33

    and Center the button on the middle of

  53. 1:34

    the screen instead of writing code just

  54. 1:36

    click on the button and hit control

  55. 1:38

    shift R then wrap your button with a

  56. 1:39

    center widget next change the color of

  57. 1:41

    the button and notice how flutter

  58. 1:42

    previews that color directly in your IDE

  59. 1:44

    now too hot reload the app simply type

  60. 1:47

    or into the command line it only took a

  61. 1:48

    few milliseconds to build a new version

  62. 1:50

    of our app and notice how the state of

  63. 1:52

    the counter was unchanged that's what I

  64. 1:53

    like to call an awesome developer

  65. 1:55

    experience this has been flutter in 100

  66. 1:57

    seconds if you want to learn more check

  67. 1:59

    out my newly updated flutter fire based