Chrysolites Tech Academy

Photo Social App with FlutterFlow and Supabase · Course book

Chapter 6: Search and Navigation

Pairs with Lesson 6: The Search Page and the Navigation Bar

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.

StateWhat shows below the search boxWidget
Not searchingExplore grid of photosGridView, three columns
Searching: posts tabGrid of posts matching the searchTabBar page with a GridView
Searching: accounts tabList of matching users with picture, username and nameTabBar page with a ListView
No resultsA short message and suggestionsEmpty 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.

Worked example. On a 390-point screen with three columns and 2-point gaps, a normal tile is (390 − 4) / 3 = 128.7 points square. A featured tile spanning two columns and two rows covers two tiles and the gap between them in each direction: 2 × 128.7 + 2 = 259.3 points wide and tall. A repeating block of a featured tile with two small tiles stacked beside it is 259.3 points tall and holds 3 images; adding a normal row of three below it makes a block of 259.3 + 2 + 128.7 = 390 points holding 6 images. A screen showing about 700 points of grid therefore displays just under two such blocks, roughly 11 images on a typical phone.

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.

Worked example. Five hundred matching accounts, at 64 points per row, make a list 500 × 64 = 32,000 points long. A visible area of 700 points shows 700 / 64 ≈ 11 rows. With a buffer of a few rows above and below, perhaps 250 points each, the list builds about (700 + 500) / 64 ≈ 19 rows at any moment, under 4 percent of the 500. Building all 500 at once would take roughly 26 times as much work and memory before the first frame appeared.
500 rowsabout 19 built of which about 11 are visible build every rowlazy list 0250500
Figure 6.1 — A lazy list builds only the rows near the screen. For 500 accounts that is about 19 rows instead of all 500.

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

  1. 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?
  2. 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?
  3. 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?
  4. Describe the two states of the search page and what triggers the switch between them.
  5. Why should the account row be a component, and where else will it appear?
  6. Propose an order and icons for a five-item bottom navigation bar, and justify the order.

Install Chrysolites Tech Academy

Android / Chrome / Edge: open the browser menu and choose Install app or Add to Home screen.

iPhone / iPad (Safari): tap the Share button, then Add to Home Screen.