Since you define the _id as non-nullable, it will always generate the id with an empty string "". The solution is to make it optional, hence String?, and remove the default value.