Skip to content

Commit edbc89c

Browse files
Merge pull request #20 from sneurlax/plugin-to-package
Plugin to package nits
2 parents c84ab58 + 05188c9 commit edbc89c

3 files changed

Lines changed: 27 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 0.1.0
2+
3+
* Convert from a Flutter plugin to a pure Dart package; platform-specific code was never used.
4+
* BREAKING: remove the `StackWalletBackup` class and the method channel / platform interface scaffolding, which only exposed `getPlatformVersion`.
5+
* Migrate tests from `flutter_test` to `package:test`.
6+
17
## 0.0.1
28

39
* TODO: Describe initial release.

example/main.dart

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import 'dart:convert';
2+
import 'dart:typed_data';
3+
4+
import 'package:stack_wallet_backup/stack_wallet_backup.dart';
5+
6+
Future<void> main() async {
7+
const String passphrase = 'correct horse battery staple';
8+
final Uint8List plaintext =
9+
Uint8List.fromList(utf8.encode('A secret message to be backed up'));
10+
11+
// Encrypt with a passphrase
12+
final Uint8List blob = await encryptWithPassphrase(passphrase, plaintext);
13+
print('Encrypted ${plaintext.length} bytes to a ${blob.length} byte blob');
14+
15+
// Decrypt with the same passphrase
16+
final Uint8List decrypted = await decryptWithPassphrase(passphrase, blob);
17+
print('Decrypted: ${utf8.decode(decrypted)}');
18+
}

pubspec.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
name: stack_wallet_backup
2-
description: A new Flutter plugin project.
3-
version: 0.0.1
2+
description: Create and restore secure encrypted backups using a passphrase.
3+
version: 0.1.0
44
homepage:
55

66
environment:
77
sdk: ">=3.0.0 <4.0.0"
8-
flutter: ">=3.10.2"
98

109
dependencies:
1110
collection: ^1.16.0
1211
cryptography: ^2.0.5
1312
tuple: ^2.0.0
1413

1514
dev_dependencies:
16-
test: ^1.0.0
15+
test: ^1.24.0
1716
lints: ^6.0.0

0 commit comments

Comments
 (0)