DEV Community

Cover image for Flutter: πŸ”΄ How to Create and Read data || Future Builder || Partβ€Š-β€Š3
Next Dev
Next Dev

Posted on • Edited 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)