DEV Community

Cover image for Flutter: ๐Ÿ”ด How to Create and Read data || Future Builder || Partโ€Š-โ€Š3
Next Dev
Next Dev

Posted on • Updated on

Flutter: ๐Ÿ”ด How to Create and Read data || Future Builder || Partโ€Š-โ€Š3

Hey there ๐Ÿ‘‹, in this blog post, you will learn how to create and read the data in supabase using flutter packages (supabase_flutter).

If you understand Hindi ๐Ÿ‘‡

Firstly, you need to set up supabase in a flutter. So for that, you need to read this ๐Ÿ‘‡ article.
How to use supabase database in flutter || ๐Ÿ”ด Part โ€” 1

Step1: You need to make a table for the supabase database

Step2: Now you need to make a todo.dart file


You can make models.dart file in the **model **folder.
export 'todo.dart';
Enter fullscreen mode Exit fullscreen mode

Step3: Now, you need to make a supabase_data_manager.dartโ€™ in the data folder in the utils folder. eg ๐Ÿ‘‡

Now you can use this code ๐Ÿ‘‡


Then you can make a utils.dart file in the utils folder.
// from data

export 'data/supabase_data_manager.dart';
Enter fullscreen mode Exit fullscreen mode

Now, you need to make a screens folder.

there are 3 files in the screens folder

  1. Create Screen โ€” โ€˜create_screen.dartโ€™

  2. Read Screen โ€” โ€˜read_screen.dartโ€™

  3. screens.dart for exporting the above screens

Now, you can switch the screens in the main. dart.

Example


Thanks for reading this blog. You can now try it out.

If you want to how to update and delete data ๐Ÿ‘‡ย 

https://medium.com/@nextdevelopment1111/flutter-how-to-update-and-delete-data-in-supabase-part-4-675bf3f8fcbc

If you have any questions, feel free to ask here ๐Ÿ‘‡
Join the Next Dev Discord Server!

Top comments (0)