getInt method

int getInt(
  1. String key, {
  2. int defaultValue = 0,
})

Retrieve a 32-bit int value for key.

If the key does not exist the defaultValue is returned.

Parameters

  • key: The key to look up.
  • defaultValue: Value returned when the key is missing (defaults to 0).

Returns

  • The stored integer value, or defaultValue if not found.

Also see:

  • setInt: to store a integer value.

Implementation

int getInt(final String key, {int defaultValue = 0}) {
  final OperationResult resultString = objectMethod(
    pointerId,
    'SettingsService',
    'getValueInt',
    args: <String, dynamic>{'first': key, 'second': defaultValue},
  );

  return resultString['result'];
}