tearDown method

  1. @override
Future<void> tearDown(
  1. DeviceVariantConfig value,
  2. covariant Object? memento
)
override

Cleans up environment modifications made during the setUp phase.

Reverts the device resolution, pixel ratio, and target platform to their original default testing state.

Implementation

@override
Future<void> tearDown(
  DeviceVariantConfig value,
  covariant Object? memento,
) async {
  _current = null;
  debugDefaultTargetPlatformOverride = null;

  final binding = TestWidgetsFlutterBinding.ensureInitialized();
  binding.platformDispatcher.implicitView?.resetPhysicalSize();
  binding.platformDispatcher.implicitView?.resetDevicePixelRatio();
}