putString method

Future<void> putString(
  1. String key,
  2. String value
)

保存字符串

Implementation

Future<void> putString(String key, String value) async {
  // obtain shared preferences
  final prefs = await SharedPreferences.getInstance();
  await prefs.setString(key, value);
}