getSharedPreferences method

Future<SharedPreferences> getSharedPreferences (String name, [ int mode = 0 ])

Retrieves and holds the contents of the preferences file name, returning a SharedPreferences through which you can retrieve and modify its values.

For compatibility with the shared_preferences Flutter plugin, use the name "FlutterSharedPreferences".

See: https://developer.android.com/reference/android/content/Context#getSharedPreferences(java.lang.String,%20int)

Implementation

static Future<SharedPreferences> getSharedPreferences(final String name,
    [final int mode = 0]) {
  return SharedPreferences.open(name, mode);
}