简体   繁体   中英

Flutter accessibility tooltip for buttons

Good day. I am developing a app for blind users like me. I want to use tooltip to describe button use. But with my searches I only get to long press to get the message. I did set the wait property of tooltip to 0 but that do not work also. I need to be able to use tooltip as in the case of floating action button or icon button that give me immediate response. Do anyone know how to get that to happen or am I stuck with only using floating action button or icon button with buildin tooltip. For long pressing everytime on buttons is not really helpfull in a accessibility app. I am developing for a android app. Thank you in advanced.

Hmm... Ok. I think I get the idea. Instead of using a button, try using GestureDetector with its child as a Container or Card (aka creating your own button). In GestureDetector , you can then configure onTap function to trigger the tooltip and onDoubleTap to trigger the stated function. Like so:

GestureDetector(
  onTap: () {
    // Trigger the tooltip here.
  },
  onDoubleTap: () {
    // Execute the function stated in the tooltip here.
  },
  child: const Card(child: Text('Some Button Name')),
),

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM