binSaed / flutter_cached_pdfview

Enhanced PDF view for Flutter.
https://pub.dev/packages/flutter_cached_pdfview
MIT License
121 stars 70 forks source link

How to make a widget test of this component? #43

Closed mdmota closed 3 years ago

mdmota commented 3 years ago

I know the component is on the screen, because I put a key on your ancestor and verified that the ancestor was found

final PDFWidget = find.byType(PDF); expect(PDFWidget, findsOneWidget);

return _WidgetTypeFinder:<zero widgets with type "PDF" (ignoring offstage widgets)

binSaed commented 3 years ago

@mdmota u can use find.byKey

final Finder PDFWidget = find.byKey(Key('pdfFromUrlKey'));
expect(PDFWidget, findsOneWidget);
binSaed commented 3 years ago

PDF().cachedFromUrl( 'url', key: Key('pdfFromUrlKey'), )

mdmota commented 3 years ago

ah ok, good alternative. thank you