admin管理员组

文章数量:1356011

I'm testing a flutter app, in version 3.22.2. I want to test a tap on backButton in AppBar. The button appears in the app. When I use Flutter Inspector in VSCode, I can see the widget in the widget detail tree but not in the widget tree. And it doesn't appear when I log it with debugDumpApp()

I still tried :

final findBackButton = (find
  .descendant(
    of: find.byType(AppBar),
    matching: find.byType(BackButton),  // ou avec find.byType(GestureDetector)
    matchRoot: true
  )
);
expect(findBackButton, findsOneWidget);

and

expect(find.byTooltip('Retour'), findsOneWideget);

and

expect(find.backButton(), findsOneWidget);

I rode that this method is available since the version 3.24 (commit b05c2fa dans gitHub flutter )

or

expect(find.byType(BackButton, findsOneWidget);

Could someone help me please?

本文标签: Find BackButton in flutter version 3222Stack Overflow