Skip to main content

unified_local_data_isar 1.0.0 copy "unified_local_data_isar: ^1.0.0" to clipboard
unified_local_data_isar: ^1.0.0 copied to clipboard

The Isar engine for unified_local_data. Keeps the same storage API on Isar Community, with real transactions and native @collection access.

example/lib/main.dart

import 'package:flutter/widgets.dart';
import 'package:path_provider/path_provider.dart';
import 'package:unified_local_data_isar/unified_local_data_isar.dart';

/// Stores and reads a few values through the Isar engine.
Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  final dir = await getApplicationDocumentsDirectory();

  final db = await UnifiedDataSourceFactory.create(
    IsarDataSourceConfig(directory: dir.path),
  );

  // Both writes commit together, or neither does.
  await db.transaction(() async {
    await db.put<String>('settings', 'theme', 'dark');
    await db.put<int>('settings', 'launches', 1);
  });

  final theme = await db.get<String>('settings', 'theme');
  debugPrint('Stored theme: $theme'); // Stored theme: dark
}
0
likes
160
points
41
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

The Isar engine for unified_local_data. Keeps the same storage API on Isar Community, with real transactions and native @collection access.

Repository (GitHub)
View/report issues

Topics

#database #storage #isar #offline #persistence

License

MIT (license)

Dependencies

flutter, isar_community, isar_community_flutter_libs, unified_local_data

More

Packages that depend on unified_local_data_isar