WT1.1.2 build 32 login error messages fixes
This commit is contained in:
+2
-6
@@ -51,7 +51,8 @@ class _LoginWidget extends State<LoginWidget> with Common, Trans {
|
||||
},
|
||||
onFailure: (context, state) {
|
||||
LoadingDialog.hide(context);
|
||||
showInSnackBar(t(state.failureResponse));
|
||||
Scaffold.of(context).showSnackBar(SnackBar(
|
||||
backgroundColor: Colors.orange, content: Text(t(state.failureResponse), style: TextStyle(color: Colors.white))));
|
||||
},
|
||||
onLoaded: (context, state) {},
|
||||
child: loadForm(loginBloc, accountBloc)),
|
||||
@@ -159,9 +160,4 @@ class _LoginWidget extends State<LoginWidget> with Common, Trans {
|
||||
])),
|
||||
);
|
||||
}
|
||||
|
||||
void showInSnackBar(String error) {
|
||||
_scaffoldKey.currentState
|
||||
.showSnackBar(SnackBar(backgroundColor: Colors.orange, content: Text(error, style: TextStyle(color: Colors.white))));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:aitrainer_app/localization/app_localization.dart';
|
||||
import 'package:aitrainer_app/util/common.dart';
|
||||
import 'package:aitrainer_app/repository/customer_repository.dart';
|
||||
import 'package:aitrainer_app/repository/user_repository.dart';
|
||||
import 'package:aitrainer_app/util/trans.dart';
|
||||
import 'package:aitrainer_app/widgets/app_bar_min.dart';
|
||||
import 'package:aitrainer_app/widgets/splash.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -34,11 +35,12 @@ class RegistrationWidget extends StatefulWidget {
|
||||
State<StatefulWidget> createState() => _RegistrationWidget();
|
||||
}
|
||||
|
||||
class _RegistrationWidget extends State<RegistrationWidget> with Common {
|
||||
class _RegistrationWidget extends State<RegistrationWidget> with Common, Trans {
|
||||
final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
setContext(context);
|
||||
// ignore: close_sinks
|
||||
final accountBloc = BlocProvider.of<AccountBloc>(context);
|
||||
return BlocProvider(
|
||||
@@ -60,7 +62,8 @@ class _RegistrationWidget extends State<RegistrationWidget> with Common {
|
||||
},
|
||||
onFailure: (context, state) {
|
||||
LoadingDialog.hide(context);
|
||||
showInSnackBar(state.failureResponse);
|
||||
Scaffold.of(context).showSnackBar(SnackBar(
|
||||
backgroundColor: Colors.orange, content: Text(t(state.failureResponse), style: TextStyle(color: Colors.white))));
|
||||
},
|
||||
child: SafeArea(
|
||||
bottom: false,
|
||||
@@ -158,11 +161,4 @@ class _RegistrationWidget extends State<RegistrationWidget> with Common {
|
||||
);
|
||||
}));
|
||||
}
|
||||
|
||||
void showInSnackBar(String error) {
|
||||
_scaffoldKey.currentState.showSnackBar(SnackBar(
|
||||
backgroundColor: Colors.orange,
|
||||
content: Text(AppLocalizations.of(context).translate("There is an error: during registration:") + " " + error,
|
||||
style: TextStyle(color: Colors.white))));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user