WT1.1.2f login fix
This commit is contained in:
@@ -62,7 +62,6 @@ class _ExerciseNewPageState extends State<ExerciseNewPage> with Trans{
|
||||
exerciseBloc.exerciseRepository.exerciseType.nameTranslation;
|
||||
|
||||
return Form(
|
||||
autovalidate: true,
|
||||
child: Scaffold(
|
||||
resizeToAvoidBottomInset: true,
|
||||
appBar: AppBarNav(depth: 1),
|
||||
@@ -168,7 +167,7 @@ class _ExerciseNewPageState extends State<ExerciseNewPage> with Trans{
|
||||
},
|
||||
listViewHeight: 80,
|
||||
textStyle: TextStyle(fontSize: 24),
|
||||
textStyleHighlighted: TextStyle(fontSize: 40, color: Colors.orange, fontWeight: FontWeight.bold),
|
||||
textStyleHighlighted: TextStyle(fontSize: 38, color: Colors.orange, fontWeight: FontWeight.bold),
|
||||
//decoration: _decoration,
|
||||
),
|
||||
|
||||
@@ -197,7 +196,7 @@ class _ExerciseNewPageState extends State<ExerciseNewPage> with Trans{
|
||||
},
|
||||
listViewHeight: 80,
|
||||
textStyle: TextStyle(fontSize: 24),
|
||||
textStyleHighlighted: TextStyle(fontSize: 40, color: Colors.orange, fontWeight: FontWeight.bold),
|
||||
textStyleHighlighted: TextStyle(fontSize: 38, color: Colors.orange, fontWeight: FontWeight.bold),
|
||||
//decoration: _decoration,
|
||||
),
|
||||
|
||||
|
||||
+15
-9
@@ -4,6 +4,7 @@ import 'package:aitrainer_app/localization/app_localization.dart';
|
||||
import 'package:aitrainer_app/repository/user_repository.dart';
|
||||
import 'package:aitrainer_app/util/common.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';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
@@ -43,6 +44,7 @@ class _LoginWidget extends State<LoginWidget> with Common, Trans {
|
||||
final loginBloc = BlocProvider.of<LoginFormBloc>(context);
|
||||
return Scaffold(
|
||||
key: _scaffoldKey,
|
||||
appBar: AppBarMin(),
|
||||
body: FormBlocListener<LoginFormBloc, String, String>(
|
||||
onSubmitting: (context, state) {
|
||||
LoadingDialog.show(context);
|
||||
@@ -53,18 +55,22 @@ class _LoginWidget extends State<LoginWidget> with Common, Trans {
|
||||
},
|
||||
onFailure: (context, state) {
|
||||
LoadingDialog.hide(context);
|
||||
showInSnackBar(state.failureResponse);
|
||||
showInSnackBar(t(state.failureResponse));
|
||||
},
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage('asset/image/WT_login.png'),
|
||||
fit: BoxFit.cover,
|
||||
alignment: Alignment.center,
|
||||
child: SafeArea(
|
||||
top: false,
|
||||
bottom: false,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage('asset/image/WT_login.png'),
|
||||
fit: BoxFit.cover,
|
||||
alignment: Alignment.center,
|
||||
),
|
||||
),
|
||||
child: buildLoginForm(loginBloc, accountBloc),
|
||||
),
|
||||
child: buildLoginForm(loginBloc, accountBloc),
|
||||
),
|
||||
)
|
||||
),
|
||||
);
|
||||
}));
|
||||
|
||||
+104
-94
@@ -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/widgets/app_bar_min.dart';
|
||||
import 'package:aitrainer_app/widgets/splash.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
@@ -45,14 +46,15 @@ class _RegistrationWidget extends State<RegistrationWidget> with Common {
|
||||
final accountBloc = BlocProvider.of<AccountBloc>(context);
|
||||
return BlocProvider(
|
||||
create: (context) => RegistrationFormBloc(
|
||||
userRepository: UserRepository(),
|
||||
accountBloc: accountBloc),
|
||||
userRepository: UserRepository(), accountBloc: accountBloc),
|
||||
child: Builder(builder: (context) {
|
||||
// ignore: close_sinks
|
||||
final registrationBloc = BlocProvider.of<RegistrationFormBloc>(context);
|
||||
final registrationBloc =
|
||||
BlocProvider.of<RegistrationFormBloc>(context);
|
||||
|
||||
return Scaffold(
|
||||
key: _scaffoldKey,
|
||||
appBar: AppBarMin(),
|
||||
body: FormBlocListener<RegistrationFormBloc, String, String>(
|
||||
onSubmitting: (context, state) {
|
||||
LoadingDialog.show(context);
|
||||
@@ -65,29 +67,33 @@ class _RegistrationWidget extends State<RegistrationWidget> with Common {
|
||||
LoadingDialog.hide(context);
|
||||
showInSnackBar(state.failureResponse);
|
||||
},
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage('asset/image/WT_login.png'),
|
||||
fit: BoxFit.cover,
|
||||
//height: double.infinity,
|
||||
//width: double.infinity,
|
||||
alignment: Alignment.center,
|
||||
child: SafeArea(
|
||||
bottom: false,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage('asset/image/WT_login.png'),
|
||||
fit: BoxFit.cover,
|
||||
//height: double.infinity,
|
||||
//width: double.infinity,
|
||||
alignment: Alignment.center,
|
||||
),
|
||||
),
|
||||
),
|
||||
child: Form(
|
||||
key: _formKey,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.only(left: 25, right: 50),
|
||||
child: ListView(
|
||||
shrinkWrap: false,
|
||||
padding: EdgeInsets.only(top: 150.0),
|
||||
//mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: <Widget>[
|
||||
Divider(color: Colors.transparent,),
|
||||
//Spacer(flex:4),
|
||||
child: Form(
|
||||
key: _formKey,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.only(left: 25, right: 50),
|
||||
child: ListView(
|
||||
shrinkWrap: false,
|
||||
padding: EdgeInsets.only(top: 150.0),
|
||||
//mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: <Widget>[
|
||||
Divider(
|
||||
color: Colors.transparent,
|
||||
),
|
||||
//Spacer(flex:4),
|
||||
|
||||
/* FlatButton(
|
||||
/* FlatButton(
|
||||
child: new Image.asset(
|
||||
'asset/image/login_fb.png',
|
||||
width: cWidth * .85,
|
||||
@@ -98,79 +104,83 @@ class _RegistrationWidget extends State<RegistrationWidget> with Common {
|
||||
},
|
||||
),
|
||||
Text(AppLocalizations.of(context).translate("OR")),*/
|
||||
Divider(),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
new InkWell(
|
||||
child: new Text(
|
||||
AppLocalizations.of(context)
|
||||
.translate('SignUp'),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 24)),
|
||||
Divider(),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
new InkWell(
|
||||
child: new Text(
|
||||
AppLocalizations.of(context)
|
||||
.translate('SignUp'),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 24)),
|
||||
),
|
||||
],
|
||||
),
|
||||
Divider(),
|
||||
TextFieldBlocBuilder(
|
||||
key: LibraryKeys.loginEmailField,
|
||||
textFieldBloc: registrationBloc.emailField,
|
||||
decoration: InputDecoration(
|
||||
fillColor: Colors.white,
|
||||
filled: true,
|
||||
labelText: 'Email',
|
||||
),
|
||||
],
|
||||
),
|
||||
Divider(),
|
||||
TextFieldBlocBuilder(
|
||||
key: LibraryKeys.loginEmailField,
|
||||
textFieldBloc: registrationBloc.emailField,
|
||||
decoration: InputDecoration(
|
||||
fillColor: Colors.white,
|
||||
filled: true,
|
||||
labelText: 'Email',
|
||||
),
|
||||
),
|
||||
Divider(
|
||||
color: Colors.transparent,
|
||||
),
|
||||
TextFieldBlocBuilder(
|
||||
key: LibraryKeys.loginPasswordField,
|
||||
textFieldBloc: registrationBloc.passwordField,
|
||||
decoration: InputDecoration(
|
||||
fillColor: Colors.white,
|
||||
filled: true,
|
||||
labelText: 'Password',
|
||||
Divider(
|
||||
color: Colors.transparent,
|
||||
),
|
||||
suffixButton: SuffixButton.obscureText,
|
||||
),
|
||||
Divider(
|
||||
color: Colors.transparent,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: <Widget>[
|
||||
new FlatButton(
|
||||
child: Image.asset(
|
||||
'asset/image/WT_OK.png',
|
||||
width: 100,
|
||||
height: 100),
|
||||
onPressed: () => {
|
||||
registrationBloc.add(SubmitFormBloc())
|
||||
}),
|
||||
]),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceAround,
|
||||
children: <Widget>[
|
||||
new InkWell(
|
||||
child: new Text(AppLocalizations.of(context)
|
||||
.translate('Login')),
|
||||
onTap: () => Navigator.of(context)
|
||||
.pushNamed('login'),
|
||||
),
|
||||
Spacer(flex: 1),
|
||||
new InkWell(
|
||||
child: new Text(AppLocalizations.of(context)
|
||||
.translate('Privacy')),
|
||||
onTap: () =>
|
||||
Navigator.of(context).pushNamed('gdpr'),
|
||||
),
|
||||
Spacer(flex: 2),
|
||||
]),
|
||||
//Spacer(flex:2),
|
||||
])),
|
||||
TextFieldBlocBuilder(
|
||||
key: LibraryKeys.loginPasswordField,
|
||||
textFieldBloc: registrationBloc.passwordField,
|
||||
decoration: InputDecoration(
|
||||
fillColor: Colors.white,
|
||||
filled: true,
|
||||
labelText: 'Password',
|
||||
),
|
||||
suffixButton: SuffixButton.obscureText,
|
||||
),
|
||||
Divider(
|
||||
color: Colors.transparent,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: <Widget>[
|
||||
new FlatButton(
|
||||
child: Image.asset(
|
||||
'asset/image/WT_OK.png',
|
||||
width: 100,
|
||||
height: 100),
|
||||
onPressed: () => {
|
||||
registrationBloc
|
||||
.add(SubmitFormBloc())
|
||||
}),
|
||||
]),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceAround,
|
||||
children: <Widget>[
|
||||
new InkWell(
|
||||
child: new Text(
|
||||
AppLocalizations.of(context)
|
||||
.translate('Login')),
|
||||
onTap: () => Navigator.of(context)
|
||||
.pushNamed('login'),
|
||||
),
|
||||
Spacer(flex: 1),
|
||||
new InkWell(
|
||||
child: new Text(
|
||||
AppLocalizations.of(context)
|
||||
.translate('Privacy')),
|
||||
onTap: () => Navigator.of(context)
|
||||
.pushNamed('gdpr'),
|
||||
),
|
||||
Spacer(flex: 2),
|
||||
]),
|
||||
//Spacer(flex:2),
|
||||
])),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'package:aitrainer_app/repository/user_repository.dart';
|
||||
import 'package:aitrainer_app/service/firebase_api.dart';
|
||||
import 'package:aitrainer_app/util/common.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';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
@@ -24,12 +25,13 @@ class ResetPasswordPage extends StatelessWidget with Trans {
|
||||
setContext(context);
|
||||
return BlocProvider(
|
||||
create: (context) => ResetPasswordFormBloc(
|
||||
userRepository: UserRepository(),
|
||||
),
|
||||
userRepository: UserRepository(),
|
||||
),
|
||||
child: Builder(builder: (context) {
|
||||
final loginBloc = BlocProvider.of<ResetPasswordFormBloc>(context);
|
||||
return Scaffold(
|
||||
key: _scaffoldKey,
|
||||
appBar: AppBarMin(),
|
||||
body: FormBlocListener<ResetPasswordFormBloc, String, String>(
|
||||
onSubmitting: (context, state) {
|
||||
LoadingDialog.show(context);
|
||||
@@ -42,17 +44,20 @@ class ResetPasswordPage extends StatelessWidget with Trans {
|
||||
LoadingDialog.hide(context);
|
||||
showInSnackBar(state.failureResponse);
|
||||
},
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage('asset/image/WT_login.png'),
|
||||
fit: BoxFit.cover,
|
||||
//height: double.infinity,
|
||||
//width: double.infinity,
|
||||
alignment: Alignment.center,
|
||||
child: SafeArea(
|
||||
bottom: false,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage('asset/image/WT_login.png'),
|
||||
fit: BoxFit.cover,
|
||||
//height: double.infinity,
|
||||
//width: double.infinity,
|
||||
alignment: Alignment.center,
|
||||
),
|
||||
),
|
||||
child: buildResetPasswordForm(loginBloc),
|
||||
),
|
||||
child: buildResetPasswordForm(loginBloc),
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -60,21 +65,22 @@ class ResetPasswordPage extends StatelessWidget with Trans {
|
||||
}
|
||||
|
||||
Widget buildResetPasswordForm(ResetPasswordFormBloc formBloc) {
|
||||
|
||||
return Form(
|
||||
key: _formKey,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.only(left: 25, right: 100),
|
||||
child:
|
||||
ListView(shrinkWrap: false, padding: EdgeInsets.only(top: 120.0),
|
||||
children: <Widget>[
|
||||
padding: const EdgeInsets.only(left: 25, right: 50),
|
||||
child: ListView(
|
||||
shrinkWrap: false,
|
||||
padding: EdgeInsets.only(top: 150.0),
|
||||
children: <Widget>[
|
||||
Divider(),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
new InkWell(
|
||||
child: new Text(
|
||||
AppLocalizations.of(context).translate('I forgot the password'),
|
||||
AppLocalizations.of(context)
|
||||
.translate('I forgot the password'),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold, fontSize: 24)),
|
||||
),
|
||||
@@ -103,9 +109,7 @@ class ResetPasswordPage extends StatelessWidget with Trans {
|
||||
key: LibraryKeys.loginOKButton,
|
||||
child: Image.asset('asset/image/WT_OK.png',
|
||||
width: 100, height: 100),
|
||||
onPressed: () => {
|
||||
formBloc.add(SubmitFormBloc())
|
||||
}),
|
||||
onPressed: () => {formBloc.add(SubmitFormBloc())}),
|
||||
]),
|
||||
Divider(
|
||||
color: Colors.transparent,
|
||||
@@ -116,8 +120,7 @@ class ResetPasswordPage extends StatelessWidget with Trans {
|
||||
new InkWell(
|
||||
child: new Text(
|
||||
AppLocalizations.of(context).translate('Login')),
|
||||
onTap: () =>
|
||||
Navigator.of(context).pushNamed('login'),
|
||||
onTap: () => Navigator.of(context).pushNamed('login'),
|
||||
),
|
||||
Spacer(flex: 1),
|
||||
]),
|
||||
@@ -125,11 +128,9 @@ class ResetPasswordPage extends StatelessWidget with Trans {
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
void showInSnackBar(String error) {
|
||||
_scaffoldKey.currentState.showSnackBar(SnackBar(
|
||||
backgroundColor: Colors.orange,
|
||||
content: Text(error, style: TextStyle(color: Colors.white))));
|
||||
backgroundColor: Colors.orange,
|
||||
content: Text(error, style: TextStyle(color: Colors.white))));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user