toInt method

int? toInt({
  1. int? defaultValue,
})

Parse this string as a, possibly signed, integer literal and return its value.

Implementation

int? toInt({int? defaultValue}) {
  final String? _copy = this;
  if (_copy == null) {
    return defaultValue;
  }
  return int.tryParse(_copy) ?? defaultValue;
}