最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Find BackButton in flutter version 3.22.2 - Stack Overflow

programmeradmin1浏览0评论

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?

发布评论

评论列表(0)

  1. 暂无评论