diff --git a/CHANGELOG.md b/CHANGELOG.md index 41cc7d8..ac220e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 0.1.0 + +* Convert from a Flutter plugin to a pure Dart package; platform-specific code was never used. +* BREAKING: remove the `StackWalletBackup` class and the method channel / platform interface scaffolding, which only exposed `getPlatformVersion`. +* Migrate tests from `flutter_test` to `package:test`. + ## 0.0.1 * TODO: Describe initial release. diff --git a/example/main.dart b/example/main.dart new file mode 100644 index 0000000..f27ff9d --- /dev/null +++ b/example/main.dart @@ -0,0 +1,18 @@ +import 'dart:convert'; +import 'dart:typed_data'; + +import 'package:stack_wallet_backup/stack_wallet_backup.dart'; + +Future main() async { + const String passphrase = 'correct horse battery staple'; + final Uint8List plaintext = + Uint8List.fromList(utf8.encode('A secret message to be backed up')); + + // Encrypt with a passphrase + final Uint8List blob = await encryptWithPassphrase(passphrase, plaintext); + print('Encrypted ${plaintext.length} bytes to a ${blob.length} byte blob'); + + // Decrypt with the same passphrase + final Uint8List decrypted = await decryptWithPassphrase(passphrase, blob); + print('Decrypted: ${utf8.decode(decrypted)}'); +} diff --git a/pubspec.yaml b/pubspec.yaml index 52c0186..f601e72 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,11 +1,10 @@ name: stack_wallet_backup -description: A new Flutter plugin project. -version: 0.0.1 +description: Create and restore secure encrypted backups using a passphrase. +version: 0.1.0 homepage: environment: sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.2" dependencies: collection: ^1.16.0 @@ -13,5 +12,5 @@ dependencies: tuple: ^2.0.0 dev_dependencies: - test: ^1.0.0 + test: ^1.24.0 lints: ^6.0.0