isTruthy function

bool isTruthy(
  1. dynamic v
)

Implementation

bool isTruthy(v) =>
    v != null &&
    v != false &&
    v != 0 &&
    v != "" &&
    (v is num ? !v.isNaN : true);