string method

Future<String?> string(
  1. String key, [
  2. String? data
])

Implementation

Future<String?> string(String key, [String? data]) async {
  final shared = await this;
  if (data.isNotNullOrBlank) {
    await shared.setString(key, data!);
    return data;
  } else {
    return shared.get(key)?.toString();
  }
}