skip to Main Content

Getting this null check error, despite having null safety through out the code.
I’m attaching a git repo
https://github.com/HidayatBukhari01/Notes-App.git
can someone please check this code and explain why am i having this errorenter image description here

On clicking + icon data should have been inserted into notes table, instead it’s throwing null safety error!.

2

Answers


  1. You need to check, if the value becomes null, if it does, the above error is evident. Else, you need to put the "?" operator, before the variable or function where the above error occurs, as –

    type ?<varname> = <Text here>.
    

    Even I am new to Flutter. if you get this error resolved, great, else check out on other’s answers

    Login or Signup to reply.
  2. I went through your code and here is the mistake you done

    dbHelper!
    

    Here you said that said that dbHelper is not null but the value its getting is null and before calling this check its value in console first,
    and use it like this only

    dbHelper
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search