getIntOr static method

int getIntOr(
  1. String key,
  2. int def
)

return int if exists else return def

Implementation

static int getIntOr(
  String key,
  int def,
) =>
    getIntOrNull(key) ?? def;