mirror of
https://github.com/immich-app/immich.git
synced 2026-03-26 20:00:44 +03:00
fix(mobile): star rating always defaults to 0 (#27157)
This commit is contained in:
@@ -39,6 +39,16 @@ class _RatingBarState extends State<RatingBar> {
|
|||||||
_currentRating = widget.initialRating;
|
_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}) {
|
void _updateRating(Offset localPosition, bool isRTL, {bool isTap = false}) {
|
||||||
final totalWidth = widget.itemCount * widget.itemSize + (widget.itemCount - 1) * widget.starPadding;
|
final totalWidth = widget.itemCount * widget.itemSize + (widget.itemCount - 1) * widget.starPadding;
|
||||||
double dx = localPosition.dx;
|
double dx = localPosition.dx;
|
||||||
|
|||||||
Reference in New Issue
Block a user