toNumber method

num? toNumber({
  1. num defValue = 0,
})

转为num类型

Implementation

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