Flutter: Failed assertion: boolean expression must not be null
问题 In flutter, I call a value from Firestore cloud database by using future and try to assigning this value to a variable. Here is my code: import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:flutter/material.dart'; class Gyanpothro extends StatefulWidget { @override _GyanpothroState createState() => _GyanpothroState(); } class _GyanpothroState extends State<Gyanpothro> { Firestore db = Firestore.instance; Future databaseFuture; @override void initState() { databaseFuture = db