fix: fix error in set preview
This commit is contained in:
parent
79a7e1c50d
commit
253f694424
1 changed files with 13 additions and 49 deletions
|
|
@ -628,18 +628,20 @@ class _BattleScreenState extends ConsumerState<BattleScreen> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildRestScreen(Map<String, dynamic> inventory) {
|
Widget _buildRestScreen(Map<String, dynamic> inventory) {
|
||||||
WorkoutSet? nextSet;
|
// WorkoutSet? nextSet;
|
||||||
Exercise? nextExerciseInfo;
|
// Exercise? nextExerciseInfo;
|
||||||
|
|
||||||
if (_currentSetIndex + 1 < _exercises[_currentExerciseIndex].sets.length) {
|
// if (_currentSetIndex + 1 < _exercises[_currentExerciseIndex].sets.length) {
|
||||||
nextExerciseInfo = _exercises[_currentExerciseIndex];
|
// nextExerciseInfo = _exercises[_currentExerciseIndex];
|
||||||
nextSet = nextExerciseInfo.sets[_currentSetIndex + 1];
|
// nextSet = nextExerciseInfo.sets[_currentSetIndex + 1];
|
||||||
} else if (_currentExerciseIndex + 1 < _exercises.length) {
|
// } else if (_currentExerciseIndex + 1 < _exercises.length) {
|
||||||
nextExerciseInfo = _exercises[_currentExerciseIndex + 1];
|
// nextExerciseInfo = _exercises[_currentExerciseIndex + 1];
|
||||||
if (nextExerciseInfo.sets.isNotEmpty) {
|
// if (nextExerciseInfo.sets.isNotEmpty) {
|
||||||
nextSet = nextExerciseInfo.sets.first;
|
// nextSet = nextExerciseInfo.sets.first;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
final nextExerciseInfo = _exercises[_currentExerciseIndex];
|
||||||
|
final nextSet = nextExerciseInfo.sets[_currentSetIndex];
|
||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
decoration: const BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
|
|
@ -760,44 +762,6 @@ class _BattleScreenState extends ConsumerState<BattleScreen> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Widget _buildNextSetPlates(
|
|
||||||
// Exercise exercise, WorkoutSet set, Map<String, dynamic> inventory) {
|
|
||||||
// final isTwoSided = exercise.exerciseId == 'squat' ||
|
|
||||||
// exercise.exerciseId == 'row' ||
|
|
||||||
// exercise.exerciseId == 'bench' ||
|
|
||||||
// exercise.exerciseId == 'rdl' ||
|
|
||||||
// exercise.exerciseId == 'ohp' ||
|
|
||||||
// exercise.exerciseId == 'curl';
|
|
||||||
|
|
||||||
// if (!isTwoSided) return const SizedBox.shrink();
|
|
||||||
|
|
||||||
// final barWeight = (inventory['bar_weight'] as num?)?.toDouble() ?? 20.0;
|
|
||||||
// final platesList = (inventory['plates'] as List?)
|
|
||||||
// ?.map((e) => (e as num).toDouble())
|
|
||||||
// .toList() ??
|
|
||||||
// [];
|
|
||||||
|
|
||||||
// final plateResult = PlateCalculator.calculate(
|
|
||||||
// targetWeight: set.targetWeightTotal,
|
|
||||||
// barWeight: barWeight,
|
|
||||||
// availablePlates: platesList,
|
|
||||||
// availableBands: {},
|
|
||||||
// isTwoSided: true,
|
|
||||||
// );
|
|
||||||
|
|
||||||
// return Padding(
|
|
||||||
// padding: const EdgeInsets.only(top: 12.0),
|
|
||||||
// child: SizedBox(
|
|
||||||
// height: 50,
|
|
||||||
// child: PlateVisualizer(
|
|
||||||
// plateConfiguration: plateResult.plateConfiguration,
|
|
||||||
// isTwoSided: true,
|
|
||||||
// exerciseName: '',
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
|
|
||||||
Widget _buildWorkoutScreen(
|
Widget _buildWorkoutScreen(
|
||||||
Exercise currentExercise,
|
Exercise currentExercise,
|
||||||
WorkoutSet currentSet,
|
WorkoutSet currentSet,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue