'Flutter CustomPaint better antialiasing

Paint.isAntiAlias = false;

enter image description here

Paint.isAntiAlias = true;

enter image description here

@override
  void paint(Canvas canvas, Size size) {
    final Path path_0 = Path();
    path_0.moveTo(
      size.width * 0.5002533,
      size.height * 0.004880920,
    );
    path_0.cubicTo(
      size.width * 0.2252237,
      size.height * 0.004880922,
      size.width * 0.002532500,
      size.height * 0.2268787,
      size.width * 0.002532500,
      size.height * 0.5010510,
    );
    path_0.cubicTo(
      size.width * 0.002532500,
      size.height * 0.7752251,
      size.width * 0.2252237,
      size.height * 0.9972229,
      size.width * 0.5002533,
      size.height * 0.9972220,
    );
    path_0.cubicTo(
      size.width * 0.7752828,
      size.height * 0.9972229,
      size.width * 0.9979740,
      size.height * 0.7752251,
      size.width * 0.9979740,
      size.height * 0.5010510,
    );
    path_0.cubicTo(
      size.width * 0.9979740,
      size.height * 0.2268787,
      size.width * 0.7752828,
      size.height * 0.004880922,
      size.width * 0.5002533,
      size.height * 0.004880920,
    );
    path_0.close();
    path_0.moveTo(
      size.width * 0.5002533,
      size.height * 0.8731800,
    );
    path_0.cubicTo(
      size.width * 0.3693230,
      size.height * 0.8731802,
      size.width * 0.2513929,
      size.height * 0.7020954,
      size.width * 0.2513929,
      size.height * 0.5010510,
    );
    path_0.cubicTo(
      size.width * 0.2513929,
      size.height * 0.3000084,
      size.width * 0.3692386,
      size.height * 0.1289237,
      size.width * 0.5002533,
      size.height * 0.1289230,
    );
    path_0.cubicTo(
      size.width * 0.6312679,
      size.height * 0.1289237,
      size.width * 0.7491136,
      size.height * 0.3000084,
      size.width * 0.7491136,
      size.height * 0.5010510,
    );
    path_0.cubicTo(
      size.width * 0.7491136,
      size.height * 0.7020954,
      size.width * 0.6311835,
      size.height * 0.8731802,
      size.width * 0.5002533,
      size.height * 0.8731800,
    );
    path_0.close();

    final Paint paint0Fill = Paint()..style = PaintingStyle.fill;
    paint0Fill.color = colors['kMainColor']!;
    canvas.drawPath(path_0, paint0Fill);

    final Path path_1 = Path();
    path_1.moveTo(
      size.width * 0.8129326,
      size.height * 0.1151220,
    );
    path_1.cubicTo(
      size.width * 0.7594125,
      size.height * 0.07859968,
      size.width * 0.6966064,
      size.height * 0.05444753,
      size.width * 0.6312679,
      size.height * 0.05444750,
    );
    path_1.cubicTo(
      size.width * 0.5330069,
      size.height * 0.05444753,
      size.width * 0.4440317,
      size.height * 0.1035934,
      size.width * 0.3782711,
      size.height * 0.1804250,
    );
    path_1.cubicTo(
      size.width * 0.4149924,
      size.height * 0.1479424,
      size.width * 0.4568631,
      size.height * 0.1288395,
      size.width * 0.5002533,
      size.height * 0.1288390,
    );
    path_1.cubicTo(
      size.width * 0.6311835,
      size.height * 0.1288395,
      size.width * 0.7491136,
      size.height * 0.2999243,
      size.width * 0.7491136,
      size.height * 0.5009670,
    );
    path_1.cubicTo(
      size.width * 0.7491136,
      size.height * 0.7020113,
      size.width * 0.6312679,
      size.height * 0.8730960,
      size.width * 0.5002533,
      size.height * 0.8730960,
    );
    path_1.cubicTo(
      size.width * 0.4568631,
      size.height * 0.8730960,
      size.width * 0.4149924,
      size.height * 0.8539931,
      size.width * 0.3782711,
      size.height * 0.8215090,
    );
    path_1.cubicTo(
      size.width * 0.4440317,
      size.height * 0.8984263,
      size.width * 0.5330069,
      size.height * 0.9474880,
      size.width * 0.6312679,
      size.height * 0.9474880,
    );
    path_1.cubicTo(
      size.width * 0.6966064,
      size.height * 0.9474880,
      size.width * 0.7594125,
      size.height * 0.9233359,
      size.width * 0.8129326,
      size.height * 0.8868970,
    );
    path_1.cubicTo(
      size.width * 0.9257977,
      size.height * 0.7960111,
      size.width * 0.9979740,
      size.height * 0.6569890,
      size.width * 0.9979740,
      size.height * 0.5009670,
    );
    path_1.cubicTo(
      size.width * 0.9979740,
      size.height * 0.3450307,
      size.width * 0.9257133,
      size.height * 0.2060927,
      size.width * 0.8129326,
      size.height * 0.1151220,
    );
    path_1.close();

    final Paint paint1Fill = Paint()..style = PaintingStyle.fill;
    paint1Fill.color = AppTheme.darken(colors['kMainColor']!);
    canvas.drawPath(path_1, paint1Fill);
  }

  @override
  bool shouldRepaint(covariant CustomPainter oldDelegate) {
    return true;
  }

Is there any way to antialias canvas path(not image) better? If it was an image i'd use filterQuality but it's not an image. I think this should be possible.

Read article about this thing on Android, but did not find a way to use bitmap in Flutter's CustomPaint

I expect to get a result that looks like this:

enter image description here



Solution 1:[1]

Just in case anyone else ever runs into this, the issue was that in the manifest I was only specifying ACCESS_COARSE_LOCATION, but in the Bluetooth handler, I was requesting ACCESS_FINE_LOCATION. Note that Agi's answer helped me figure this out. It was the Bluetooth activity that was silently failing. Thank you all for the suggestions.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Kevin Mullican