mirror of
https://github.com/wger-project/flutter.git
synced 2026-02-18 00:17:48 +01:00
Fix rendering of muscles in MuscleWidget
Ensure that when a muscle is both main and secondary, only the main muscle background is drawn. This addresses potential overlaps and redundant rendering in the MuscleWidget.
This commit is contained in:
committed by
Roland Geider
parent
ae64c2377d
commit
3312da1f61
@@ -338,7 +338,8 @@ class MuscleWidget extends StatelessWidget {
|
||||
this.isFront = true,
|
||||
}) {
|
||||
this.muscles = muscles.where((m) => m.isFront == isFront).toList();
|
||||
this.musclesSecondary = musclesSecondary.where((m) => m.isFront == isFront).toList();
|
||||
this.musclesSecondary =
|
||||
musclesSecondary.where((m) => m.isFront == isFront).toList();
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -349,7 +350,7 @@ class MuscleWidget extends StatelessWidget {
|
||||
children: [
|
||||
SvgPicture.asset('assets/images/muscles/$background.svg'),
|
||||
...muscles.map((m) => SvgPicture.asset('assets/images/muscles/main/muscle-${m.id}.svg')),
|
||||
...musclesSecondary.map((m) => SvgPicture.asset(
|
||||
...musclesSecondary.where((m) => !muscles.contains(m)).map((m) => SvgPicture.asset(
|
||||
'assets/images/muscles/secondary/muscle-${m.id}.svg',
|
||||
)),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user