mirror of
https://github.com/wger-project/flutter.git
synced 2026-12-03 10:33:54 +01:00
Only show plate calculator for barbell exercises
This might be a bit too constrained, since other exercises (e.g.) in the rack or the leg press would also benefit from this. Perhaps adding a user switch?
This commit is contained in:
@@ -57,3 +57,6 @@ const AVAILABLE_PLATES = [1.25, 2.5, 5, 10, 15];
|
||||
|
||||
/// Weight of the bar, used in the plate calculator
|
||||
const BAR_WEIGHT = 20;
|
||||
|
||||
/// ID of the equipment entry for barbell
|
||||
const ID_EQUIPMENT_BARBELL = 1;
|
||||
|
||||
@@ -505,7 +505,6 @@ class _LogPageState extends State<LogPage> {
|
||||
}
|
||||
|
||||
Widget getPlates() {
|
||||
//final plates = [];
|
||||
final plates = plateCalculator(
|
||||
double.parse(_weightController.text),
|
||||
BAR_WEIGHT,
|
||||
@@ -556,7 +555,9 @@ class _LogPageState extends State<LogPage> {
|
||||
? getPastLogs()
|
||||
: Container()),
|
||||
SizedBox(height: 15),
|
||||
getPlates(),
|
||||
// Only show calculator for barbell
|
||||
if (widget._log.exerciseObj.equipment.map((e) => e.id).contains(ID_EQUIPMENT_BARBELL))
|
||||
getPlates(),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 15),
|
||||
child: Card(
|
||||
|
||||
Reference in New Issue
Block a user