toNum method

num toNum({
  1. num def = -1,
})

Implementation

num toNum({num def = -1}) {
  return num.tryParse(str()) ?? def;
}