digits property

List<int> get digits

Individual digits, most-significant first.

1234.digits; // [1, 2, 3, 4]

Implementation

List<int> get digits =>
    toString().replaceAll('-', '').split('').map(int.parse).toList();