Fireship · @fireship
Reflectly-Inspired Animated Slideshow with Flutter + Firebase
Uploaded March 21, 2019 · Length 9:50
Summary
Build an animated slideshow with Flutter and Firebase, inspired by Reflectly, with fluid transitions and Firestore data filtering.
- flutter animated slideshow
- firebase data filtering
- reflectly inspiration
- flutter firestore integration
- animated ui design
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:00
One of the most popular showcase apps for Flutter is Reflectly. It's an AI-powered journal,
- 0:10
and the developers did a really awesome job designing the UI. In today's video,
- 0:14
we'll build our own animated slideshow from scratch using this app as our inspiration.
- 0:18
Not only will it have this fluid transition between pages, but it will also be wired up
- 0:22
with Firestore so we can filter the data on the backend. And we'll do the entire thing in about
- 0:26
a hundred lines of code. If you're new to the channel, like and subscribe, and you can find
- 0:29
full source code on Fireship.io.
- 0:31
Let's take a closer look at the demo.
- 0:33
When the user swipes, they can see a preview of the next page on the right and a preview
- 0:37
of the previous page on the left.
- 0:38
The active page in the middle will animate into the view by increasing its height and
- 0:42
also add a box shadow to give it depth.
- 0:45
The buttons on the first card will actually make a query to Firestore so we can filter
- 0:48
the number of pages that are shown in the list.
- 0:51
Everything stays synced up in real time, so if we want to add another page, all we do
- 0:54
is add some data to Firestore and it's automatically reflected in the UI.
- 0:58
We're going to look at a handful of important widgets here, but the single most important
- 1:02
one is the page view.
- 1:03
It's a built-in widget that comes with gesture detection and animation, allowing the user
- 1:07
to swipe between a linear set of pages or widgets.
- 1:10
I want to show you how the page view works before we get into the main feature.
- 1:13
When we jump into a basic Flutter app, the first thing we'll do is set up a page controller.
- 1:17
The controller allows you to navigate between pages manually and also gives you information
- 1:20
about the state of the page view.
- 1:23
For a basic slider, you actually don't really need to do anything with the controller.
- 1:26
You just need to pass it in as an argument to the page view widget in the widget tree.
- 1:30
The next thing we'll do is add the page view widget as the body of our scaffold.
- 1:34
And a cool little side note is that you can control the scroll direction as either vertical
- 1:37
or horizontal.
- 1:39
From there we'll pass our controller, and then we'll define an array of children widgets.
- 1:42
I'm just going to hard code a few containers in here to show you the effect.
- 1:46
Because we have the scroll direction set to vertical, we can swipe from top to bottom
- 1:49
to navigate between the pages.
- 1:51
So now that you know how a page view works, you can go ahead and delete all that code,
- 1:54
we're going to build something a lot more advanced. At this point I'm assuming
- 1:57
that you have Firebase installed in your Flutter project. If not you'll want to


