WT1.1.2g Sizes
This commit is contained in:
@@ -98,9 +98,6 @@ class _ExerciseNewPageState extends State<ExerciseNewPage> with Trans {
|
||||
},
|
||||
builder: (context, state) {
|
||||
final exerciseBloc = BlocProvider.of<ExerciseNewBloc>(context);
|
||||
double width = MediaQuery.of(context).size.width;
|
||||
double height = MediaQuery.of(context).size.height;
|
||||
exerciseBloc.setMediaDimensions(width, height);
|
||||
return getExerciseWidget(exerciseBloc, exerciseType);
|
||||
},
|
||||
));
|
||||
|
||||
+81
-106
@@ -35,32 +35,26 @@ class _LoginWidget extends State<LoginWidget> with Common, Trans {
|
||||
final accountBloc = BlocProvider.of<AccountBloc>(context);
|
||||
setContext(context);
|
||||
return BlocProvider(
|
||||
create: (context) => LoginFormBloc(
|
||||
userRepository: UserRepository(),
|
||||
accountBloc: accountBloc
|
||||
),
|
||||
create: (context) => LoginFormBloc(userRepository: UserRepository(), accountBloc: accountBloc),
|
||||
child: Builder(builder: (context) {
|
||||
final loginBloc = BlocProvider.of<LoginFormBloc>(context);
|
||||
return Scaffold(
|
||||
key: _scaffoldKey,
|
||||
//key: _scaffoldKey,
|
||||
appBar: AppBarMin(),
|
||||
body: FormBlocListener<LoginFormBloc, String, String>(
|
||||
onSubmitting: (context, state) {
|
||||
LoadingDialog.show(context);
|
||||
},
|
||||
onSuccess: (context, state) {
|
||||
LoadingDialog.hide(context);
|
||||
Navigator.of(context).pushNamed('home');
|
||||
},
|
||||
onFailure: (context, state) {
|
||||
LoadingDialog.hide(context);
|
||||
showInSnackBar(t(state.failureResponse));
|
||||
},
|
||||
onLoaded: (context, state ) {
|
||||
|
||||
},
|
||||
child: loadForm(loginBloc, accountBloc)
|
||||
),
|
||||
onSubmitting: (context, state) {
|
||||
LoadingDialog.show(context);
|
||||
},
|
||||
onSuccess: (context, state) {
|
||||
LoadingDialog.hide(context);
|
||||
Navigator.of(context).pushNamed('home');
|
||||
},
|
||||
onFailure: (context, state) {
|
||||
LoadingDialog.hide(context);
|
||||
showInSnackBar(t(state.failureResponse));
|
||||
},
|
||||
onLoaded: (context, state) {},
|
||||
child: loadForm(loginBloc, accountBloc)),
|
||||
);
|
||||
}));
|
||||
}
|
||||
@@ -83,16 +77,13 @@ class _LoginWidget extends State<LoginWidget> with Common, Trans {
|
||||
}
|
||||
|
||||
Widget buildLoginForm(LoginFormBloc formBloc, AccountBloc accountBloc) {
|
||||
|
||||
return Form(
|
||||
key: _scaffoldKey,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.only(left: 15, right: 50),
|
||||
child:
|
||||
ListView(shrinkWrap: false, padding: EdgeInsets.only(top: 150.0),
|
||||
children: <Widget>[
|
||||
Divider(color: Colors.transparent),
|
||||
/* FlatButton(
|
||||
child: ListView(shrinkWrap: false, padding: EdgeInsets.only(top: 150.0), children: <Widget>[
|
||||
Divider(color: Colors.transparent),
|
||||
/* FlatButton(
|
||||
child: new Image.asset(
|
||||
'asset/image/login_fb.png',
|
||||
width: cWidth * .85,
|
||||
@@ -104,89 +95,73 @@ class _LoginWidget extends State<LoginWidget> with Common, Trans {
|
||||
},
|
||||
),
|
||||
Text(AppLocalizations.of(context).translate("OR")),*/
|
||||
Divider(),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
new InkWell(
|
||||
child: new Text(
|
||||
AppLocalizations.of(context).translate('Login'),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold, fontSize: 24)),
|
||||
),
|
||||
],
|
||||
Divider(),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
new InkWell(
|
||||
child: new Text(AppLocalizations.of(context).translate('Login'),
|
||||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 24)),
|
||||
),
|
||||
Divider(),
|
||||
TextFieldBlocBuilder(
|
||||
key: LibraryKeys.loginEmailField,
|
||||
textFieldBloc: formBloc.emailField,
|
||||
decoration: InputDecoration(
|
||||
fillColor: Colors.white,
|
||||
filled: true,
|
||||
labelText: 'Email',
|
||||
),
|
||||
),
|
||||
Divider(
|
||||
color: Colors.transparent,
|
||||
),
|
||||
TextFieldBlocBuilder(
|
||||
key: LibraryKeys.loginPasswordField,
|
||||
textFieldBloc: formBloc.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(
|
||||
key: LibraryKeys.loginOKButton,
|
||||
child: Image.asset('asset/image/WT_OK.png',
|
||||
width: 100, height: 100),
|
||||
onPressed: () => {
|
||||
formBloc.add(SubmitFormBloc())
|
||||
}),
|
||||
]),
|
||||
Divider(
|
||||
color: Colors.transparent,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: <Widget>[
|
||||
new InkWell(
|
||||
child: new Text(
|
||||
AppLocalizations.of(context).translate('SignUp')),
|
||||
onTap: () =>
|
||||
Navigator.of(context).pushNamed('registration'),
|
||||
),
|
||||
Spacer(flex: 2),
|
||||
new InkWell(
|
||||
child: new Text(
|
||||
AppLocalizations.of(context).translate('I forgot the password')),
|
||||
onTap: () => Navigator.of(context).pushNamed('resetPassword'),
|
||||
),
|
||||
Spacer(flex: 2),
|
||||
new InkWell(
|
||||
child: new Text(
|
||||
AppLocalizations.of(context).translate('Privacy')),
|
||||
onTap: () => Navigator.of(context).pushNamed('gdpr'),
|
||||
),
|
||||
]),
|
||||
])),
|
||||
],
|
||||
),
|
||||
Divider(),
|
||||
TextFieldBlocBuilder(
|
||||
key: LibraryKeys.loginEmailField,
|
||||
textFieldBloc: formBloc.emailField,
|
||||
decoration: InputDecoration(
|
||||
fillColor: Colors.white,
|
||||
filled: true,
|
||||
labelText: 'Email',
|
||||
),
|
||||
),
|
||||
Divider(
|
||||
color: Colors.transparent,
|
||||
),
|
||||
TextFieldBlocBuilder(
|
||||
key: LibraryKeys.loginPasswordField,
|
||||
textFieldBloc: formBloc.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(
|
||||
key: LibraryKeys.loginOKButton,
|
||||
child: Image.asset('asset/image/WT_OK.png', width: 100, height: 100),
|
||||
onPressed: () => {formBloc.add(SubmitFormBloc())}),
|
||||
]),
|
||||
Divider(
|
||||
color: Colors.transparent,
|
||||
),
|
||||
Row(mainAxisAlignment: MainAxisAlignment.spaceAround, children: <Widget>[
|
||||
new InkWell(
|
||||
child: new Text(AppLocalizations.of(context).translate('SignUp')),
|
||||
onTap: () => Navigator.of(context).pushNamed('registration'),
|
||||
),
|
||||
Spacer(flex: 2),
|
||||
new InkWell(
|
||||
child: new Text(AppLocalizations.of(context).translate('I forgot the password')),
|
||||
onTap: () => Navigator.of(context).pushNamed('resetPassword'),
|
||||
),
|
||||
Spacer(flex: 2),
|
||||
new InkWell(
|
||||
child: new Text(AppLocalizations.of(context).translate('Privacy')),
|
||||
onTap: () => Navigator.of(context).pushNamed('gdpr'),
|
||||
),
|
||||
]),
|
||||
])),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
void showInSnackBar(String error) {
|
||||
_scaffoldKey.currentState.showSnackBar(SnackBar(
|
||||
backgroundColor: Colors.orange,
|
||||
content: Text(error, style: TextStyle(color: Colors.white))));
|
||||
_scaffoldKey.currentState
|
||||
.showSnackBar(SnackBar(backgroundColor: Colors.orange, content: Text(error, style: TextStyle(color: Colors.white))));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+24
-57
@@ -20,8 +20,7 @@ class RegistrationPage extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return RegistrationWidget(
|
||||
userRepository: userRepository, customerRepository: customerRepository);
|
||||
return RegistrationWidget(userRepository: userRepository, customerRepository: customerRepository);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,20 +36,16 @@ class RegistrationWidget extends StatefulWidget {
|
||||
|
||||
class _RegistrationWidget extends State<RegistrationWidget> with Common {
|
||||
final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();
|
||||
final _formKey = GlobalKey<FormState>();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final cWidth = mediaSizeWidth(context);
|
||||
// ignore: close_sinks
|
||||
final accountBloc = BlocProvider.of<AccountBloc>(context);
|
||||
return BlocProvider(
|
||||
create: (context) => RegistrationFormBloc(
|
||||
userRepository: UserRepository(), accountBloc: accountBloc),
|
||||
create: (context) => RegistrationFormBloc(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,
|
||||
@@ -80,12 +75,9 @@ class _RegistrationWidget extends State<RegistrationWidget> with Common {
|
||||
),
|
||||
),
|
||||
child: Form(
|
||||
key: _formKey,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.only(left: 25, right: 50),
|
||||
child: ListView(
|
||||
shrinkWrap: false,
|
||||
padding: EdgeInsets.only(top: 150.0),
|
||||
child: ListView(shrinkWrap: false, padding: EdgeInsets.only(top: 150.0),
|
||||
//mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: <Widget>[
|
||||
Divider(
|
||||
@@ -109,12 +101,8 @@ class _RegistrationWidget extends State<RegistrationWidget> with Common {
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
new InkWell(
|
||||
child: new Text(
|
||||
AppLocalizations.of(context)
|
||||
.translate('SignUp'),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 24)),
|
||||
child: new Text(AppLocalizations.of(context).translate('SignUp'),
|
||||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 24)),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -144,40 +132,23 @@ class _RegistrationWidget extends State<RegistrationWidget> with Common {
|
||||
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),
|
||||
]),
|
||||
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),
|
||||
])),
|
||||
),
|
||||
@@ -191,11 +162,7 @@ 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,
|
||||
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