preferences_local_storage_inspector 0.4.0 copy "preferences_local_storage_inspector: ^0.4.0" to clipboard
preferences_local_storage_inspector: ^0.4.0 copied to clipboard

Local storage inspector bindings for shared preferences based storage

example/example.dart

import 'package:flutter/material.dart';
import 'package:preferences_local_storage_inspector/preferences_local_storage_inspector.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:storage_inspector/storage_inspector.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  // ignore: avoid_print
  storageInspectorLogger = (e) => print(e);

  final preferences = await SharedPreferences.getInstance();

  final driver = StorageServerDriver(
    bundleId: 'com.example.test',
    icon: '<some icon>',
  );
  final keyValueServer =
      PreferencesKeyValueServer(preferences, 'Preferences', keySuggestions: {
    const ValueWithType(StorageType.string, 'testBool'),
    const ValueWithType(StorageType.string, 'testInt'),
    const ValueWithType(StorageType.string, 'testFloat'),
  });
  driver.addKeyValueServer(keyValueServer);

  // Don't wait for a connection from the instrumentation driver
  await driver.start(paused: false);

  // run app
  await Future<void>.delayed(const Duration(minutes: 15));

  await driver.stop(); //Optional when main ends
}
4
likes
140
pub points
73%
popularity

Publisher

verified publisherchimerapps.com

Local storage inspector bindings for shared preferences based storage

Repository (GitHub)
View/report issues

Documentation

API reference

Funding

Consider supporting this project:

github.com
ko-fi.com

License

MIT (LICENSE)

Dependencies

flutter, shared_preferences, storage_inspector, tuple, uuid

More

Packages that depend on preferences_local_storage_inspector