@@ -74,6 +74,8 @@ class SetStorageAction extends ActionModel
7474 @override
7575 final NumberOperation numberOperation;
7676
77+ final bool skipIfAlreadyExists;
78+
7779 /// Creates a new [SetStorageAction] .
7880 SetStorageAction ({
7981 this .key = 'key' ,
@@ -86,6 +88,7 @@ class SetStorageAction extends ActionModel
8688 this .mapOperation = MapOperation .replace,
8789 this .mapKey = 'key' ,
8890 this .numberOperation = NumberOperation .set ,
91+ this .skipIfAlreadyExists = false ,
8992 }) : super (type: ActionType .setStorage);
9093
9194 /// Duplicates this [SetStorageAction] with given data overrides.
@@ -100,6 +103,7 @@ class SetStorageAction extends ActionModel
100103 MapOperation ? mapOperation,
101104 String ? mapKey,
102105 NumberOperation ? numberOperation,
106+ bool ? skipIfAlreadyExists,
103107 }) {
104108 // final String? sanitizedValue = value == null
105109 // ? null
@@ -116,6 +120,7 @@ class SetStorageAction extends ActionModel
116120 mapOperation: mapOperation ?? this .mapOperation,
117121 mapKey: mapKey ?? this .mapKey,
118122 numberOperation: numberOperation ?? this .numberOperation,
123+ skipIfAlreadyExists: skipIfAlreadyExists ?? this .skipIfAlreadyExists,
119124 );
120125 }
121126
@@ -131,6 +136,7 @@ class SetStorageAction extends ActionModel
131136 mapOperation,
132137 mapKey,
133138 numberOperation,
139+ skipIfAlreadyExists,
134140 ];
135141
136142 /// Creates a new [SetStorageAction] instance from a JSON data.
0 commit comments