number method

int number()

The digits as an int (0 when null). "Order #42" → 42

Implementation

int number() => (this ?? "0").replaceAll(RegExp("[^0-9]"), "").toInt();