listOfOuterCircleOffset method

List<Path> listOfOuterCircleOffset()

generate the Outer Circle Offsets make one list of that

Implementation

List<Path> listOfOuterCircleOffset() {
  var innerCircleRadius = radius - (radius / 3);
  var quadraticCircleRadius = radius - (radius / 1.5);
  List<Path> listPath = [];

  var initSectors = getSectionsCoordinatesInCircle(
      const Offset(radius, radius),
      quadraticCircleRadius,
      (LoaderConfig().numberOfSquare * 2));

  ///this evenOffsets tens for the each middle offset of total count
  ///So suppose total is 24 then middle should be 12
  ///we require this evenOffsets to make a curve on path
  ///we use this offsets in quadraticBezierTo property of Path.
  List<Offset> evenOffsets = [];

  initSectors.mapIndexed((index, element) {
    if (index % 2 != 0) {
      evenOffsets.add(element);
    }
  }).toList();

  int index = -1;
  for (double i = 0; i < 360; i += 30) {
    index += 1;
    var endPointX2 = radius + (innerCircleRadius * cos(i * pi / 180));
    var endPointY2 = radius + (innerCircleRadius * sin(i * pi / 180));
    Path path = Path();
    path.moveTo(radius, radius);
    path.quadraticBezierTo(
        evenOffsets[index].dx, evenOffsets[index].dy, endPointX2, endPointY2);
    listPath.add(path);
  }

  return listPath;
}