isPrimitive function

bool isPrimitive(
  1. Object? value
)

Whether the value is a primitive value: a string, a boolean or a finite number.

Implementation

bool isPrimitive(Object? value) =>
    value is String || value is bool || (value is num && value.isFinite);