DEV Community

Cover image for Building a simple Grocery App in Flutter with Supabase

Building a simple Grocery App in Flutter with Supabase

Carlo Miguel Dy on April 30, 2021

Introduction In this article I will show you how you can build an application using Flutter with Supabase as a backend. Supabase is a Fi...
Collapse
 
meredigr profile image
meredigr

Thanks for posting this, Carlo. I have downloaded the app from the repository and have followed the instructions for creating the tables in Supabase, but when I try and register a new user I get an 'Null check operator used on a null value' on line 48 of the sign_up_viewmodel.dart. If I run in debug mode it appears the user value returned from the 'final user = await _authService.signUp(' is null. I am unsure why this is happening, and am new to both Flutter and Supabase so am struggling to establish what I might have done wrong, as I have not modified your code in any way except to put my Supabase credentials into the supabase_api.dart file. I am also confused by one thing - the data model shows the app_users table without a password field, yet the sign-up screen expects this field. You also state that this table 'will have the same primary ID with the supabase auth users.' Does this mean the two tables are linked in some way, and is the password field intended to be stored in the encrypted_password field in the users table in the auth schema? If you have any suggestions as to how I should resolve this problem or further debug this issue I would be most grateful! Thanks very much. Regards, Guy

Collapse
 
meredigr profile image
meredigr

I notice that records for the users I try and register are being created in the users table in the auth schema in Supabase, but do not get created in the app_users table.

Collapse
 
meredigr profile image
meredigr

Please don't worry about responding, I found the issue. I had to disable the "Email Confirmations" option on the Email section of the Auth Providers, after which it worked.

Collapse
 
ctechdev profile image
ctechdev

Can you suggest me some good resources to learn this syntax?
.select(", grocery_products(, products(*) )")
I can't find good explanatory material

Collapse
 
carlomigueldy profile image
Carlo Miguel Dy

I can't find any too. But I'll create a tutorial for that. Stay tuned my friend!

Collapse
 
ctechdev profile image
ctechdev
Thread Thread
 
carlomigueldy profile image
Carlo Miguel Dy

Wow, cool. Thanks for sharing it!

Collapse
 
jhqcat profile image
Jacob Marshall

How did you make your database picture? It is really cool.

Collapse
 
carlomigueldy profile image
Carlo Miguel Dy

Got that from here drawsql.app/

Collapse
 
jhqcat profile image
Jacob Marshall

Thank you

Collapse
 
oiojin831 profile image
Eung Jin Lee

Thanks for the great article.
What is a program name for the diagram?