I want to make star rating that return appropriate value (1 until 5 based on which star user click on).
But i cannot achieve that. Why it's only return zero.
SMINumber? _rating;
void _onRiveInit(Artboard artboard) {
final controller = StateMachineController.fromArtboard(artboard, 'State Machine 1');
artboard.addController(controller!);
_rating = controller.findInput<double>('Rating') as SMINumber;
}
void _hitBump() => debugPrint("${_rating!.value}");
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: GestureDetector(
child: RiveAnimation.network(
'https://public.rive.app/community/runtime-files/3145-6649-star-rating.riv',
fit: BoxFit.cover,
onInit: _onRiveInit,
),
onTap: _hitBump,
),
),
);
}