@@ -24,6 +24,8 @@ abstract class LocalStorage {
2424 ///
2525 /// It's not required in the case of [LocalStorageWithFlutterSecureStorage] .
2626 ///
27+ /// Throws an assertion error if [collectionName] exists already.
28+ ///
2729 /// Example:
2830 /// ```dart
2931 /// LocalStorage.add('posts');
@@ -37,7 +39,11 @@ abstract class LocalStorage {
3739 ///
3840 /// To create a single key-value pair pass the [key] and the [value] as String, the
3941 /// String could be a JSON String or a simple text according to your requirement.
40- /// If the key is already present in the [LocalStorage] an assertion error will be thrown.
42+ ///
43+ /// Throws an assertion error if the key is already present in the [LocalStorage] or
44+ /// [collectionName] is not added.
45+ ///
46+ /// Try [LocalStorage.createOrUpdate] , [LocalStorage.update] .
4147 ///
4248 /// Example:
4349 ///
@@ -60,8 +66,11 @@ abstract class LocalStorage {
6066 /// Creates new items in the[collectionName] of [LocalStorage] .
6167 /// If you want to create multiple entries pass the [values] as a Map<String, String>, then it
6268 /// will create all the key-value pairs from the [values] map.
63- /// If any key from the [values] is already present in the [LocalStorage] an assertion error will
64- /// be thrown.
69+ ///
70+ /// Throws an assertion error if the key is already present in the [LocalStorage] or
71+ /// [collectionName] is not added.
72+ ///
73+ /// Try [LocalStorage.createOrUpdateMany] , [LocalStorage.updateMany] .
6574 ///
6675 /// Example:
6776 ///
@@ -101,7 +110,10 @@ abstract class LocalStorage {
101110 /// Reads the value of the item at [key] from the [LocalStorage] and returns the value.
102111 ///
103112 /// Read a single value by passing [key] as String, it will return the value as String?.
104- /// If the [key] already exists an assertion error will be thrown.
113+ ///
114+ /// Throws an assertion error if [key] already exists or [collectionName] is not added.
115+ ///
116+ /// Try [LocalStorage.createOrUpdateMany] , [LocalStorage.updateMany] .
105117 ///
106118 /// Example:
107119 /// ```dart
@@ -148,7 +160,11 @@ abstract class LocalStorage {
148160
149161 /// Updates an item in [collectionName] of the [LocalStorage] .
150162 ///
151- /// To update a single key-value pair pass the [key] and the [value] as String, the
163+ /// To update a single key-value pair pass the [key] and the [value] as String.
164+ ///
165+ /// Throws asserstion error if [key] does not exists or [collectionName] is not added.
166+ ///
167+ /// Try [LocalStorage.createOrUpdate] , [LocalStorage.create] .
152168 ///
153169 /// Example:
154170 /// ```dart
@@ -167,6 +183,10 @@ abstract class LocalStorage {
167183 /// If you want to update multiple entries pass the [values] as a Map<String, String>, then it
168184 /// will update all the key-value pairs in the [values] map.
169185 ///
186+ /// Throws asserstion error if [key] does not exists or [collectionName] is not added.
187+ ///
188+ /// Try [LocalStorage.createOrUpdateMany] , [LocalStorage.createMany] .
189+ ///
170190 /// Example:
171191 /// ```dart
172192 /// await LocalStorage.updateMany(
@@ -191,8 +211,7 @@ abstract class LocalStorage {
191211
192212 /// Creates or updates an item in [collectionName] of [LocalStorage] .
193213 ///
194- /// To create or update a single key-value pair pass the [key] and the [value] as String, the
195- /// If the [key] is already present in the [LocalStorage] it's value will be overwritten.
214+ /// To create or update a single key-value pair pass the [key] and the [value] as String.
196215 ///
197216 /// Example:
198217 /// ```dart
@@ -210,7 +229,7 @@ abstract class LocalStorage {
210229 /// Creates or updates items in [collectionName] of [LocalStorage] .
211230 /// If you want to create or update multiple entries pass the [values] as a Map<String, String>, then it
212231 /// will create all the key-value pairs from the [values] map.
213- /// If any key from the [values] is already present in the [LocalStorage] it's value will be
232+ /// If any key from the [values] is already present in the [collectionName] of [ LocalStorage] it's value will be
214233 /// overwritten.
215234 ///
216235 /// Example:
0 commit comments