I have a problem in tapping through the overlay widget i have implemented by using the flutter overlap_popup plugin.
I have successfully implemented the circle that is overlaying my device screen bu when i click on the circle it does not allow the taps to pass through. I want to implement a tap through functionality to achieve i have tried the transparent, Translucent, Gesture Detection method. Can anyone tell me how can i tap through the circle on the underlying contents of my deice through the overlay?
I have tried this dart code can anyone correct it.
class OverlayWidget extends StatelessWidget {
const OverlayWidget({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Material(
color: Colors.transparent, // Set the color to transparent
child: GestureDetector(
behavior: HitTestBehavior.translucent, // Allow taps to pass through
onTap: () {}, // Allow tap through
child: Stack(
children: [
Positioned.fill(
child: Draggable(
child: Stack(
alignment: Alignment.center,
children: [
Container(
decoration: BoxDecoration(
color: Colors.red.withOpacity(0.3), // Red color with less opacity
border: Border.all(color: Colors.red, width: 2.0), // Bold outline
shape: BoxShape.circle,
),
),
Center(
child: Text(
'•', // Dot character
style: TextStyle(
fontSize: 40, // Adjust the size of the dot as needed
color: Colors.black,
),
),
),
],
),
feedback: Material(
color: Colors.transparent,
child: Container(
decoration: BoxDecoration(
color: Colors.red.withOpacity(0.3), // Red color with less opacity
border: Border.all(color: Colors.red, width: 2.0), // Bold outline
shape: BoxShape.circle,
),
),
),
onDraggableCanceled: (_, __) {}, // Allow dragging
),
),
Dipanshu Jangir is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.