toInt method

int? toInt({
  1. int defValue = 0,
})

转为int类型

Implementation

int? toInt({int defValue = 0}) {
  if (this == null) {
    return null;
  }
  return int.tryParse(this!) ?? defValue;
}