shouldNull function

bool shouldNull(
  1. Object? obj,
  2. String errmsg
)

Assert if obj not exists, otherwise throw error message.

Implementation

bool shouldNull(Object? obj, String errmsg) {
  if (obj != null) throw FlutterError(errmsg);
  return true;
}