diff --git a/lib/helpers/consts.dart b/lib/helpers/consts.dart index d6d3a0553..83c69968c 100644 --- a/lib/helpers/consts.dart +++ b/lib/helpers/consts.dart @@ -19,6 +19,13 @@ import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; +/// Minimum server version required by this version of the app. +/// +/// Bump this value whenever you depend on API changes that are only available +/// in a newer server release. The check is performed during login and +/// auto-login and mirrors what the server does with MIN_APP_VERSION. +const MIN_SERVER_VERSION = '2.5'; + /// 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; @@ -31,13 +38,6 @@ const DEFAULT_SERVER_TEST = 'https://dev.wger.de'; const TESTSERVER_USER_NAME = 'user'; const TESTSERVER_PASSWORD = 'flutteruser'; -/// Minimum server version required by this version of the app. -/// -/// Bump this value whenever you depend on API changes that are only available -/// in a newer server release. The check is performed during login and -/// auto-login and mirrors what the server does with MIN_APP_VERSION. -const MIN_SERVER_VERSION = '2.5'; - // Weight and repetition units for the workout logs const REP_UNIT_REPETITIONS_ID = 1; const REP_UNIT_TILL_FAILURE_ID = 2; diff --git a/lib/widgets/auth/auth_card.dart b/lib/widgets/auth/auth_card.dart index b9ef2bcb3..9e6f08fc2 100644 --- a/lib/widgets/auth/auth_card.dart +++ b/lib/widgets/auth/auth_card.dart @@ -100,7 +100,7 @@ class _AuthCardState extends ConsumerState { } }); - _preFillTextfields(); + _preFillTextFields(); } /// Opens the server's web-handoff page in the system browser. The user @@ -122,7 +122,7 @@ class _AuthCardState extends ConsumerState { ); } - void _preFillTextfields() { + void _preFillTextFields() { if (kDebugMode && _authMode == AuthMode.login) { setState(() { _usernameController.text = TESTSERVER_USER_NAME; @@ -131,7 +131,7 @@ class _AuthCardState extends ConsumerState { } } - void _resetTextfields() { + void _resetTextFields() { _usernameController.clear(); _passwordController.clear(); _refreshTokenController.clear(); @@ -231,13 +231,13 @@ class _AuthCardState extends ConsumerState { _useUsernameAndPassword = true; _autoValidate = false; }); - _resetTextfields(); + _resetTextFields(); } else { setState(() { _authMode = AuthMode.login; _autoValidate = false; }); - _preFillTextfields(); + _preFillTextFields(); } }