mirror of
https://github.com/wger-project/flutter.git
synced 2026-11-29 01:18:35 +01:00
Properly online-gate access to the user profile
This commit is contained in:
@@ -22,6 +22,7 @@ import 'package:wger/database/powersync/powersync.dart' show syncStatus;
|
||||
import 'package:wger/l10n/generated/app_localizations.dart';
|
||||
import 'package:wger/providers/account_notifier.dart';
|
||||
import 'package:wger/providers/auth_notifier.dart';
|
||||
import 'package:wger/providers/network_provider.dart';
|
||||
import 'package:wger/screens/form_screen.dart';
|
||||
import 'package:wger/screens/settings_dashboard_widgets_screen.dart';
|
||||
import 'package:wger/widgets/core/about.dart';
|
||||
@@ -79,6 +80,8 @@ class MainSettingsDialog extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final isOnline = ref.watch(networkStatusProvider);
|
||||
|
||||
return AlertDialog(
|
||||
title: Text(AppLocalizations.of(context).optionsLabel),
|
||||
actions: [
|
||||
@@ -97,6 +100,10 @@ class MainSettingsDialog extends ConsumerWidget {
|
||||
//dense: true,
|
||||
leading: const Icon(Icons.person),
|
||||
title: Text(AppLocalizations.of(context).userProfile),
|
||||
enabled: isOnline,
|
||||
trailing: isOnline
|
||||
? null
|
||||
: Icon(Icons.cloud_off, color: Theme.of(context).colorScheme.outline),
|
||||
onTap: () {
|
||||
Navigator.pushNamed(
|
||||
context,
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/*
|
||||
* This file is part of wger Workout Manager <https://github.com/wger-project>.
|
||||
* Copyright (C) 2020, 2021 wger Team
|
||||
* Copyright (c) 2020 - 2026 wger Team
|
||||
*
|
||||
* wger Workout Manager is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* wger Workout Manager is distributed in the hope that it will be useful,
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
|
||||
Reference in New Issue
Block a user