I have encountered an issue where get_storage does not save data when the key starts with an underscore (_). This appears to be a problem specifically with keys that are intended to be private variables. When attempting to save such data, it does not get stored, and retrieving the data later results in a null value.
Steps to Reproduce:
Initialize get_storage.
Try to save data with a key that starts with an underscore, e.g., _privateKey.
Attempt to retrieve the data using the same key.
Expected Behavior:
The data should be saved and retrievable using the key that starts with an underscore.
Actual Behavior:
The data is not saved, and retrieval returns null.
Code Example:
final box = GetStorage();
await box.write('_privateKey', 'someValue');
final value = box.read('_privateKey');
print(value); // Expected output: 'someValue', Actual output: null
Environment:
get_storage version: 2.1.1
Flutter version: 3.19.2
Dart version: ">=3.3.0 <4.0.0"
Platform: (iOS, Android)
Additional Information:
Please let me know if you need any further information or if there are any workarounds for this issue.
I have encountered an issue where
get_storage
does not save data when the key starts with an underscore (_
). This appears to be a problem specifically with keys that are intended to be private variables. When attempting to save such data, it does not get stored, and retrieving the data later results in anull
value.Steps to Reproduce:
get_storage
._privateKey
.Expected Behavior: The data should be saved and retrievable using the key that starts with an underscore.
Actual Behavior: The data is not saved, and retrieval returns
null
.Code Example:
Environment:
Additional Information: Please let me know if you need any further information or if there are any workarounds for this issue.
Thank you!