mirror of
https://github.com/immich-app/immich
synced 2026-08-22 13:13:05 +00:00
fix(mobile): star rating always defaults to 0 (#27157)
This commit is contained in:
parent
bf065a834f
commit
e2eb03d3a4
1 changed files with 10 additions and 0 deletions
|
|
@ -39,6 +39,16 @@ class _RatingBarState extends State<RatingBar> {
|
|||
_currentRating = widget.initialRating;
|
||||
}
|
||||
|
||||
@override
|
||||
void didUpdateWidget(covariant RatingBar oldWidget) {
|
||||
super.didUpdateWidget(oldWidget);
|
||||
if (oldWidget.initialRating != widget.initialRating && _currentRating != widget.initialRating) {
|
||||
setState(() {
|
||||
_currentRating = widget.initialRating;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void _updateRating(Offset localPosition, bool isRTL, {bool isTap = false}) {
|
||||
final totalWidth = widget.itemCount * widget.itemSize + (widget.itemCount - 1) * widget.starPadding;
|
||||
double dx = localPosition.dx;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue