Browse Source

make credentials changable.

pull/5/head
Herbert Poul 3 years ago
parent
commit
cb11abef41
  1. 3
      CHANGELOG.md
  2. 14
      lib/src/kdbx_file.dart

3
CHANGELOG.md

@ -1,7 +1,8 @@
## 2.3.0
## 2.3.0 (unreleased)
- Mark objects only as clean when saving was successful.
- Only mark objects as clean if they have not been modified since we started saving.
- Make credentials changeable.
## 2.2.0

14
lib/src/kdbx_file.dart

@ -22,7 +22,12 @@ typedef FileSaveCallback<T> = Future<T> Function(Uint8List bytes);
class KdbxFile {
KdbxFile(
this.ctx, this.kdbxFormat, this.credentials, this.header, this.body) {
this.ctx,
this.kdbxFormat,
this._credentials,
this.header,
this.body,
) {
for (final obj in _allObjects) {
obj.file = this;
}
@ -41,7 +46,12 @@ class KdbxFile {
final KdbxFormat kdbxFormat;
final KdbxReadWriteContext ctx;
final Credentials credentials;
Credentials get credentials => _credentials;
set credentials(Credentials credentials) {
body.meta.modify(() => _credentials = credentials);
}
Credentials _credentials;
final KdbxHeader header;
final KdbxBody body;
final Set<KdbxObject> dirtyObjects = {};

Loading…
Cancel
Save