Button inside widget in showToastWidget is unclickable
RakaAlrian opened this issue · 3 comments
RakaAlrian commented
I already set isIgnoring
to false and put a button inside the widget I create in showToastWidget
, the button is work until I set endOffset
with Offset(0, 1)
, seems the button is ignoring the pointer. any suggestion?
RakaAlrian commented
this is how I implement the showToastWidget
showToastWidget(
Container(
width: MediaQuery.of(context).size.width - 40,
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 10),
decoration: ShapeDecoration(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
color: Colors.green,
),
child: Material(
color: Colors.transparent,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Flexible(
child: Icon(
Icons.info_outline_rounded,
color: Colors.white,
),
),
const SizedBox(
width: 10,
),
Flexible(
flex: 5,
child: Text(
"styled toast experiment",
style: const TextStyle(
color: Colors.white,
),
),
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 10),
//DISMISS BUTTON
child: InkResponse(
onTap: () {
dismissAllToast(showAnim: true);
},
radius: 15,
child: const Icon(
Icons.close,
color: Colors.white,
),
),
),
],
),
),
),
isIgnoring: false,
dismissOtherToast: true,
isHideKeyboard: true,
endOffset: Offset(0, 1), //DISMISS BUTTON NOT WORKING AFTER I ADD THIS
context: context,
duration: Duration.zero,
animation: StyledToastAnimation.slideFromTopFade,
reverseAnimation: StyledToastAnimation.slideFromTopFade,
position: StyledToastPosition.top,
);
RakaAlrian commented
never mind, I can use margin in my container instead of using offset to arrange the position, I am sorry😅
RakaAlrian commented
btw, there is another issue with using margin and isIgnoring set to false, buttons or any widgets near the toast will become unclickable