# getProperty abstract method

String? getProperty(

1. String key, [
2. String? defaultValue

])
inherited

Retrieves the value for the given property `key`, or `null` if not found.

If `defaultValue` is provided, it returns the default value instead of null.

Equivalent to: `getProperty(key) ?? defaultValue`.

### Example:

    final dbUrl = resolver.getProperty('database.url');
    final dbUrl = resolver.getProperty('database.url', 'localhost');

See also:

- `getPropertyWithDefault`
- `getRequiredProperty`

## Implementation

    String? getProperty(String key, [String? defaultValue]);