Fireship · @fireship

Learn Binary by Building a Binary Clock with Flutter

Uploaded November 25, 2019 · Length 11:34

Learn Binary by Building a Binary Clock with Flutter

Summary

Learn how to build a binary clock using Flutter, including understanding binary numbers and converting timestamps to binary.

  • flutter binary clock
  • binary numbers explained
  • binary time conversion
  • flutter clock tutorial
  • binary clock building

Transcript preview

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

  1. 0:00

    today we're going to use flutter to

  2. 0:01

    build a clock and not just any ordinary

  3. 0:03

    clock but a binary clock just a few days

  4. 0:06

    ago the flutter team launched a new

  5. 0:07

    competition where the goal is to build

  6. 0:09

    the most beautiful clock face I don't

  7. 0:11

    plan on entering this competition myself

  8. 0:12

    so this video is more of a QuickStart

  9. 0:14

    guide to get you started building your

  10. 0:15

    own clock from scratch as you'll see in

  11. 0:17

    a few minutes

  12. 0:18

    building a clock and flutter is really

  13. 0:20

    easy so in order to make this video a

  14. 0:21

    little more challenging I also want to

  15. 0:23

    teach you everything you didn't know

  16. 0:24

    about binary and if you're entering the

  17. 0:26

    flutter clock competition make sure to

  18. 0:28

    watch until the end of the video because

  19. 0:29

    I'll be sharing additional clock ideas

  20. 0:31

    there that you're more than welcome to

  21. 0:32

    steal from me if you're new here like

  22. 0:34

    and subscribe and you can grab the full

  23. 0:36

    source code from fire ship IO in order

  24. 0:38

    to build a binary clock we need to know

  25. 0:40

    a little bit about how binary works in

  26. 0:42

    mathematics a binary number is just a

  27. 0:44

    number that has two possible States

  28. 0:46

    which we can represent as a 0 or 1 you

  29. 0:49

    can think of this logically as true or

  30. 0:50

    false or electronically as on off and in

  31. 0:53

    computer systems we call a single binary

  32. 0:55

    value a bit now a single bit by itself

  33. 0:58

    can't represent very much just two

  34. 1:00

    values to be precise so how do we make

  35. 1:03

    bits represent more complex data well we

  36. 1:05

    simply combine them together when you

  37. 1:07

    combine bits together it creates a

  38. 1:08

    geometric series where the number of

  39. 1:10

    different values we can represent is

  40. 1:12

    determined by 2 to the power of the

  41. 1:14

    number of bits that we have so 2 to the

  42. 1:16

    power of 1 equals 2 which means we can

  43. 1:18

    represent two things 2 to the power of 2

  44. 1:21

    is 4 so we can represent 4 things with 2

  45. 1:23

    bits but when talking about bits we

  46. 1:25

    usually think about them grouped in

  47. 1:26

    series of 8 which is a single bite a

  48. 1:29

    bite would be 2 to the power of 8 which

  49. 1:31

    can represent 256 different things now

  50. 1:34

    the reason we call 8 bits a byte is

  51. 1:36

    somewhat arbitrary it's just a good even

  52. 1:38

    number and contains a enough space for

  53. 1:40

    all the letters of the alphabet and

  54. 1:42

    uppercase and lowercase for example you

  55. 1:44

    may have heard of utf-8 which stands for

  56. 1:46

    8 bit Unicode transformation format it

  57. 1:48

    encodes millions of different characters

  58. 1:50

    from languages around the world

  59. 1:51

    including emojis and does so by

  60. 1:53

    combining 1 2 4 8 bit bytes together so

  61. 1:56

    whenever you use Unicode characters in

  62. 1:58

    your code which is all the time each

  63. 1:59

    character is actually encoded to a