• 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

91.67
/lib/core/powersync_unreachable_screen.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
import 'package:flutter_riverpod/flutter_riverpod.dart';
21
import 'package:wger/core/consts.dart';
22
import 'package:wger/core/misc.dart';
23
import 'package:wger/core/network/auth_notifier.dart';
24
import 'package:wger/l10n/generated/app_localizations.dart';
25

26
/// Shown when the wger server is reachable but PowerSync is not, AND the
27
/// user has never completed a sync (i.e. has no usable local data).
28
class PowerSyncUnreachableScreen extends ConsumerWidget {
29
  const PowerSyncUnreachableScreen({super.key});
1✔
30

31
  static const routeName = '/powersync-unreachable';
32

33
  @override
1✔
34
  Widget build(BuildContext context, WidgetRef ref) {
35
    final i18n = AppLocalizations.of(context);
1✔
36

37
    return Scaffold(
1✔
38
      body: Center(
1✔
39
        child: AlertDialog(
1✔
40
          title: Text(
1✔
41
            i18n.powerSyncUnreachableTitle,
1✔
42
            style: Theme.of(context).textTheme.headlineSmall,
3✔
43
          ),
44
          content: SingleChildScrollView(
1✔
45
            child: Text(i18n.powerSyncUnreachableContent),
2✔
46
          ),
47
          actions: [
1✔
48
            TextButton(
1✔
49
              onPressed: () async {
1✔
50
                final navigator = Navigator.of(context);
1✔
51
                await ref.read(authProvider.notifier).logout();
4✔
52
                navigator.pushReplacementNamed('/');
1✔
53
              },
54
              child: Text(i18n.logout),
2✔
55
            ),
56
            TextButton(
1✔
57
              onPressed: () => launchURL(READTHEDOCS_URL, context),
×
58
              child: Text(i18n.aboutViewDocsTitle),
2✔
59
            ),
60
            FilledButton(
1✔
61
              onPressed: () => ref.read(authProvider.notifier).retryAutoLogin(),
×
62
              child: Text(i18n.serverUnreachableRetry),
2✔
63
            ),
64
          ],
65
        ),
66
      ),
67
    );
68
  }
69
}
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