This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RadarChartTransition extends AnimatedWidget { | |
final AnimationController controller; | |
final int nodes; | |
final int segments; | |
final List<double> data; | |
final List<String> labels; | |
// CONSTRUCTOR | |
RadarChartTransition( | |
this.controller, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void paint(ui.Canvas canvas, ui.Size size) { | |
final Offset centerPoint = Offset(0, 0); | |
// math for each branch | |
final angle = 360 / nodes; | |
// list of branch end points (x,y) | |
List<List<double>> points = []; | |
// for each branch | |
for (int i = 0; i < nodes; i++) { | |
final double lineLength = 200; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyApp extends StatelessWidget { | |
... | |
Widget build(...) { | |
return MaterialApp(..., home: MyHomePage()); | |
} | |
} | |
class MyHomePage extends StatefulWidget { | |
... | |
_MyHomePageState createState() => _MyHomePageState(); |
NewerOlder