Chrysolites Tech Academy

Video by Joel Loh | AI Automations · streamed from YouTube. All rights remain with the creator.

Lesson 18: Liking Posts with a Toggle Icon

About this lesson

In this part of the series, Joel Loh builds the like post functionality of the photo-sharing app with FlutterFlow and Supabase, one of the most familiar interactions in any social app. It begins by creating a like table in Supabase, which records which users have liked which posts, so that every like is stored in the database and linked to both the person and the post. The video then builds the like function in FlutterFlow, using the toggle icon widget to create a simple like icon that switches between an unliked and a liked appearance when tapped, and connecting it to actions that add or remove the like in the database. An important part of the work is storing the liked state, so that the app remembers which posts the current user has already liked and shows the icon correctly, rather than resetting it every time a post is displayed. As often happens when connecting an interface to a database, problems appear along the way, and the video works through the debugging needed to find and fix them, which is useful practice in diagnosing issues in FlutterFlow and Supabase. A test then confirms that users can like and unlike posts and that the state is shown correctly. By the end of the video, users can like posts in the app, and the next part uses Supabase triggers to keep the like count for each post up to date automatically and to reflect that count in the app. Afterwards, read Chapter 18 of the course book, which estimates how large the likes table becomes by hand.

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.