Fireship · @fireship
iPod Classic UI with Flutter
Uploaded December 3, 2019 · Length 11:17
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.
- 0:00
over the last week or so if there's been
- 0:01
this really awesome tweet going around
- 0:03
that recreates the classic iPod using
- 0:05
Swift UI it contains a click wheel that
- 0:07
you can rotate around to change the
- 0:09
position of the album's in the
- 0:11
scrollable view above it and if you've
- 0:13
ever owned an iPod it will definitely
- 0:15
make you feel some nostalgia as soon as
- 0:17
I saw this tweet I knew that I was going
- 0:18
to have to build it in flutter and
- 0:20
that's what this video is all about if
- 0:22
you're new here like and subscribe and
- 0:23
grab the full source code from fire ship
- 0:25
IO let's start by taking a closer look
- 0:27
at the app we're building in this video
- 0:29
now I realize that everybody is sick of
- 0:32
flutter UI challenges but this video is
- 0:34
really all about the UI we're not going
- 0:36
to request access to the user's music or
- 0:38
play actual audio files but there are
- 0:40
plenty of flutter plugins out there if
- 0:41
your goal is to build a full-blown audio
- 0:43
player now if we look at the top of the
- 0:45
UI you'll see that I have a scrollable
- 0:47
page view widget
- 0:48
it focuses an individual item in the
- 0:50
center and then animates it into the
- 0:52
view when it's moving the off-screen
- 0:54
images are given some perspective so
- 0:56
they look 3d and then rotate it the
- 0:58
rotation is calculated based on their
- 1:00
position in the page view and that's how
- 1:02
we get these cool animations when the
- 1:03
squirrel position changes now moving
- 1:05
down to the click wheel we can go from
- 1:07
one item to the next by clicking the
- 1:09
forward or backwards buttons but the
- 1:11
real challenge with this demo was
- 1:12
creating a click wheel that you can pan
- 1:14
across either clockwise or
- 1:15
counterclockwise and have the scroll
- 1:18
view rotate in the proper direction so
- 1:20
when the wheel is rotating clockwise it
- 1:22
should move the page view to the right
- 1:23
when it's moving counterclockwise it
- 1:25
should move the page view back to the
- 1:26
left and we can do all this with just a
- 1:29
regular gesture detector and some basic
- 1:31
math we don't need a custom painter or
- 1:33
trigonometry or anything crazy like that
- 1:35
in fact we don't need a single
- 1:37
dependency for this project so let's go
- 1:39
ahead and jump into a flutter app the
- 1:41
first thing you'll notice is that I have
- 1:42
a list of image URLs to show the album
- 1:44
covers which is completely optional
- 1:46
because those images sit on top of some
- 1:48
colored containers so you can omit them
- 1:50
all together if you want now down in our
- 1:52
main material app we'll go ahead and add
- 1:55
a scaffold and then inside that scaffold
- 1:57
we'll add our iPod widget the first
- 1:59
thing I'll do is show you how to set up


