Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove All #15

Open
Raymundo94 opened this issue Mar 11, 2022 · 2 comments
Open

Remove All #15

Raymundo94 opened this issue Mar 11, 2022 · 2 comments

Comments

@Raymundo94
Copy link

How can I remove all storage?

@Dharm23
Copy link

Dharm23 commented Jun 25, 2022

Hello @Raymundo94 , try the following code to remove all

Future deleteAll() async {
final _db = Localstore.instance;
//todos is your table name
Map? allTodoList = await _db.collection('todos').get();
if (allTodoList != null) {
for (var itemId in allTodoList.keys) {
//todos is your table name
itemId = itemId.toString().replaceAll('/todos/', '');
await _db.collection('todos').doc(itemId).delete();
}
}
}

@chuyentt
Copy link
Owner

chuyentt commented Dec 1, 2022

@Raymundo94 we added the delete collection in version 1.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants