How to dynamically add a lineargradient to an SVG using Dart How to dynamically add a lineargradient to an SVG using Dart dart dart

How to dynamically add a lineargradient to an SVG using Dart


Self-closing tags are not HTML5 compliant and Dart only supports HTML5.
This works:

var str = '''    <linearGradient id="def_2" x1="2557" y1="5281" x2="2603" y2="5253">    <stop offset="0" stop-color="#f32b2b"></stop>    <stop offset="0.75993413" stop-color="#fcc0c0"></stop>    <stop offset="1" stop-color="#df2323"></stop>    </linearGradient>    ''';