Repository: flutter
Issue: Slider tickMarkShape isn't drawn
Labels: framework,f: material design,has reproducible steps,P2,team-design,triaged-design,found in release: 3.24

### Steps to reproduce

1. Create slider with custom tickMarkShape
2. Launch on ios

### Expected results

tickMarkShape does render on ios like it does on web/android




### Actual results

tickMarkShape doesn't render on ios




### Code sample

<details open><summary>Code sample</summary>

```dart
import 'dart:math';

import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  double? sliderValue = null;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: _StarSlider(
          onChanged: (value) => setState(() => sliderValue = value),
          value: sliderValue,
        ),
      ),
    );
  }
}

class _StarSlider extends StatelessWidget {
  const _StarSlider({
    required this.onChanged,
    required this.value,
    super.key,
  });

  final ValueChanged<double> onChanged;
  final double? value;

  @override
  Widget build(BuildContext context) {
    return SliderTheme(
      data: SliderTheme.of(context).copyWith(
        thumbShape: const _PolygonSliderThumb(radius: 16),
        tickMarkShape: const _StarTickMarkShape(radius: 16),
        valueIndicatorColor: value == null
            ? Colors.transparent
            : Theme.of(context).colorScheme.tertiary,
        activeTrackColor: Colors.transparent,
        inactiveTrackColor: Colors.transparent,
        activeTickMarkColor: value == null
            ? null
            : Theme.of(context).colorScheme.onSurfaceVariant,
      ),
      child: Slider(
        value: value ?? 1,
        onChanged: onChanged,
        min: 1,
        max: 5,
        divisions: 4,
      ),
    );
  }
}

class _PolygonSliderThumb extends SliderComponentShape {
  final double radius;

  const _PolygonSliderThumb({required this.radius});

  @override
  Size getPreferredSize(bool isEnabled, bool isDiscrete) {
    return Size.fromRadius(radius);
  }

  @override
  void paint(
    PaintingContext context,
    Offset center, {
    required Animation<double> activationAnimation,
    required Animation<double> enableAnimation,
    required bool isDiscrete,
    required TextPainter labelPainter,
    required RenderBox parentBox,
    required SliderThemeData sliderTheme,
    required TextDirection textDirection,
    required double value,
    required double textScaleFactor,
    required Size sizeWithOverflow,
  }) {
    Paint paint = Paint()
      ..color = sliderTheme.valueIndicatorColor ?? Colors.blue
      ..style = PaintingStyle.fill;

    final path = _getStarPath(radius: radius, center: center);
    context.canvas.drawPath(path, paint);
  }
}

class _StarTickMarkShape extends SliderTickMarkShape {
  final double radius;

  const _StarTickMarkShape({required this.radius});

  @override
  Size getPreferredSize({
    required SliderThemeData sliderTheme,
    required bool isEnabled,
  }) {
    assert(sliderTheme.trackHeight != null);
    return Size.fromRadius(radius);
  }

  @override
  void paint(
    PaintingContext context,
    Offset center, {
    required RenderBox parentBox,
    required SliderThemeData sliderTheme,
    required Animation<double> enableAnimation,
    required TextDirection textDirection,
    required Offset thumbCenter,
    required bool isEnabled,
  }) {
    assert(sliderTheme.disabledActiveTickMarkColor != null);
    assert(sliderTheme.disabledInactiveTickMarkColor != null);
    assert(sliderTheme.activeTickMarkColor != null);
    assert(sliderTheme.inactiveTickMarkColor != null);

    final double xOffset = center.dx - thumbCenter.dx;

    // BUG: wierd bug, thumbCenter is not exactly center
    if (xOffset.abs() < 3) {
      center = thumbCenter;
    }

    final (Color? begin, Color? end) = switch (textDirection) {
      TextDirection.ltr when xOffset > 0 => (
          sliderTheme.disabledInactiveTickMarkColor,
          sliderTheme.inactiveTickMarkColor,
        ),
      TextDirection.rtl when xOffset < 0 => (
          sliderTheme.disabledInactiveTickMarkColor,
          sliderTheme.inactiveTickMarkColor,
        ),
      TextDirection.ltr || TextDirection.rtl => (
          sliderTheme.disabledActiveTickMarkColor,
          sliderTheme.valueIndicatorColor,
        ),
    };

    final Paint paint = Paint()
      ..color = ColorTween(begin: begin, end: end).evaluate(enableAnimation)!;
    // context.canvas.drawCircle(center, radius, paint);

    if (radius > 0) {
      final path = _getStarPath(radius: radius, center: center);
      debugPrint('star: $path');
      context.canvas.drawPath(path, paint);
    }
  }
}

Path _getStarPath({required double radius, required Offset center}) {
  final path = Path();

  // Define points for the star
  for (int i = 0; i < 5; i++) {
    var angle = (72 * i - 90) * (pi / 180.0);
    var x = radius * cos(angle);
    var y = radius * sin(angle);
    if (i == 0) {
      path.moveTo(center.dx + x, center.dy + y);
    } else {
      path.lineTo(center.dx + x, center.dy + y);
    }

    angle = (72 * i + 36 - 90) * (pi / 180.0);
    x = (radius / 2) * cos(angle);
    y = (radius / 2) * sin(angle);
    path.lineTo(center.dx + x, center.dy + y);
  }

  path.close();

  return path;
}

```

</details>


### Screenshots or Video

<details open>
<summary>Screenshots / Video demonstration</summary>

![Screenshot 2024-08-16 at 14 26 59](https://github.com/user-attachments/assets/4984d39b-b53b-4e38-b700-314f2e8d08fc)
![Screenshot 2024-08-16 at 14 27 56](https://github.com/user-attachments/assets/d80f7edc-9bb5-483d-a6ef-ccd76c6b5e3f)

</details>


### Logs

<details open><summary>Logs</summary>

```console
[Paste your logs here]
```

</details>


### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[✓] Flutter (Channel stable, 3.24.0, on macOS 14.5 23F79 darwin-arm64, locale en-RU)
    • Flutter version 3.24.0 on channel stable at /opt/homebrew/Caskroom/flutter/3.10.4/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 80c2e84975 (2 weeks ago), 2024-07-30 23:06:49 +0700
    • Engine revision b8800d88be
    • Dart version 3.5.0
    • DevTools version 2.37.2

[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/geara0/Library/Android/sdk
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/to/macos-android-setup for more details.

[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15F31d
    • CocoaPods version 1.15.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.3)
    • Android Studio at /Users/geara0/Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)

[✓] IntelliJ IDEA Ultimate Edition (version 2024.1.4)
    • IntelliJ at /Users/geara0/Applications/IntelliJ IDEA Ultimate.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.91.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.92.0

[✓] Connected device (4 available)
    • iPhone 15 Pro Max (mobile)      • DD0BD5AF-6F73-4B6F-B5E1-922247A5BC5F • ios            • com.apple.CoreSimulator.SimRuntime.iOS-17-4 (simulator)
    • macOS (desktop)                 • macos                                • darwin-arm64   • macOS 14.5 23F79 darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad                • darwin         • macOS 14.5 23F79 darwin-arm64
    • Chrome (web)                    • chrome                               • web-javascript • Google Chrome 127.0.6533.120
    ! Error: Browsing on the local area network for iPhone HOME. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.
```

</details>