I have the x,y for both ends of this line on a canvas, how do I run a gradient from the line sides(as pic).
import 'dart:ui' as ui;
canvas.drawLine(
Offset(x,
y),
Offset(x,
y),
Paint()
..style = PaintingStyle.stroke
..strokeWidth = 4.0
..shader = ui.Gradient.linear( // What do I use here?
startOffset,
endOffset,
[
color1,
color2,
],
),);