This commit is contained in:
Roland Geider
2026-05-25 13:41:22 +02:00
parent 78580084a2
commit 806fc93116
2 changed files with 12 additions and 12 deletions

View File

@@ -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;

View File

@@ -100,7 +100,7 @@ class _AuthCardState extends ConsumerState<AuthCard> {
}
});
_preFillTextfields();
_preFillTextFields();
}
/// Opens the server's web-handoff page in the system browser. The user
@@ -122,7 +122,7 @@ class _AuthCardState extends ConsumerState<AuthCard> {
);
}
void _preFillTextfields() {
void _preFillTextFields() {
if (kDebugMode && _authMode == AuthMode.login) {
setState(() {
_usernameController.text = TESTSERVER_USER_NAME;
@@ -131,7 +131,7 @@ class _AuthCardState extends ConsumerState<AuthCard> {
}
}
void _resetTextfields() {
void _resetTextFields() {
_usernameController.clear();
_passwordController.clear();
_refreshTokenController.clear();
@@ -231,13 +231,13 @@ class _AuthCardState extends ConsumerState<AuthCard> {
_useUsernameAndPassword = true;
_autoValidate = false;
});
_resetTextfields();
_resetTextFields();
} else {
setState(() {
_authMode = AuthMode.login;
_autoValidate = false;
});
_preFillTextfields();
_preFillTextFields();
}
}