storage_inspector 0.1.6 copy "storage_inspector: ^0.1.6" to clipboard
storage_inspector: ^0.1.6 copied to clipboard

outdated

A flutter plugin that facilitates inspection and modification of 'local storage' inside a flutter app

example/example.dart

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

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

  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);

  final fileServer = DefaultFileServer(_documentsDirectory(), 'App Documents');
  driver.addFileServer(fileServer);

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

  // run app

  await driver.stop(); //Optional when main ends
}

//Use path_provider to provide this
String _documentsDirectory() {
  return '.';
}
18
likes
0
pub points
87%
popularity

Publisher

verified publisherchimerapps.com

A flutter plugin that facilitates inspection and modification of 'local storage' inside a flutter app

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

async, dart_service_announcement, flutter, flutter_secure_storage, path, shared_preferences, synchronized, tuple, uuid

More

Packages that depend on storage_inspector