Permalink
Browse files

doc: SPA-Template shows entered username + password

  • Loading branch information...
MikeMitterer committed Nov 4, 2015
1 parent 18229ba commit 79afaf6d2042bf910cddc086dee93be46e60b896
@@ -87,8 +87,9 @@ class MaterialNotification extends MaterialDialog {
// - EventHandler -----------------------------------------------------------------------------
@override
Future<MdlDialogStatus> show() {
return super.show(timeout: new Duration(milliseconds: timeout));
// TODO: Params are not used - change parent function...
Future<MdlDialogStatus> show({ final Duration timeout,void dialogIDCallback(final String dialogId) }) {
return super.show(timeout: new Duration(milliseconds: this.timeout));
}
void onClose() {
@@ -29,7 +29,8 @@ class LoginDialog extends MaterialDialog {
String yesButton = _DEFAULT_SUBMIT_BUTTON;
String noButton = _DEFAULT_CANCEL_BUTTON;
final ObservableProperty<String> name = new ObservableProperty<String>('',name: "Name");
final ObservableProperty<String> username = new ObservableProperty<String>('');
final ObservableProperty<String> password = new ObservableProperty<String>('');
LoginDialog() : super(new DialogConfig());
@@ -64,12 +65,13 @@ class LoginDialog extends MaterialDialog {
<h5 class="mdl-form__title">Sign in</h5>
<div class="mdl-form__content">
<div class="mdl-textfield mdl-js-textfield">
<input class="mdl-textfield__input" type="email" id="email" required autofocus>
<input class="mdl-textfield__input" type="email" id="email" mdl-model="username"
required autofocus>
<label class="mdl-textfield__label" for="email">Email</label>
<span class="mdl-textfield__error">This is not a valid eMail-Address</span>
</div>
<div class="mdl-textfield mdl-js-textfield">
<input class="mdl-textfield__input" type=password id="password"
<input class="mdl-textfield__input" type=password id="password" mdl-model="password"
pattern="((?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#\$%?]).{8,15})" required>
<label class="mdl-textfield__label" for="password">Password</label>
<span class="mdl-textfield__error">This is not a valid password (Try: 12345678aA#)</span>
@@ -78,8 +78,14 @@ class Application extends MaterialApplication {
}
Future<MdlDialogStatus> _login() async {
final LoginDialog _loginDialog = new LoginDialog();
return _loginDialog(title: "Login").show();
final LoginDialog dialog = new LoginDialog();
final MdlDialogStatus status = await dialog(title: "Login").show();
if(status == MdlDialogStatus.OK) {
_logger.info("You entered - username: ${dialog.username.value}, password: ${dialog.password.value}");
}
return status;
}
void _checkStatus(final MdlDialogStatus status) {

0 comments on commit 79afaf6

Please sign in to comment.