Flutter Provider Loading With Multiple Futures

144 views Asked by At

So when my app is loading, I load multiple providers that get data from Firebase Firestore. The second one relies on data from the first one. How should I go about loading the data from the first one, then once that's complete, loading the data for the second one, then displaying the app. Should I nest a few FutureBuilders together? That sounds messy. Any ideas? Thanks!

MultiProvider(
        providers: [
          ChangeNotifierProvider<UserState>(create: (_) => UserState()),
          ChangeNotifierProvider<JournalsState>(
              create: (_) => JournalsState(
                  Provider.of<UserState>(context, listen: false)
                      .firebaseUser
                      .uid)),
        ],
        child: ...
0

There are 0 answers