asNum property Null safety

num asNum

Asserts that value exists and is a number and returns it.

asNumOr may be used to provide a default value instead of rejecting the request if value doesn't exist.

Implementation

num get asNum => _getTyped('a number', (value) => value is num);