rx_shared_preferences 1.3.2 copy "rx_shared_preferences: ^1.3.2" to clipboard
rx_shared_preferences: ^1.3.2 copied to clipboard

outdated

Rxdart streaming shared preferences. Reactive stream rxdart wrapper around SharedPreferences. A stream based wrapper over shared_preferences, allowing reactive key-value storage.

example/lib/main.dart

import 'package:example/home.dart';
import 'package:example/loggers.dart';
import 'package:example/rx_prefs_provider.dart';
import 'package:flutter/material.dart';
import 'package:rx_shared_preferences/rx_shared_preferences.dart';
import 'package:shared_preferences/shared_preferences.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized();

  /// Singleton instance for app
  final rxPrefs = RxSharedPreferences(
    SharedPreferences.getInstance(),
    defaultLogger,
  );
  runApp(
    RxPrefsProvider(
      rxPrefs: rxPrefs,
      child: MyApp(),
    ),
  );
}

class MyApp extends StatelessWidget {
  const MyApp({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Rx Shared Preferences example',
      theme: ThemeData.dark(),
      home: const MyHomePage(),
    );
  }
}
74
likes
0
pub points
94%
popularity

Publisher

unverified uploader

Rxdart streaming shared preferences. Reactive stream rxdart wrapper around SharedPreferences. A stream based wrapper over shared_preferences, allowing reactive key-value storage.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, rxdart, shared_preferences

More

Packages that depend on rx_shared_preferences