Chrysolites Tech Academy

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

Lesson 22: Replies with Recursive Components

About this lesson

In this part of the series, Joel Loh implements replies in the comment section of the photo-sharing app, allowing users to reply to comments and even to reply to replies, using recursive components in FlutterFlow together with Supabase. It begins by introducing recursive components, a technique in which a component contains copies of itself, which is exactly what a conversation needs, since a reply is just another comment that can have replies of its own. Building the comment component this way means that threads of any depth can be displayed without a separate layout for each level. Because showing every reply at once would quickly crowd the screen, the video then adds the ability to hide replies, so that each comment's replies stay out of the way until the user chooses to see them. Next comes adding replies, connecting the reply action to the database so that a new reply is saved and linked to the comment it answers, and appears in the right place in the thread. As with earlier features, connecting nested data brings its own problems, and the video works through the debugging needed to make replies behave correctly, followed by a test that checks replying at different levels of a conversation. By the end of the video, the comment section supports full threaded conversations, and the next part moves on to letting users follow other users, using intermediate tables to store who follows whom. Afterwards, read Chapter 22 of the course book, which works out how indentation limits the depth of replies 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.