From 1ad4e5aebb73713ec0b77e2155197739721730cf Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Thu, 18 Mar 2021 11:15:13 +0100 Subject: [PATCH] Move default server to constants file --- lib/helpers/consts.dart | 6 ++++++ lib/providers/auth.dart | 4 ++-- lib/screens/auth_screen.dart | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/helpers/consts.dart b/lib/helpers/consts.dart index 595a46151..d6e113ec1 100644 --- a/lib/helpers/consts.dart +++ b/lib/helpers/consts.dart @@ -16,4 +16,10 @@ * along with this program. If not, see . */ +/// Size for the "smaller" icons, e.g. when they belong to less important items +/// and we don't want to fill the whole screen const double ICON_SIZE_SMALL = 20; + +/// Default wger server during login +final DEFAULT_SERVER = 'https://wger.rge.uber.space'; +//final DEFAULT_SERVER = 'http://localhost:8000'; diff --git a/lib/providers/auth.dart b/lib/providers/auth.dart index 14428215d..aca622a55 100644 --- a/lib/providers/auth.dart +++ b/lib/providers/auth.dart @@ -28,12 +28,11 @@ import 'package:flutter/widgets.dart'; import 'package:http/http.dart' as http; import 'package:package_info/package_info.dart'; import 'package:shared_preferences/shared_preferences.dart'; +import 'package:wger/helpers/consts.dart'; import 'package:wger/models/http_exception.dart'; import 'helpers.dart'; -final DEFAULT_SERVER = 'https://wger.rge.uber.space'; - class Auth with ChangeNotifier { String token; String serverUrl; @@ -209,6 +208,7 @@ class Auth with ChangeNotifier { log('logging out'); token = null; serverUrl = null; + dataInit = false; // _userId = null; // _expiryDate = null; // if (_authTimer != null) { diff --git a/lib/screens/auth_screen.dart b/lib/screens/auth_screen.dart index 44d9d5747..a531746f1 100644 --- a/lib/screens/auth_screen.dart +++ b/lib/screens/auth_screen.dart @@ -19,6 +19,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:provider/provider.dart'; +import 'package:wger/helpers/consts.dart'; import 'package:wger/helpers/ui.dart'; import 'package:wger/models/http_exception.dart';