60 lines
2.1 KiB
Dart
60 lines
2.1 KiB
Dart
import 'dart:async';
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:sendtrain/classes/activity_action.dart';
|
|
import 'package:sendtrain/widgets/action_card.dart';
|
|
|
|
class ActivityActionView extends StatefulWidget {
|
|
ActivityActionView({super.key, required this.action});
|
|
|
|
ActivityAction action;
|
|
|
|
@override
|
|
State<ActivityActionView> createState() => _ActivityActionViewState();
|
|
}
|
|
|
|
class _ActivityActionViewState extends State<ActivityActionView> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Expanded(
|
|
child: ListView.builder(
|
|
padding: const EdgeInsets.fromLTRB(10, 0, 10, 0),
|
|
itemCount: widget.action.activityActionSet.total,
|
|
itemBuilder: (BuildContext context, int index) {
|
|
String title = widget.action.title;
|
|
Set actionSet = widget.action.activityActionSet;
|
|
Reps setReps = widget.action.activityActionSet.reps;
|
|
List<Card> contents = [];
|
|
|
|
// contents.add(Card(child: Text('Set ${index + 1}')));
|
|
|
|
for (int repCount = 0; repCount < setReps.amounts[index]; repCount++) {
|
|
contents.add(Card(
|
|
child: Padding(
|
|
padding: const EdgeInsets.fromLTRB(15, 15, 15, 15),
|
|
child: Column(
|
|
children: [
|
|
Row(children: [Text('Exercise: ${widget.action.title}')]),
|
|
Row(children: [Text('Type: ${actionSet.type}')]),
|
|
Row(children: [
|
|
Text(
|
|
'Set: ${index + 1} / ${widget.action.activityActionSet.total}')
|
|
]),
|
|
Row(children: [
|
|
Text('Rep: ${repCount + 1} / ${setReps.amounts[index]}')
|
|
]),
|
|
Row(children: [Text('Tempo: ${setReps.tempo[index]}')]),
|
|
Row(children: [
|
|
Text('Weight: ${setReps.weights[index]}')
|
|
]),
|
|
Row(children: [Text('Rest: ${setReps.rest}')])
|
|
],
|
|
))));
|
|
}
|
|
|
|
return Column(children: contents);
|
|
},
|
|
));
|
|
}
|
|
}
|