Update UI
This commit is contained in:
parent
00527d3490
commit
d8bab76265
6 changed files with 35 additions and 45 deletions
BIN
assets/welcome.png
Normal file
BIN
assets/welcome.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
|
@ -8,7 +8,7 @@ RaisedButton button(String text, {VoidCallback onPressed}) {
|
|||
child: Text(text),
|
||||
onPressed: onPressed,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(6.0),
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
|||
import 'package:flutter/widgets.dart';
|
||||
import 'package:photos/core/configuration.dart';
|
||||
import 'package:photos/services/user_service.dart';
|
||||
import 'package:photos/ui/common_elements.dart';
|
||||
|
||||
class EmailEntryPage extends StatefulWidget {
|
||||
EmailEntryPage({Key key}) : super(key: key);
|
||||
|
@ -25,7 +26,7 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
|
|||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text("Preserve Memories"),
|
||||
title: Text("Sign Up"),
|
||||
),
|
||||
body: _getBody(),
|
||||
);
|
||||
|
@ -37,9 +38,15 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
|
|||
padding: EdgeInsets.all(8),
|
||||
child: Column(
|
||||
children: [
|
||||
Image.asset(
|
||||
"assets/welcome.png",
|
||||
width: 300,
|
||||
height: 200,
|
||||
),
|
||||
Padding(padding: EdgeInsets.all(12)),
|
||||
TextFormField(
|
||||
decoration: InputDecoration(
|
||||
hintText: 'email@domain.com',
|
||||
hintText: 'you@email.com',
|
||||
contentPadding: EdgeInsets.all(20),
|
||||
),
|
||||
controller: _emailController,
|
||||
|
@ -48,21 +55,15 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
|
|||
keyboardType: TextInputType.emailAddress,
|
||||
),
|
||||
Padding(padding: EdgeInsets.all(8)),
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
child: RaisedButton(
|
||||
onPressed: () {
|
||||
final email = _emailController.text;
|
||||
Configuration.instance.setEmail(email);
|
||||
UserService.instance.getOtt(context, email);
|
||||
},
|
||||
padding: const EdgeInsets.fromLTRB(8, 12, 8, 12),
|
||||
child: Text("Sign In"),
|
||||
color: Theme.of(context).buttonColor,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(18.0),
|
||||
),
|
||||
)),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
height: 44,
|
||||
child: button("Sign In", onPressed: () {
|
||||
final email = _emailController.text;
|
||||
Configuration.instance.setEmail(email);
|
||||
UserService.instance.getOtt(context, email);
|
||||
}),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
@ -3,6 +3,7 @@ import 'dart:ui';
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:photos/core/configuration.dart';
|
||||
import 'package:photos/ui/common_elements.dart';
|
||||
import 'package:photos/ui/email_entry_page.dart';
|
||||
import 'package:photos/services/user_service.dart';
|
||||
|
||||
|
@ -77,9 +78,11 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
|
|||
},
|
||||
),
|
||||
Padding(padding: EdgeInsets.all(8)),
|
||||
SizedBox(
|
||||
Container(
|
||||
width: double.infinity,
|
||||
child: RaisedButton(
|
||||
height: 44,
|
||||
child: button(
|
||||
"Verify",
|
||||
onPressed: _verificationCodeController.text == null ||
|
||||
_verificationCodeController.text.isEmpty
|
||||
? null
|
||||
|
@ -87,13 +90,6 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
|
|||
UserService.instance.getCredentials(
|
||||
context, _verificationCodeController.text);
|
||||
},
|
||||
padding: const EdgeInsets.fromLTRB(8, 12, 8, 12),
|
||||
child: Text(
|
||||
"Verify",
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(18.0),
|
||||
),
|
||||
)),
|
||||
Padding(padding: EdgeInsets.all(8)),
|
||||
FlatButton(
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:photos/services/user_service.dart';
|
||||
import 'package:photos/ui/common_elements.dart';
|
||||
import 'package:photos/utils/dialog_util.dart';
|
||||
|
||||
class PassphraseEntryPage extends StatefulWidget {
|
||||
|
@ -89,9 +90,11 @@ class _PassphraseEntryPageState extends State<PassphraseEntryPage> {
|
|||
},
|
||||
),
|
||||
Padding(padding: EdgeInsets.all(8)),
|
||||
SizedBox(
|
||||
Container(
|
||||
width: double.infinity,
|
||||
child: RaisedButton(
|
||||
height: 44,
|
||||
child: button(
|
||||
"Set Passphrase",
|
||||
onPressed: _passphraseController1.text.isNotEmpty &&
|
||||
_passphraseController2.text.isNotEmpty
|
||||
? () {
|
||||
|
@ -104,12 +107,6 @@ class _PassphraseEntryPageState extends State<PassphraseEntryPage> {
|
|||
}
|
||||
}
|
||||
: null,
|
||||
padding: const EdgeInsets.fromLTRB(8, 12, 8, 12),
|
||||
child: Text("Set Passphrase"),
|
||||
color: Theme.of(context).buttonColor,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(18.0),
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
|
@ -142,8 +139,7 @@ class _PassphraseEntryPageState extends State<PassphraseEntryPage> {
|
|||
child: Text("Confirm"),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
UserService.instance
|
||||
.setupKey(context, _passphraseController1.text);
|
||||
UserService.instance.setupKey(context, _passphraseController1.text);
|
||||
},
|
||||
),
|
||||
],
|
||||
|
|
|
@ -3,6 +3,7 @@ import 'package:flutter/widgets.dart';
|
|||
import 'package:photos/core/configuration.dart';
|
||||
import 'package:photos/core/event_bus.dart';
|
||||
import 'package:photos/events/user_authenticated_event.dart';
|
||||
import 'package:photos/ui/common_elements.dart';
|
||||
import 'package:photos/utils/dialog_util.dart';
|
||||
|
||||
class PassphraseReentryPage extends StatefulWidget {
|
||||
|
@ -62,9 +63,11 @@ class _PassphraseReentryPageState extends State<PassphraseReentryPage> {
|
|||
},
|
||||
),
|
||||
Padding(padding: EdgeInsets.all(12)),
|
||||
SizedBox(
|
||||
Container(
|
||||
width: double.infinity,
|
||||
child: RaisedButton(
|
||||
height: 44,
|
||||
child: button(
|
||||
"Verify Passphrase",
|
||||
onPressed: _passphraseController.text.isNotEmpty
|
||||
? () async {
|
||||
final dialog =
|
||||
|
@ -86,12 +89,6 @@ class _PassphraseReentryPageState extends State<PassphraseReentryPage> {
|
|||
.popUntil((route) => route.isFirst);
|
||||
}
|
||||
: null,
|
||||
padding: const EdgeInsets.fromLTRB(8, 12, 8, 12),
|
||||
child: Text("Set Passphrase"),
|
||||
color: Theme.of(context).buttonColor,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(18.0),
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
|
|
Loading…
Add table
Reference in a new issue