-
Notifications
You must be signed in to change notification settings - Fork 30.2k
[flutter_svg] Add support for path onClick listener #177082
Copy link
Copy link
Open
Labels
c: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterp: flutter_svgThe Flutter SVG drawing packagesThe Flutter SVG drawing packagespackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.team-engineOwned by Engine teamOwned by Engine team
Description
Use case
Hi Team i'm working on a project where i need to get SVG click (SVG made up with multiple path and each path represent a Part), for this i need the support for SVG onClink listener
Proposal
Sample SVG String
<svg width="320" height="60" xmlns="http://www.w3.org/2000/svg">
<rect onclick='onClick.postMessage("button_1_clicked");' id="leftButton" x="0" y="0" width="150" height="50" rx="10" ry="10" fill="#4CAF50" />
<text x="75" y="30" font-family="Arial" font-size="16" fill="white" text-anchor="middle" alignment-baseline="middle">
Left
</text>
<rect onclick='onClick.postMessage("button_2_clicked");' id="rightButton" x="170" y="0" width="150" height="50" rx="10" ry="10" fill="#2196F3" />
<text x="245" y="30" font-family="Arial" font-size="16" fill="white" text-anchor="middle" alignment-baseline="middle">
Right
</text>
</svg>
here from the plugin i need
onElementClick: (event) {
print("Event===>$event");
}
OutPut
Event===>button_1_clicked
Event===>button_2_clicked
we have a plugin that use flutter_web_view but it does not have other properties
Thanks in advance Team.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
c: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterp: flutter_svgThe Flutter SVG drawing packagesThe Flutter SVG drawing packagespackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.team-engineOwned by Engine teamOwned by Engine team