change length of svg line in DART


I have SVG line in HTML and want to change the end coordinate.

 <svg  xmlns="" version="1.1" >   
   <line id="myline" x1="0" y1="0" x2="200" y2="200"

In Dart code I have the following:

LineElement line = query("#myline");

I need to change x2 from 200 to 220 but I don’t see x2 attribute for line.
Is it possible to do that?


LineElement does have the x2 attribute as you can see in the docs

You can set x2 through either of the following methods:

line.attributes["x2"] = "220";
line.$dom_setAttribute("x2", "220");

Answered By – Pixel Elephant

Answer Checked By – David Goodson (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *