info_popup
info_popup copied to clipboard
How can I touch outside to close the popup?
Currently, when i tap out side of popup, then cannot close the pop up? Can you help me for this? My code:
InfoPopupWidget(
arrowTheme: const InfoPopupArrowTheme(
arrowDirection: ArrowDirection.down,
color: Colors.transparent,
),
contentOffset: const Offset(-75, 0),
customContent: () => Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadiusConstants.c15wr,
),
padding: PaddingConstants.a10R,
width: 200.ww,
child: ListView.separated(
itemCount: readAtList.values.toList().length,
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
separatorBuilder: (context, index) => 15.wVerticalSpace,
itemBuilder: (_, index) {
return Row(
children: <Widget>[
_buildReaderAvatar(
readAtList.values.toList()[index].avatar),
10.wHorizontalSpace,
Expanded(
child: Text(
readAtList.values.toList()[index].name ??
AppConstant.empty,
textAlign: TextAlign.left,
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
fontSize: 14.zsp(context),
fontWeight: FontWeight.normal,
color: Colors.black,
),
),
),
],
);
},
),
),
child: Container(
height: 20,
color: Colors.transparent,
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: showReadAtList.keys.map((String key) {
final int index = readAtList.keys.toList().indexOf(key);
return Padding(
padding: const EdgeInsets.only(left: 2),
child: index >= _indexReadMore
? _buildMoreReader('$moreReader')
: _buildReader(
key,
userInfo: showReadAtList[key]!,
),
);
}).toList(),
),
),
)
When I tried to simulate the code as in the example below, I saw that everything was working correctly. When I clicked outside the area, the popup closed. I tried it on an iOS emulator. Can you provide more information? @huynguyen96419
InfoPopupWidget(
arrowTheme: const InfoPopupArrowTheme(
color: Colors.black87,
arrowDirection: ArrowDirection.down,
),
customContent: () => Container(
width: 200,
child: ListView.separated(
itemCount: [1, 2, 3, 4, 5].length,
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
separatorBuilder: (context, index) => const Divider(),
itemBuilder: (_, index) {
return Row(
children: <Widget>[
Expanded(
child: Text(
[1, 2, 3, 4, 5][index].toString(),
textAlign: TextAlign.left,
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: const TextStyle(
fontSize: 14,
fontWeight: FontWeight.normal,
color: Colors.black,
),
),
),
],
);
},
),
),
child: const Text('Info Popup Custom Widget Example'),
),
Use this dismissTriggerBehavior: PopupDismissTriggerBehavior.onTapArea
This issue has been automatically closed due to inactivity. Please feel free to reopen it if you are still experiencing this problem.