From ef124cd8eb3bc78353ec5fbb453ef92f2af9996b Mon Sep 17 00:00:00 2001 From: Kelrap Date: Thu, 12 Jun 2025 12:50:49 -0400 Subject: [PATCH] Does not show any contents for level bar if progress is 0 --- .../progress_bar/animated_level_dart.dart | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/pangea/analytics_summary/progress_bar/animated_level_dart.dart b/lib/pangea/analytics_summary/progress_bar/animated_level_dart.dart index a7086fa3a..ccc966528 100644 --- a/lib/pangea/analytics_summary/progress_bar/animated_level_dart.dart +++ b/lib/pangea/analytics_summary/progress_bar/animated_level_dart.dart @@ -27,8 +27,9 @@ class AnimatedLevelBarState extends State with SingleTickerProviderStateMixin { late AnimationController _controller; - double get _beginWidth => max(20, widget.beginWidth); - double get _endWidth => max(20, widget.endWidth); + double get _beginWidth => + widget.beginWidth == 0 ? 0 : max(20, widget.beginWidth); + double get _endWidth => widget.endWidth == 0 ? 0 : max(20, widget.endWidth); /// Whether the animation has run for the first time during initState. Don't /// want the animation to run when the widget mounts, only when points are gained. @@ -48,7 +49,8 @@ class AnimatedLevelBarState extends State @override void didUpdateWidget(covariant AnimatedLevelBar oldWidget) { super.didUpdateWidget(oldWidget); - if (max(20, oldWidget.endWidth) != max(20, widget.endWidth)) { + if ((oldWidget.endWidth == 0 ? 0 : max(20, oldWidget.endWidth)) != + (widget.endWidth == 0 ? 0 : max(20, widget.endWidth))) { _controller.reset(); _controller.forward(); }