getString method

  1. @override
Future<String?> getString(
  1. String key,
  2. SharedPreferencesOptions options
)
override

Retrieves the String value associated with the key, if any.

Throws a TypeError if the returned type is not a String. May return null for unsupported types.

Implementation

@override
Future<String?> getString(
  String key,
  SharedPreferencesOptions options,
) async {
  final Map<String, Object> data = await _readAll(<String>{key}, options);
  return data[key] as String?;
}