1
Hi, I have a GestureDetector
who receives as his son a container with width: 20
and heigth: 20
and with that my Gesturedetector is only 20x20, as shown in the image (the size is only the gray ball)
Okay, I need to increase the area of GestureDetector
I thought about passing a container as a child and leaving transparent color, and as the container’s son my "gray ball (which is a container too)", but it didn’t work, it was like this:
Anyway, I need a way to increase only the clickable location and not the gray ball container, how can I do it? my code is below
GestureDetector(
child: Online(
online: lista[index].online, width: 20, heigth: 20),
onTap: () {
_alterarStatusFun(lista[index]);
}),
The online I created as a class because I use elsewhere :
class Online extends StatelessWidget {
final bool online;
final double width;
final double heigth;
const Online({Key key, this.online, this.width, this.heigth})
: super(key: key);
@override
Widget build(BuildContext context) {
return online
? Container(
width: width,
height: heigth,
decoration: BoxDecoration(
color: Color.fromRGBO(0, 255, 0, 1),
shape: BoxShape.circle,
),
)
: Container(
width: width,
height: heigth,
decoration: BoxDecoration(
color: Colors.grey,
shape: BoxShape.circle,
),
);
}
}
Cool, worked well, thanks for the help
– Jeff Henrique