isPrimitive function

bool isPrimitive (dynamic value)

Checks if the value is primitive (String, number, boolean or null)

Implementation

bool isPrimitive(value) => value is String || value is num || value is bool || value == null;