getString static method

Future<String> getString(
  1. String key
)

Implementation

static Future<String> getString(String key) async {
  final SharedPreferences prefs = await SharedPreferences.getInstance();
  final String? preferences = prefs.getString(key);
  if (preferences != null) {
    return preferences;
  } else {
    return '';
  }
}