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

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:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_provider/flutter_provider.dart';
import 'package:rx_shared_preferences/rx_shared_preferences.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized();

  /// Singleton instance for app
  final rxPrefs = RxSharedPreferences(
    SharedPreferences.getInstance(),
    kReleaseMode ? null : const RxSharedPreferencesDefaultLogger(),
  );

  runApp(
    Provider.value(
      rxPrefs,
      child: const MyApp(),
    ),
  );
}

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'RxSharedPreferences example',
      theme: ThemeData.dark(),
      home: const MyHomePage(),
    );
  }
}
75
likes
160
points
3.93k
downloads

Publisher

unverified uploader

Weekly Downloads

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
Contributing

Topics

#rxdart #hoc081098 #rx-shared-preferences #reactive-shared-preferences #reactive-programming

Documentation

API reference

Funding

Consider supporting this project:

www.buymeacoffee.com

License

MIT (license)

Dependencies

flutter, meta, rx_storage, shared_preferences

More

Packages that depend on rx_shared_preferences