Assert if obj exists, otherwise throw error message.
bool shouldExists(Object? obj, String errmsg) { if (obj == null) throw FlutterError(errmsg); return true; }