drawLine method
void
drawLine(})
Implementation
void drawLine(
Offset start,
Offset end, {
Color color = Colors.black,
double thickness = 2,
LineStyle style = LineStyle.redeBTExistente,
String? layerTitle,
}) {
if (start == end) return;
final resolvedThickness = _resolveThickness(style, thickness);
final path = switch (style) {
LineStyle.redeMTProjetada => _buildDashedPath(
start: start,
end: end,
color: color,
thickness: resolvedThickness,
dashLength: 28,
gapLength: 14,
),
LineStyle.redeMTExistente => _buildDashedPath(
start: start,
end: end,
color: color,
thickness: resolvedThickness,
dashLength: 18,
gapLength: 10,
),
LineStyle.redeBTProjetada => <DrawModel?>[
DrawModel(
offset: start,
color: color,
strokeWidth: resolvedThickness,
),
DrawModel(
offset: end,
color: color,
strokeWidth: resolvedThickness,
),
],
LineStyle.redeBTExistente => <DrawModel?>[
DrawModel(
offset: start,
color: color,
strokeWidth: resolvedThickness,
),
DrawModel(
offset: end,
color: color,
strokeWidth: resolvedThickness,
),
],
};
value = value.copyWith(
currentPaintPath: path,
);
endPath();
}