wolfenrain / fluttium

Fluttium, the user flow testing tool for Flutter

Home Page:https://fluttium.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fix: cannot to detect BottomNavigationBarItem

hifiaz opened this issue · comments

commented

Description
i have bottom navigation bar and i add tooltip also on it but when run test bar item never found
const BottomNavigationBarItem( tooltip: 'Create Event', icon: Icon(Icons.work), label: "Create Event", ),

Expected Behavior

BottomNavigationBarItem can Expect Visible and Press on

I have the same issue. Adding semanticLabel to icons used in BottomNavigationBarItem doesn't help either.

@hifiaz I found a simple enough workaround. All you need to do is wrap the icon in each BottomNavigationBarItem in a Semantics widget, and then pressOn using the label assigned to the Semantics widget. I found that this only works if setting image: true.

    BottomNavigationBarItem(
      icon: Semantics(
        container: true,
        label: 'Habits Tab',
        image: true,
        child: const Icon(Icons.checklist_outlined),
      ),
      label: localizations.navTabTitleHabits,
      tooltip: '',
    ),

Also see in this commit that shows the approach from above in context. Hope this helps.

commented

thank you @matthiasn yes working good wrap with semantics as you suggest!