mirror of
https://github.com/wger-project/flutter.git
synced 2026-02-18 00:17:48 +01:00
Tweak a bit how and when the types are shown
This commit is contained in:
@@ -43,6 +43,8 @@ class SetConfigData {
|
||||
@JsonKey(required: true, name: 'text_repr')
|
||||
late String textRepr;
|
||||
|
||||
String get textReprWithType => '$textRepr${type.typeLabel}';
|
||||
|
||||
@JsonKey(required: true, name: 'sets')
|
||||
late num? nrOfSets;
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@ import 'package:wger/l10n/generated/app_localizations.dart';
|
||||
import 'package:wger/models/exercises/exercise.dart';
|
||||
import 'package:wger/models/workouts/day_data.dart';
|
||||
import 'package:wger/models/workouts/slot_data.dart';
|
||||
import 'package:wger/models/workouts/slot_entry.dart';
|
||||
import 'package:wger/screens/gym_mode.dart';
|
||||
import 'package:wger/widgets/core/core.dart';
|
||||
import 'package:wger/widgets/exercises/exercises.dart';
|
||||
@@ -83,9 +82,7 @@ class RoutineDayWidget extends StatelessWidget {
|
||||
// the one exercise and don't show separate rows for each one.
|
||||
...slotData.setConfigs
|
||||
.fold<Map<Exercise, List<String>>>({}, (acc, entry) {
|
||||
acc
|
||||
.putIfAbsent(entry.exercise, () => [])
|
||||
.add('${entry.textRepr}${entry.type.typeLabel}');
|
||||
acc.putIfAbsent(entry.exercise, () => []).add(entry.textReprWithType);
|
||||
return acc;
|
||||
})
|
||||
.entries
|
||||
|
||||
@@ -28,6 +28,7 @@ import 'package:wger/models/workouts/log.dart';
|
||||
import 'package:wger/models/workouts/routine.dart';
|
||||
import 'package:wger/models/workouts/set_config_data.dart';
|
||||
import 'package:wger/models/workouts/slot_data.dart';
|
||||
import 'package:wger/models/workouts/slot_entry.dart';
|
||||
import 'package:wger/providers/plate_weights.dart';
|
||||
import 'package:wger/providers/routines.dart';
|
||||
import 'package:wger/screens/configure_plates_screen.dart';
|
||||
@@ -261,6 +262,8 @@ class _LogPageState extends ConsumerState<LogPage> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
NavigationHeader(
|
||||
@@ -270,15 +273,27 @@ class _LogPageState extends ConsumerState<LogPage> {
|
||||
),
|
||||
|
||||
Container(
|
||||
color: Theme.of(context).colorScheme.onInverseSurface,
|
||||
color: theme.colorScheme.onInverseSurface,
|
||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||
child: Center(
|
||||
child: Text(
|
||||
widget._configData.textRepr,
|
||||
style: Theme.of(
|
||||
context,
|
||||
).textTheme.headlineMedium?.copyWith(color: Theme.of(context).colorScheme.primary),
|
||||
textAlign: TextAlign.center,
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
widget._configData.textRepr,
|
||||
style: theme.textTheme.headlineMedium?.copyWith(
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
if (widget._configData.type != SlotEntryType.normal)
|
||||
Text(
|
||||
widget._configData.type.name.toUpperCase(),
|
||||
style: theme.textTheme.headlineMedium?.copyWith(
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -41,7 +41,7 @@ class StartPage extends StatelessWidget {
|
||||
children: [
|
||||
...slotData.setConfigs
|
||||
.fold<Map<Exercise, List<String>>>({}, (acc, entry) {
|
||||
acc.putIfAbsent(entry.exercise, () => []).add(entry.textRepr);
|
||||
acc.putIfAbsent(entry.exercise, () => []).add(entry.textReprWithType);
|
||||
return acc;
|
||||
})
|
||||
.entries
|
||||
|
||||
Reference in New Issue
Block a user