Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* Arun Muralidharan - <https://github.com/arun-muralidharan>
* Khushbu Bora - <https://github.com/KhushbuBora>
* Patrick Witter - <https://github.com/patrickwitter>
* Thilina Herath - <https://github.com/ThilinaTCH>

## Translators

Expand Down
6 changes: 5 additions & 1 deletion lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -475,5 +475,9 @@
"takePicture": "Take a picture",
"chooseFromLibrary": "Choose from photo library",
"gallery": "Gallery",
"addImage": "Add image"
"addImage": "Add image",
"dataCopied": "Data copied to new entry",
"@dataCopied": {
"description": "Snackbar message to show on copying data to a new log entry"
}
}
34 changes: 14 additions & 20 deletions lib/widgets/workouts/gym_mode.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ class _GymModeState extends State<GymMode> {
for (final set in widget._workoutDay.sets) {
var firstPage = true;
for (final setting in set.settingsComputed) {
final exercise =
Provider.of<ExercisesProvider>(context, listen: false).findById(setting.exerciseId);
final exercise = Provider.of<ExercisesProvider>(context, listen: false).findById(setting.exerciseId);

if (firstPage) {
_exercisePages[exercise.name] = currentPage;
Expand Down Expand Up @@ -151,8 +150,7 @@ class _GymModeState extends State<GymMode> {
),
...getContent(),
SessionPage(
Provider.of<WorkoutPlansProvider>(context, listen: false)
.findById(widget._workoutDay.workoutId),
Provider.of<WorkoutPlansProvider>(context, listen: false).findById(widget._workoutDay.workoutId),
_controller,
widget._start,
_exercisePages,
Expand Down Expand Up @@ -506,8 +504,7 @@ class _LogPageState extends State<LogPage> {
...widget._workoutPlan.filterLogsByExercise(widget._exercise, unique: true).map((log) {
return ListTile(
title: Text(log.singleLogRepTextNoNl),
subtitle:
Text(DateFormat.yMd(Localizations.localeOf(context).languageCode).format(log.date)),
subtitle: Text(DateFormat.yMd(Localizations.localeOf(context).languageCode).format(log.date)),
trailing: Icon(Icons.copy),
onTap: () {
setState(() {
Expand All @@ -519,6 +516,10 @@ class _LogPageState extends State<LogPage> {
widget._log.rir = log.rir;
widget._log.repetitionUnit = log.repetitionUnitObj;
widget._log.weightUnit = log.weightUnitObj;

ScaffoldMessenger.of(context).hideCurrentSnackBar();
ScaffoldMessenger.of(context)
.showSnackBar(SnackBar(content: Text(AppLocalizations.of(context).dataCopied)));
});
},
contentPadding: EdgeInsets.symmetric(horizontal: 40),
Expand Down Expand Up @@ -611,12 +612,10 @@ class _LogPageState extends State<LogPage> {
),
SizedBox(height: 10),
Expanded(
child: (widget._workoutPlan.filterLogsByExercise(widget._exercise).isNotEmpty)
? getPastLogs()
: Container()),
child:
(widget._workoutPlan.filterLogsByExercise(widget._exercise).isNotEmpty) ? getPastLogs() : Container()),
// Only show calculator for barbell
if (widget._log.exerciseObj.equipment.map((e) => e.id).contains(ID_EQUIPMENT_BARBELL))
getPlates(),
if (widget._log.exerciseObj.equipment.map((e) => e.id).contains(ID_EQUIPMENT_BARBELL)) getPlates(),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 15),
child: Card(
Expand Down Expand Up @@ -763,9 +762,7 @@ class _SessionPageState extends State<SessionPage> {
renderBorder: false,
onPressed: (int index) {
setState(() {
for (int buttonIndex = 0;
buttonIndex < selectedImpression.length;
buttonIndex++) {
for (int buttonIndex = 0; buttonIndex < selectedImpression.length; buttonIndex++) {
_session.impression = index + 1;

if (buttonIndex == index) {
Expand Down Expand Up @@ -829,8 +826,7 @@ class _SessionPageState extends State<SessionPage> {
SizedBox(width: 10),
Flexible(
child: TextFormField(
decoration:
InputDecoration(labelText: AppLocalizations.of(context).timeEnd),
decoration: InputDecoration(labelText: AppLocalizations.of(context).timeEnd),
controller: timeEndController,
onFieldSubmitted: (_) {},
onTap: () async {
Expand Down Expand Up @@ -864,8 +860,7 @@ class _SessionPageState extends State<SessionPage> {

// Save the entry on the server
try {
await Provider.of<WorkoutPlansProvider>(context, listen: false)
.addSession(_session);
await Provider.of<WorkoutPlansProvider>(context, listen: false).addSession(_session);
Navigator.of(context).pop();
} on WgerHttpException catch (error) {
showHttpExceptionErrorDialog(error, context);
Expand Down Expand Up @@ -972,8 +967,7 @@ class NavigationFooter extends StatelessWidget {
final bool showPrevious;
final bool showNext;

const NavigationFooter(this._controller, this._ratioCompleted,
{this.showPrevious = true, this.showNext = true});
const NavigationFooter(this._controller, this._ratioCompleted, {this.showPrevious = true, this.showNext = true});

@override
Widget build(BuildContext context) {
Expand Down