I am new to dart. I want to do something like this. But editor says it is 'unnecessary_null_comparison'. What is the best way in dart to do something like this?
EventType? et = dbHandler.getEventType(widget.eventName) as EventType;
if (et != null) {
dbHandler.insertEventType(eventType);
}