Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mdmota opened this issue Feb 9, 2021 · 3 comments
Closed

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

mdmota opened this issue Feb 9, 2021 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@mdmota
Copy link

mdmota commented Feb 9, 2021

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)

@mdmota mdmota added the bug Something isn't working label Feb 9, 2021
@binSaed
Copy link
Owner

binSaed commented Feb 10, 2021

@mdmota
u can use find.byKey

final Finder PDFWidget = find.byKey(Key('pdfFromUrlKey'));
expect(PDFWidget, findsOneWidget);

@binSaed
Copy link
Owner

binSaed commented Feb 10, 2021

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

@mdmota
Copy link
Author

mdmota commented Feb 10, 2021

ah ok, good alternative.
thank you

@mdmota mdmota closed this as completed Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants