isDigit property

bool get isDigit

Checks if this string is digit only.

Example: '123456'.isDigit -> true.

Implementation

bool get isDigit => RegExp(r'^[0-9]+$').hasMatch(this);