-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
Use case
Everywhere in our app that we use a clickable ListTile, we have to wrap it like
Semantics(
button: true,
child: ListTile(
onTap: doFoo,
// other attributes
),
)
This is tedious and adds extra widget depth. We could create a wrapper widget, but replicating all the attributes of ListTile is burdensome as well.
Proposal
This is because even when a ListTile specifies a valid onTap attribute, it does not implicitly set the button semantic property. It seems like the extra semantics should not be necessary, and ListTile should do this automatically. I'm sure we're not the only app doing this.
It should also populate the enabled semantic property if applicable and it doesn't already.
I believe both of these behaviors should somehow be configurable though. Something like adding a bool? buttonSemantics constructor argument to ListTile that can be set by a caller but otherwise falls back to whether or not onTap == null.