Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F63606307
onlineRobotMap.Dart
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, May 21, 07:43
Size
1 KB
Mime Type
text/x-c++
Expires
Thu, May 23, 07:43 (2 d)
Engine
blob
Format
Raw Data
Handle
17794225
Attached To
R10646 Orchestration
onlineRobotMap.Dart
View Options
import 'package:flutter/material.dart';
class LinePainter extends CustomPainter {
Paint _paint;
Offset beginpath;
Offset endpath;
var path = Path();
//var patendpathh=path();
LinePainter(this.beginpath, this.endpath) {
_paint = Paint()
..color = Colors.blue
..strokeWidth = 8.0
..style = PaintingStyle.stroke;
}
@override
void paint(Canvas canvas, Size size) {
// path.moveTo(0, 0);
path.moveTo(beginpath.dx, beginpath.dy);
path.lineTo(endpath.dx, endpath.dy);
canvas.drawPath(path, _paint);
// canvas.saveLayer(bounds, paint);
}
@override
bool shouldRepaint(LinePainter oldDelegate) {
return true;
}
}
class LinePainter2 extends CustomPainter {
Paint _paint;
double _progress;
List<double> x;
List<double> y;
Color linecolor;
var path = Path();
//var patendpathh=path();
LinePainter2(this.x, this.y, this.linecolor) {
_paint = Paint()
..color = this.linecolor
..strokeWidth = 8.0
..style = PaintingStyle.stroke;
}
@override
void paint(Canvas canvas, Size size) {
// path.moveTo(0, 0);
for (int i = 4; i < x.length; i++) {
//path.moveTo(x[i - 2], y[i - 2]);
// path.lineTo(x[i - 1], y[i - 1]);
// canvas.drawPath(path, _paint);
canvas.drawLine(
Offset(x[i - 2], y[i - 2]), Offset(x[i - 1], y[i - 1]), _paint);
}
}
@override
bool shouldRepaint(LinePainter2 oldDelegate) {
return true;
}
}
LinePainter linepainter = new LinePainter(Offset(0, 0), Offset(0, 10));
Event Timeline
Log In to Comment