diff --git a/lib/src/kdbx_dao.dart b/lib/src/kdbx_dao.dart index 2868273..6eaabe7 100644 --- a/lib/src/kdbx_dao.dart +++ b/lib/src/kdbx_dao.dart @@ -10,7 +10,7 @@ extension KdbxDao on KdbxFile { @required String name, }) { assert(parent != null, name != null); - final newGroup = KdbxGroup.create(parent: parent, name: name); + final newGroup = KdbxGroup.create(ctx: ctx, parent: parent, name: name); parent.addGroup(newGroup); return newGroup; } diff --git a/lib/src/kdbx_entry.dart b/lib/src/kdbx_entry.dart index b1368a6..8c66847 100644 --- a/lib/src/kdbx_entry.dart +++ b/lib/src/kdbx_entry.dart @@ -36,7 +36,7 @@ class KdbxEntry extends KdbxObject { KdbxEntry.create(KdbxFile file, KdbxGroup parent) : isHistoryEntry = false, history = [], - super.create(file, 'Entry', parent) { + super.create(file.ctx, file, 'Entry', parent) { icon.set(KdbxIcon.Key); } diff --git a/lib/src/kdbx_format.dart b/lib/src/kdbx_format.dart index a399706..a0b796e 100644 --- a/lib/src/kdbx_format.dart +++ b/lib/src/kdbx_format.dart @@ -305,7 +305,7 @@ class KdbxFormat { ctx: ctx, generator: generator, ); - final rootGroup = KdbxGroup.create(parent: null, name: name); + final rootGroup = KdbxGroup.create(ctx: ctx, parent: null, name: name); final body = KdbxBody.create(meta, rootGroup); return KdbxFile( ctx, diff --git a/lib/src/kdbx_group.dart b/lib/src/kdbx_group.dart index ac68d77..95be33b 100644 --- a/lib/src/kdbx_group.dart +++ b/lib/src/kdbx_group.dart @@ -8,8 +8,12 @@ import 'package:xml/xml.dart'; import 'kdbx_object.dart'; class KdbxGroup extends KdbxObject { - KdbxGroup.create({@required KdbxGroup parent, @required String name}) + KdbxGroup.create( + {@required KdbxReadWriteContext ctx, + @required KdbxGroup parent, + @required String name}) : super.create( + ctx, parent?.file, 'Group', parent, diff --git a/lib/src/kdbx_object.dart b/lib/src/kdbx_object.dart index dcdc3fb..1c858a9 100644 --- a/lib/src/kdbx_object.dart +++ b/lib/src/kdbx_object.dart @@ -71,8 +71,9 @@ abstract class KdbxNode with Changeable { } abstract class KdbxObject extends KdbxNode { - KdbxObject.create(this.file, String nodeName, KdbxGroup parent) - : times = KdbxTimes.create(file.ctx), + KdbxObject.create( + KdbxReadWriteContext ctx, this.file, String nodeName, KdbxGroup parent) + : times = KdbxTimes.create(ctx), _parent = parent, super.create(nodeName) { _uuid.set(KdbxUuid.random());