Fireship · @fireship

iPod Classic UI with Flutter

Uploaded December 3, 2019 · Length 11:17

iPod Classic UI with Flutter

Summary

Recreating the classic iPod UI using Flutter, including a scrollable page view and a radial click wheel.

  • flutter
  • ipod ui
  • scrollable page view
  • radial click wheel
  • flutter ui challenge

Transcript preview

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

  1. 0:00

    over the last week or so if there's been

  2. 0:01

    this really awesome tweet going around

  3. 0:03

    that recreates the classic iPod using

  4. 0:05

    Swift UI it contains a click wheel that

  5. 0:07

    you can rotate around to change the

  6. 0:09

    position of the album's in the

  7. 0:11

    scrollable view above it and if you've

  8. 0:13

    ever owned an iPod it will definitely

  9. 0:15

    make you feel some nostalgia as soon as

  10. 0:17

    I saw this tweet I knew that I was going

  11. 0:18

    to have to build it in flutter and

  12. 0:20

    that's what this video is all about if

  13. 0:22

    you're new here like and subscribe and

  14. 0:23

    grab the full source code from fire ship

  15. 0:25

    IO let's start by taking a closer look

  16. 0:27

    at the app we're building in this video

  17. 0:29

    now I realize that everybody is sick of

  18. 0:32

    flutter UI challenges but this video is

  19. 0:34

    really all about the UI we're not going

  20. 0:36

    to request access to the user's music or

  21. 0:38

    play actual audio files but there are

  22. 0:40

    plenty of flutter plugins out there if

  23. 0:41

    your goal is to build a full-blown audio

  24. 0:43

    player now if we look at the top of the

  25. 0:45

    UI you'll see that I have a scrollable

  26. 0:47

    page view widget

  27. 0:48

    it focuses an individual item in the

  28. 0:50

    center and then animates it into the

  29. 0:52

    view when it's moving the off-screen

  30. 0:54

    images are given some perspective so

  31. 0:56

    they look 3d and then rotate it the

  32. 0:58

    rotation is calculated based on their

  33. 1:00

    position in the page view and that's how

  34. 1:02

    we get these cool animations when the

  35. 1:03

    squirrel position changes now moving

  36. 1:05

    down to the click wheel we can go from

  37. 1:07

    one item to the next by clicking the

  38. 1:09

    forward or backwards buttons but the

  39. 1:11

    real challenge with this demo was

  40. 1:12

    creating a click wheel that you can pan

  41. 1:14

    across either clockwise or

  42. 1:15

    counterclockwise and have the scroll

  43. 1:18

    view rotate in the proper direction so

  44. 1:20

    when the wheel is rotating clockwise it

  45. 1:22

    should move the page view to the right

  46. 1:23

    when it's moving counterclockwise it

  47. 1:25

    should move the page view back to the

  48. 1:26

    left and we can do all this with just a

  49. 1:29

    regular gesture detector and some basic

  50. 1:31

    math we don't need a custom painter or

  51. 1:33

    trigonometry or anything crazy like that

  52. 1:35

    in fact we don't need a single

  53. 1:37

    dependency for this project so let's go

  54. 1:39

    ahead and jump into a flutter app the

  55. 1:41

    first thing you'll notice is that I have

  56. 1:42

    a list of image URLs to show the album

  57. 1:44

    covers which is completely optional

  58. 1:46

    because those images sit on top of some

  59. 1:48

    colored containers so you can omit them

  60. 1:50

    all together if you want now down in our

  61. 1:52

    main material app we'll go ahead and add

  62. 1:55

    a scaffold and then inside that scaffold

  63. 1:57

    we'll add our iPod widget the first

  64. 1:59

    thing I'll do is show you how to set up