getBool method

bool getBool(
  1. String key, {
  2. bool defaultValue = false,
})

Retrieve a bool 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 false).

Returns

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

Also see:

  • setBool: to store a boolean value.

Implementation

bool getBool(final String key, {bool defaultValue = false}) {
  final OperationResult resultString = objectMethod(
    pointerId,
    'SettingsService',
    'getValueBool',
    args: <String, dynamic>{'first': key, 'second': defaultValue},
  );

  return resultString['result'];
}