Photo Social App with FlutterFlow and Supabase · Course book
Chapter 6: Search and Navigation
Discovery is what keeps people coming back to a social app. The search page lets them find posts and accounts: a search box at the top, a grid of interesting photos to browse before typing, and, once they search, results split into tabs for posts and accounts. This chapter designs that page in FlutterFlow, reusing the grid and tab bar from earlier parts in new ways: an explore grid with a larger featured tile, a tabbed results view, a list of accounts and the final arrangement of the bottom navigation bar. It explains how lists stay fast however many results there are, working out by hand how many rows are actually built.
The search page layout
The page has two states. Before the user types, it shows a search box and an explore grid of photos to browse. After the user searches, it shows results in two tabs: one for posts, displayed as a grid like the explore view, and one for accounts, displayed as a list. A clear way to build this is a column with the search box at the top and, beneath it, either the explore grid or the results tabs, switched by whether the search box contains text.
The search box is a text field styled to look like a rounded pill: a light grey fill, a magnifying glass icon at the start, placeholder text such as "Search", and a clear button at the end that appears once something has been typed. Its keyboard's return key is labelled "search", and submitting runs the search. Tapping the box can also move it to the top of the page and reveal a cancel button, a familiar pattern that signals the user is now in search mode.
Two refinements make search feel quick. Recent searches, stored on the device and shown as a list when the box is tapped but still empty, let users repeat a search with one tap, with a small cross on each to remove it and a "clear all" link. Search as you type shows results while the user is still typing, but sending a request for every keystroke is wasteful; waiting until typing pauses for around 300 milliseconds, a technique called debouncing, sends one request for a short burst of typing instead of one per letter. A ten-letter search typed steadily then costs one or two requests instead of ten. Scrolling the results should also dismiss the keyboard, so that the whole list is visible, which a list can be set to do automatically.
| State | What shows below the search box | Widget |
|---|---|---|
| Not searching | Explore grid of photos | GridView, three columns |
| Searching: posts tab | Grid of posts matching the search | TabBar page with a GridView |
| Searching: accounts tab | List of matching users with picture, username and name | TabBar page with a ListView |
| No results | A short message and suggestions | Empty state inside the tab |
The explore grid
A plain three-column grid works well for browsing, and many photo apps vary it by making some tiles larger, so that striking images stand out. One common pattern repeats every few rows: a block in which one tile spans two columns and two rows, beside a column of two ordinary tiles. FlutterFlow's standard grid uses equal cells, so a mixed layout is built either with a staggered grid option or by composing rows and columns of tiles in a repeating component.
Before any real data exists, the explore grid uses placeholder images. Later it will show a selection of recent or popular posts from the database, and tapping a tile will open that post's detail page. Choosing what appears in the explore grid is a product decision with real consequences: recent posts keep it fresh, popular posts make it attractive, and a mix of both, perhaps weighted towards accounts the user does not yet follow, helps people discover new creators. Whatever the rule, it should exclude content from accounts the user has blocked.
Tabs for posts and accounts
When a search runs, the page switches to a tab bar with two tabs, Posts and Accounts, each with its own content. The posts tab reuses the grid design, so search results look like a familiar part of the app. The accounts tab is a vertical list, where each row shows a circular profile picture, the username in bold and the display name beneath it in grey, perhaps with a follow button at the end.
Designing the account row as a component, with parameters for the user's picture, username and name, means the same row can appear in search results, follower lists and the people a user follows. A row about 64 points tall, with a 44-point picture and 12 points of padding at the sides, is comfortable to tap and fits plenty of results on screen.
Both tabs need an empty state: if nothing matches, show "No accounts found for 'sunset'" rather than a blank space, and perhaps suggest checking the spelling. Search should also cope with case, so that "Sunset" and "sunset" find the same results, which is handled by the query, built in later parts with Supabase's search features.
Fast lists however many results
A search can return hundreds of accounts. Flutter's ListView and GridView are lazy: rather than building a widget for every result, they build only the rows near the visible area, plus a small buffer above and below, and reuse memory as the user scrolls. That keeps scrolling smooth and memory low, provided each row has a predictable height and the list is the scrolling element of the page rather than being forced to lay out all its children inside another scrolling column.
Finishing the bottom navigation bar
With the search page designed, the bottom navigation bar can be put in its final order. FlutterFlow assigns each page in the navigation bar a position, and the order can be changed in the navigation bar settings or by reordering the pages. A sensible order for a photo app places the most frequently used pages where thumbs reach easily: Home first, Search second, the create-post button in the centre, then notifications or activity, and the profile last.
Each item uses an icon that is instantly recognisable: a house for home, a magnifying glass for search, a plus inside a square for creating, a heart for activity and the user's own small profile picture, or a person icon, for the profile. Selected icons can switch from outlined to filled versions, which makes the current page obvious without relying on colour alone. Hiding labels gives a cleaner look common in photo apps, but labels help new users, so it is a design choice worth testing with a few real people before settling on it.
The remaining pages to design are those for creating a post: choosing or taking a photo, and adding details such as a caption. After that, the series moves from design to data, creating the Supabase tables and storage that will fill every page with real content.
Practice tasks
- On a 414-point screen with three columns and 2-point gaps, how large are normal tiles and a featured tile spanning two by two?
- How many images does the repeating block in the worked example hold per 390 points of height, and how many would 1,170 points show?
- A list of 1,200 results uses 72-point rows on a 650-point visible area with 300 points of buffer in total. Roughly how many rows are built?
- Describe the two states of the search page and what triggers the switch between them.
- Why should the account row be a component, and where else will it appear?
- Propose an order and icons for a five-item bottom navigation bar, and justify the order.
This course book is available to read online only at tech-academy.chrysolites.org.