svgAssetWithPath method

Finder svgAssetWithPath(
  1. String path, {
  2. bool skipOffstage = true,
})

Finds widgets created by SvgPicture.asset with the path argument.

Sample code

expect(svgAssetWithPath('assets/asset_name.svg'), findsOneWidget);

This will match SvgPicture.asset with the path 'assets/asset_name.svg'. If the skipOffstage argument is true (the default), then this skips nodes that are Offstage or that are from inactive Routes.

Implementation

Finder svgAssetWithPath(String path, {bool skipOffstage = true}) {
  return _SvgAssetWithPathFinder(svgPath: path, skipOffstage: skipOffstage);
}