asInt method

int asInt({
  1. int? def,
})

Implementation

int asInt({int? def}) {
  return int.tryParse(this.toString()) ?? def ?? 0;
}