user_preferences 0.1.1+4 copy "user_preferences: ^0.1.1+4" to clipboard
user_preferences: ^0.1.1+4 copied to clipboard

This is a port of Android SharedPreferences, providing, a persistent store for simple data. Data is persisted to disk asynchronously.

example/example.dart

// File created by
// Lung Razvan <long1eu>
// on 2018-12-03

import 'dart:io';

import 'package:user_preferences/user_preferences.dart';

void main() async {
  // Initialize the default value, after this I can use UserPreferences.instance
  await UserPreferences.init(Directory('/some/directory/that/I/can/use'));

  final String name = UserPreferences.instance.getString('name', 'Mike');
  print('My name is $name/');

  UserPreferences.instance.edit()
    ..putString('name', 'Joe')
    ..apply();
}
0
likes
40
pub points
18%
popularity

Publisher

unverified uploader

This is a port of Android SharedPreferences, providing, a persistent store for simple data. Data is persisted to disk asynchronously.

Repository (GitHub)
View/report issues

License

BSD-2-Clause (LICENSE)

Dependencies

path

More

Packages that depend on user_preferences