IgnorePointer widget around displayed hint
I'm having an issue trying to implement this design:
The idea is that dropdown button (displaying hint and dropdown items) contain additional "Info" button widget, which has onTap functionality (in my case, taping it should display a small popup explaining why user is required to select a value from the dropdown). The problem I'm facing is that if I try to construct hint Widget as a Row, containing Text and Button Widgets, tap on info button is not detected - instead, dropdown just expands normally. Example of code used in the above image:
DropdownButton2(
hint: Row(
children: [
Text("Ethnicity"),
Padding(
padding: EdgeInsets.only(left: 8),
child: Material(
color: Colors.white,
child: InkWell(
customBorder: const CircleBorder(),
onTap: () {
print('Info button pressed');
},
child: SvgPicture.asset(
'assets/graphics/dropdown_info.svg',
),
),
),
),
],
),
...
)
Since this is an issue only when displaying hint text (when displaying selected item, tap is detected) I've figured out that the cause is the use of IgnorePointer widget when creating hint widget:
https://github.com/AhmedLSayed9/dropdown_button2/blob/c9a755e394a1efb6e47a5550709150c304770441/lib/src/dropdown_button2.dart#L1539-L1546
As a temporary solution, I decided to make a local copy of package repo and remove IgnorePointer - info button now detects tap events, and taping on dropdown outside of info button correctly expands it. My question is - what is the role of IgnorePointer here and do you propose a different solution to mine?