gesturedetector

Interacting with SVG in Flutter

一世执手 提交于 2021-02-18 18:59:57
问题 I have an SVG which is composed of multiple paths. I would like to have an onTap listener - probably using a GestureDetector and figure out which path was tapped by the user (by class). I've tried a couple of approaches to this: Using flutter_svg package, which does render it correctly but unfortunately does not handle interactable paths. Using built_path and built_path_annotations which supposedly works but I didn't manage to generate the svg map data (dart code outlining the paths), partly

Interacting with SVG in Flutter

元气小坏坏 提交于 2021-02-18 18:59:37
问题 I have an SVG which is composed of multiple paths. I would like to have an onTap listener - probably using a GestureDetector and figure out which path was tapped by the user (by class). I've tried a couple of approaches to this: Using flutter_svg package, which does render it correctly but unfortunately does not handle interactable paths. Using built_path and built_path_annotations which supposedly works but I didn't manage to generate the svg map data (dart code outlining the paths), partly

Flutter GestureDetector not working inside Stack with TextField

故事扮演 提交于 2021-01-29 12:53:52
问题 I wrote a non-modal popup dialog that works fine UNTIL I put it inside a Stack with a TextField. Works fine without the TextField and even when I put two dialogs in the Stack (they both work). I saw a similar post here, but I don't think it applies because it involves two GestureDetectors in a Stack, not the problem I'm seeing of a TextField breaking my GestureDetector. As requested, I created a dartpad version of my modeless dialog using a Stack: Dartpad version EDIT I see what's happening

How do i change the color and text of Container at onTap event in FLUTTER

一世执手 提交于 2021-01-28 19:13:22
问题 I have two containers in a row and what i want to do is when i click the 1st container it changes its color as well as the 2nd container i.e. - when i click on 1st container it make it look like selected and the other one deselected and same as on 2nd container. Is there anyway to do that? GestureDetector( onTap: () { print('its getting pressed'); }, child: Row( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ Expanded( child: