prefs 3.3.0
prefs: ^3.3.0 copied to clipboard

A Library Package that utilizes the plugin, shared_preferences, to store and read an app’s preferences in both the Android and the iOS platform.

example/main.dart

import 'package:flutter/material.dart';

import 'package:prefs/prefs.dart';

void main() {
  runApp(MaterialApp(
    home: Scaffold(
      body: Center(
        child: ElevatedButton(
          onPressed: _incrementCounter,
          child: Text('Increment Counter'),
        ),
      ),
    ),
  ));
}

_incrementCounter() async {
  int counter = await Prefs.getIntF('counter');
  counter = counter + 1;
  print('Pressed $counter times.');
  Prefs.setInt('counter', counter);
}
10
likes
130
pub points
85%
popularity

Publisher

andrioussolutions.com

A Library Package that utilizes the plugin, shared_preferences, to store and read an app’s preferences in both the Android and the iOS platform.

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache 3.0 (LICENSE)

Dependencies

flutter, shared_preferences, shared_preferences_web

More

Packages that depend on prefs