• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

wger-project / flutter / 30854254088

03 Aug 2026 09:21PM UTC coverage: 40.895% (-15.0%) from 55.93%
30854254088

Pull #1260

github

web-flow
Merge d93794de5 into e3affdd4f
Pull Request #1260: WIP: health sync

9980 of 24404 relevant lines covered (40.89%)

1.72 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

46.51
/lib/features/gallery/widgets/overview.dart
1
/*
2
 * This file is part of wger Workout Manager <https://github.com/wger-project>.
3
 * Copyright (C) 2020, 2021 wger Team
4
 *
5
 * wger Workout Manager is free software: you can redistribute it and/or modify
6
 * it under the terms of the GNU Affero General Public License as published by
7
 * the Free Software Foundation, either version 3 of the License, or
8
 * (at your option) any later version.
9
 *
10
 * wger Workout Manager is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU Affero General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU Affero General Public License
16
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
 */
18

19
import 'package:flutter/material.dart';
20
import 'package:flutter_riverpod/flutter_riverpod.dart';
21
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
22
import 'package:wger/core/form_screen.dart';
23
import 'package:wger/core/formatting/formatting.dart';
24
import 'package:wger/core/platform.dart';
25
import 'package:wger/core/widgets/text_prompt.dart';
26
import 'package:wger/core/widgets/wger_image.dart';
27
import 'package:wger/features/gallery/models/image.dart';
28
import 'package:wger/features/gallery/providers/gallery_notifier.dart';
29
import 'package:wger/l10n/generated/app_localizations.dart';
30

31
import 'forms.dart';
32

33
class Gallery extends ConsumerWidget {
34
  const Gallery();
1✔
35

36
  @override
×
37
  Widget build(BuildContext context, WidgetRef ref) {
38
    final images = ref.watch(galleryProvider).value ?? const [];
×
39

40
    return Padding(
×
41
      padding: const EdgeInsets.all(5),
42
      child: images.isEmpty
×
43
          ? const TextPrompt()
44
          : MasonryGridView.count(
×
45
              crossAxisCount: 2,
46
              mainAxisSpacing: 5,
47
              crossAxisSpacing: 5,
48
              itemCount: images.length,
×
49
              itemBuilder: (context, index) {
×
50
                final currentImage = images[index];
×
51

52
                return GestureDetector(
×
53
                  onTap: () {
×
54
                    showModalBottomSheet(
×
55
                      builder: (context) => ImageDetail(image: currentImage),
×
56
                      context: context,
57
                    );
58
                  },
59
                  child: WgerImage(
×
60
                    key: Key('image-${currentImage.id!}'),
×
61
                    mediaPath: currentImage.imagePath,
×
62
                    fit: BoxFit.cover,
63
                  ),
64
                );
65
              },
66
            ),
67
    );
68
  }
69
}
70

71
class ImageDetail extends ConsumerWidget {
72
  const ImageDetail({
1✔
73
    super.key,
74
    required this.image,
75
  });
76

77
  final GalleryImage image;
78

79
  @override
1✔
80
  Widget build(BuildContext context, WidgetRef ref) {
81
    return Container(
1✔
82
      key: Key('image-${image.id!}-detail'),
4✔
83
      padding: const EdgeInsets.all(10),
84
      child: Column(
1✔
85
        children: [
1✔
86
          Text(
1✔
87
            localizedDate(context).format(image.date),
4✔
88
            style: Theme.of(context).textTheme.headlineSmall,
3✔
89
          ),
90
          Expanded(
1✔
91
            child: WgerImage(
1✔
92
              mediaPath: image.imagePath,
2✔
93
              fit: BoxFit.contain,
94
            ),
95
          ),
96
          Padding(
1✔
97
            padding: const EdgeInsets.symmetric(vertical: 8),
98
            child: Text(image.description),
3✔
99
          ),
100
          Row(
1✔
101
            mainAxisAlignment: MainAxisAlignment.center,
102
            children: [
1✔
103
              IconButton(
1✔
104
                icon: const Icon(Icons.delete),
105
                onPressed: () {
×
106
                  ref.read(galleryProvider.notifier).deleteImage(image);
×
107
                  Navigator.of(context).pop();
×
108
                },
109
              ),
110
              if (!isDesktop)
1✔
111
                IconButton(
1✔
112
                  icon: const Icon(Icons.edit),
113
                  onPressed: () {
×
114
                    Navigator.pushNamed(
×
115
                      context,
116
                      FormScreen.routeName,
117
                      arguments: FormScreenArguments(
×
118
                        AppLocalizations.of(context).edit,
×
119
                        ImageForm(image),
×
120
                        hasListView: true,
121
                      ),
122
                    );
123
                  },
124
                ),
125
            ],
126
          ),
127
        ],
128
      ),
129
    );
130
  }
131
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc