Как взять данные с DocumentSnapshot

Просмотрел видео с youtube как взять данные с firebase. Видео было показа как вывести в консоль данные, а как взять их нет.Вот хотел узнать как это можно сделать.

final userRef = FirebaseFirestore.instance.collection('users');
  var user;

  @override
  void initState() {
    getUser();
    super.initState();
  }

  getUser() async {
    final String uid = currentUser.user.uid;
    final DocumentSnapshot doc = await userRef.doc(uid).get();
    user = doc.data();

    print(doc.data());
  }

Ответы (0 шт):