Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///
- ///metodo per ottenere la beonlist dell'utente
- ///
- Future createBeonList() async {
- newBeonListUser = [];
- var beonIdFromStorage = [];
- if (window.localStorage.containsKey('beonListiD')) {
- if (window.localStorage['beonListiD'].length > 1) {
- beonIdFromStorage = window.localStorage['beonListiD'].split(',');
- } else {
- beonIdFromStorage.add(window.localStorage['beonListiD']);
- }
- beonIdFromStorage = window.localStorage['beonListiD'].split(',');
- }
- if (beonListIdUser.isEmpty) {
- beonListIdUser = beonIdFromStorage;
- }
- var productInBeon = await db.collection('Product').get();
- beonListIdUser.forEach((beonId) {
- productInBeon.forEach((doc) {
- if (doc.id == beonId) {
- newBeonListUser.add(ProductInBeon(
- doc.id, doc.data()['Name'], doc.data()['PhotoURL']));
- }
- });
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement