saveey 1.0.0+1 copy "saveey: ^1.0.0+1" to clipboard
saveey: ^1.0.0+1 copied to clipboard

outdated

A comprehensive and secure Saveey package for Flutter, providing robust encryption and decryption capabilities for key-value storage. Safeguard your sensitive data with advanced cryptographic techniqu [...]

example/saveey_example.dart

import 'package:saveey/saveey.dart';

void main() async {
  // Initialize Saveey by providing encryption key and file name
  await Saveey.initialize(
    encryptionKey: 'encryption_key',
    fileName: 'file_name',
  );

  // Store a key-value pair
  await Saveey.setValue('username', 'john_doe');

  // Retrieve the value associated with the key
  final username = Saveey.getValue('username');
  print('Username: $username');

  // Store a list of models (e.g., User models) with optional expiration time
  final List<User> newUsers = await fetchUsersFromApi();
  await Saveey.storeModelList<User>('users_key', newUsers,
      expiration: const Duration(hours: 1));

  // Retrieve the list of users
  final List<User>? storedUsers = Saveey.getModelList<User>('users_key');
  print('Stored Users: $storedUsers');

  // Remove a key-value pair
  await Saveey.removeValue('username');

  // Clear all stored key-value pairs
  await Saveey.clear();
}

// Mock User class for demonstration purposes
class User {
  final String name;
  final int age;

  User(this.name, this.age);

  @override
  String toString() {
    return 'User{name: $name, age: $age}';
  }
}

// Mock function to fetch users from an API
Future<List<User>> fetchUsersFromApi() async {
  // Simulate fetching users from an API
  await Future.delayed(const Duration(seconds: 2));
  return [
    User('Alice', 25),
    User('Bob', 30),
    User('Charlie', 22),
  ];
}
2
likes
0
points
1
downloads

Publisher

unverified uploader

Weekly Downloads

A comprehensive and secure Saveey package for Flutter, providing robust encryption and decryption capabilities for key-value storage. Safeguard your sensitive data with advanced cryptographic techniques, seamlessly integrated into your Flutter applications. Ensure the confidentiality and integrity of your data using Saveey Flutter.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

crypto, encrypt, flutter, path_provider

More

Packages that depend on saveey