convertFlutterSurfaceToImage method Null safety

  1. @override
Future<void> convertFlutterSurfaceToImage()
override

Android only. Converts the Flutter surface to an image view.

Implementation

@override
Future<void> convertFlutterSurfaceToImage() async {
  assert(!_usesFlutterImage, 'Surface already converted to an image');
  await integrationTestChannel.invokeMethod<void>(
    'convertFlutterSurfaceToImage',
    null,
  );
  _usesFlutterImage = true;

  addTearDown(() async {
    assert(_usesFlutterImage, 'Surface is not an image');
    await integrationTestChannel.invokeMethod<void>(
      'revertFlutterImage',
      null,
    );
    _usesFlutterImage = false;
  });
}