diff --git a/lib/ui/page/timeline/timeline_two_page.dart b/lib/ui/page/timeline/timeline_two_page.dart index 3eae5bb..1ad74f9 100644 --- a/lib/ui/page/timeline/timeline_two_page.dart +++ b/lib/ui/page/timeline/timeline_two_page.dart @@ -178,8 +178,9 @@ class TimelineTwoPageState extends State { child: FloatingActionButton( onPressed: () {}, backgroundColor: Colors.white, - child: Icon( - Icons.add, + child: CustomPaint( + child: Container(), + foregroundPainter: FloatingPainter(), ), ), ), @@ -187,3 +188,41 @@ class TimelineTwoPageState extends State { ); } } + +class FloatingPainter extends CustomPainter { + @override + void paint(Canvas canvas, Size size) { + Paint amberPaint = Paint() + ..color = Colors.amber + ..strokeWidth = 5; + + Paint greenPaint = Paint() + ..color = Colors.green + ..strokeWidth = 5; + + Paint bluePaint = Paint() + ..color = Colors.blue + ..strokeWidth = 5; + + Paint redPaint = Paint() + ..color = Colors.red + ..strokeWidth = 5; + + canvas.drawLine(Offset(size.width * 0.27, size.height * 0.5), + Offset(size.width * 0.5, size.height * 0.5), amberPaint); + canvas.drawLine( + Offset(size.width * 0.5, size.height * 0.5), + Offset(size.width * 0.5, size.height - (size.height * 0.27)), + greenPaint); + canvas.drawLine(Offset(size.width * 0.5, size.height * 0.5), + Offset(size.width - (size.width * 0.27), size.height * 0.5), bluePaint); + canvas.drawLine(Offset(size.width * 0.5, size.height * 0.5), + Offset(size.width * 0.5, size.height * 0.27), redPaint); + } + + @override + bool shouldRepaint(FloatingPainter oldDelegate) => false; + + @override + bool shouldRebuildSemantics(FloatingPainter oldDelegate) => false; +}