In Flutter, we can either use GestureDetector onTap or Button to capture user press event. Is there any difference between them for accessibility like in the case of HTML (div vs button)?
Furthermore, how is GestureDetector translated into flutter web? Is it translated into a div with a onClick handler or a button?
If you take a closer look at each of them, they both are triggered by the underlying callbacks.
VoidCallback onPressed
Called when the button is tapped or otherwise activated. If this callback and onLongPress are null, then the button will be disabled. See also: enabled, which is true if the button is enabled.
GestureTapCallback onTap
A tap with a primary button has occurred. This triggers when the tap gesture wins. If the tap gesture did not win, onTapCancel is called instead.
You will notice that there isn't much of a difference as both GestureTapCallback and VoidCallback are typedef equal to void Function();
used for the same purpose.
As for your second question, you can check my personal website built in flutter and inspect the source code yourself, I use both GestureDetector and Button, they translate to the exact same role="button" in the html output.