mynotes-course icon indicating copy to clipboard operation
mynotes-course copied to clipboard

Uncaught Error: Unexpected null value.

Open Mkay-coder opened this issue 3 years ago • 6 comments

Uncaught Error: Unexpected null value. And not updating the list view i.e. ListView is empty

Mkay-coder avatar Jul 14 '22 07:07 Mkay-coder

Hey did you get the solution ? my mistake was I didn't put the constants for sqflite properly like ` const dbName = 'notecrs.db'; const noteTable = 'notes'; const userTable = 'user'; const idColumn = 'id'; const emailColumn = "email"; const UserIdColumn = "userId"; const textColumn = 'text'; const createNoteTable = ''' CREATE TABLE IF NOT EXISTS "notes" ( "id" INTEGER NOT NULL, "userId" INTEGER NOT NULL, "text" TEXT, PRIMARY KEY("id"), FOREIGN KEY("userId") REFERENCES "user"("id") ); ''';

const createUserTable = '''CREATE TABLE IF NOT EXISTS "user" ( "id" INTEGER NOT NULL, "email" INTEGER NOT NULL UNIQUE, PRIMARY KEY("id" AUTOINCREMENT) ); '''; `

I had put const UserIdColumn = "user_Id";

akashgreninja avatar Oct 30 '22 05:10 akashgreninja

At which stage of the course did this error occur?

rt234cw avatar Feb 24 '23 10:02 rt234cw

I faced the same problem , expected DatabaseNote but received null value. The problem i believe is in the DB thing mainly because i was running chrome/edge web as my web device, but the path provider is actually made for Android (i did't try it yet on an iphone) I tried to run on pixel emulator, and finally it works great :) i hope this helps and no words can express how thankfull am I to Mr. Nahavandipoor @vandadnp . Thanks T @Mkay-coder it was step 14, i.e. chapter 31 @rt234cw

tameralshazly avatar Jun 08 '23 21:06 tameralshazly

@tameralshazly
Does Firebase support chrome and edge? When I was trying to run the app on these two, it always showed up some issues about Firebase. But all systems work well on android phone and emulator.

rt234cw avatar Jun 09 '23 02:06 rt234cw

@tameralshazly Does Firebase support chrome and edge? When I was trying to run the app on these two, it always showed up some issues about Firebase. But all systems work well on android phone and emulator.

it works very well. i am using the chrome/ web. but there are some errors when it comes to the chrome or web. best if you use the emulator or android phone.

jayavardhanjv avatar Jul 16 '23 13:07 jayavardhanjv

I faced the same problem , expected DatabaseNote but received null value. The problem i believe is in the DB thing mainly because i was running chrome/edge web as my web device, but the path provider is actually made for Android (i did't try it yet on an iphone) I tried to run on pixel emulator, and finally it works great :) i hope this helps and no words can express how thankfull am I to Mr. Nahavandipoor @vandadnp . Thanks T @Mkay-coder it was step 14, i.e. chapter 31 @rt234cw

I'm having the same issue in Chapter 31, and also running app on web (chrome), instead of an android phone, as per demo. It seems that code implemented in this chapter is tailored to smart phone devices, rather than a web app. Is there a version of code that works on the web?

athyg avatar Oct 31 '23 20:10 athyg