Bunthong K
Bunthong K

Reputation: 134

How to access a parameter of a function in another function?

so i have been trying to create a dynamic firestore collection based on a paremeter of a function, but I want to access it in another function altho i do not know how.

Here is the first function that create the collection :

enter image description here

And here is the second function that I want to access title from :

enter image description here

Any help is very much appreciated ! Thank you!

CODE :

Future updateBooksData(String category, String title, String author,
      String numberOfPages, String description) async {
    return await subBookCollection.collection(title).doc(uid).set(
      {
        'category': category,
        'title': title,
        'author': author,
        'numberOfPages': numberOfPages,
        'description': description,
      },
    );
  }

  Future getBooksData() async {
    return subBookCollection.collection(title).get();
  }

Upvotes: 0

Views: 28

Answers (1)

Haree Prasad
Haree Prasad

Reputation: 91

pass the parameter to Future getBooksData(var title)

Upvotes: 3

Related Questions