pushFirstThenFor<T> abstract method

List<Future<T?>> pushFirstThenFor<T>(
  1. BuildContext context,
  2. int numberOfPagesToPush
)

This is similar to pushFor, but is called from the initiator. Internally, we just call pushFirst first, then call pushFor. All methods of awaiting the results mentioned above apply here as well.

dynamicRoutesInitiator.initializeRoutes(...);
 This will push the first page, then push 3 more pages. We are basically pushing a total of 4 pages.
final results = await Future.wait(dynamicRoutesInitiator.pushFirstThenFor(context, 3));

print(results)  //[resultFromFirst, resultFromSecond, resultFromThird, resultFromFourth]

Implementation

List<Future<T?>> pushFirstThenFor<T>(
    BuildContext context, int numberOfPagesToPush);