• 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

88.89
/lib/core/widgets/object_gone_redirect.dart
1
/*
2
 * This file is part of wger Workout Manager <https://github.com/wger-project>.
3
 * Copyright (c) 2026 - 2026 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
 * This program 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

21
/// Leaves a detail screen whose object was deleted and dropped from the live
22
/// stream while it was open. Returns a blank placeholder and pops on the next
23
/// microtask (navigation isn't allowed mid-build), but only when this is the
24
/// current route, so an open child route (form, dialog) is left alone. Pops
25
/// every screen beneath it about the same object too, matched by equal route
26
/// argument (e.g. a routine's logs view on its detail), landing on the list.
27
Widget objectGoneRedirect(BuildContext context) {
3✔
28
  Future.microtask(() {
6✔
29
    if (!context.mounted) {
3✔
30
      return;
31
    }
32
    final route = ModalRoute.of(context);
3✔
33
    if (route == null || !route.isCurrent) {
3✔
34
      return;
35
    }
36
    final navigator = Navigator.of(context);
3✔
37
    final goneArg = route.settings.arguments;
6✔
38
    if (goneArg == null) {
39
      navigator.pop();
×
40
      return;
41
    }
42
    navigator.popUntil((r) => r.settings.arguments != goneArg);
15✔
43
  });
44
  return const SizedBox.shrink();
45
}
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