In the sqlite table i have null columns. I made a query to get all data from specific column and map its data into List<Map<String, dynamic>>:
List<Map<String, dynamic>> maps = List();
final db = await database;
var result = await db.query('tools_table', where: 'LifeCycle <> 2');
result.forEach((val) {
maps.add(val);
});
but null column converted into the "null" and when i want to deserialize list of map into object :
ToolsModel.fromJson(Map<String, dynamic> json) {
...
if (json['triggerImagesUrl'] != null) {
triggerImagesUrl = List<String>();
var job = jsonDecode(json['triggerImagesUrl']);
job.forEach((v) {
triggerImagesUrl.add(v);
});
}
I got error because json['TriggerUrl'] is nut null, it is "null" and var job = jsonDecode(json['TriggerUrl']); job be a null and job.forEach cause e exception.
Why null column is converted to the "null" and how can i prevent of this action ?