@@ -23,7 +23,6 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart';
23
23
import 'package:provider/provider.dart' ;
24
24
import 'package:wger/exceptions/http_exception.dart' ;
25
25
import 'package:wger/helpers/consts.dart' ;
26
- import 'package:wger/helpers/misc.dart' ;
27
26
import 'package:wger/helpers/ui.dart' ;
28
27
import 'package:wger/screens/update_app_screen.dart' ;
29
28
import 'package:wger/theme/theme.dart' ;
@@ -37,6 +36,7 @@ enum AuthMode {
37
36
38
37
class AuthScreen extends StatelessWidget {
39
38
const AuthScreen ();
39
+
40
40
static const routeName = '/auth' ;
41
41
42
42
@override
@@ -113,7 +113,6 @@ class _AuthCardState extends State<AuthCard> {
113
113
bool confirmIsObscure = true ;
114
114
115
115
final GlobalKey <FormState > _formKey = GlobalKey ();
116
- bool _canRegister = true ;
117
116
AuthMode _authMode = AuthMode .Login ;
118
117
bool _hideCustomServer = true ;
119
118
final Map <String , String > _authData = {
@@ -148,17 +147,6 @@ class _AuthCardState extends State<AuthCard> {
148
147
_serverUrlController.text = value;
149
148
});
150
149
151
- // Check if the API key is set
152
- //
153
- // If not, the user will not be able to register via the app
154
- try {
155
- final metadata = Provider .of <AuthProvider >(context, listen: false ).metadata;
156
- if (metadata.containsKey (MANIFEST_KEY_API ) && metadata[MANIFEST_KEY_API ] == '' ) {
157
- _canRegister = false ;
158
- }
159
- } on PlatformException {
160
- _canRegister = false ;
161
- }
162
150
_preFillTextfields ();
163
151
}
164
152
@@ -238,11 +226,6 @@ class _AuthCardState extends State<AuthCard> {
238
226
}
239
227
240
228
void _switchAuthMode () {
241
- if (! _canRegister) {
242
- launchURL (DEFAULT_SERVER_PROD , context);
243
- return ;
244
- }
245
-
246
229
if (_authMode == AuthMode .Login ) {
247
230
setState (() {
248
231
_authMode = AuthMode .Signup ;
@@ -482,9 +465,9 @@ class _AuthCardState extends State<AuthCard> {
482
465
},
483
466
child: Container (
484
467
color: Colors .transparent,
485
- child: Row (
486
- mainAxisAlignment: MainAxisAlignment .center,
468
+ child: Column (
487
469
children: [
470
+ // TODO: i18n!
488
471
Text (
489
472
text.substring (0 , text.lastIndexOf ('?' ) + 1 ),
490
473
),
0 commit comments