pumpSequence method

Future<void> pumpSequence(
  1. NvGoldenSingular nvGolden
)

Pumps the initial Widget for a Sequence. Needs to be called before the first createSequenceGolden call in your test.

Implementation

Future<void> pumpSequence(NvGoldenSingular nvGolden) async {
  final widget = MaterialApp(
    key: nvGolden.uniqueKey,
    home: DefaultAssetBundle(
      bundle: TestAssetBundle(),
      child: nvGolden.wrap?.call(nvGolden.widget) ?? nvGolden.widget,
    ),
    debugShowCheckedModeBanner: false,
  );
  final screenSize = nvGolden.size;

  await binding.setSurfaceSize(screenSize);
  binding.window.physicalSizeTestValue = screenSize;
  binding.window.devicePixelRatioTestValue = 1.0;
  binding.platformDispatcher.textScaleFactorTestValue = 1.0;

  await pumpWidget(widget);
  await _defaultPrimeAssets();
}