|
@@ -1,6 +1,3 @@
|
|
|
-import 'dart:developer';
|
|
|
-import 'dart:io';
|
|
|
-
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
import 'package:flutter/gestures.dart';
|
|
|
import 'package:flutter/material.dart';
|
|
@@ -35,7 +32,7 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
|
|
|
Widget build(BuildContext context) {
|
|
|
return Scaffold(
|
|
|
appBar: AppBar(
|
|
|
- title: Text("Sign In"),
|
|
|
+ title: Text("sign in"),
|
|
|
),
|
|
|
body: _getBody(),
|
|
|
);
|
|
@@ -60,50 +57,97 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
|
|
|
padding: EdgeInsets.all(8),
|
|
|
child: Column(
|
|
|
children: [
|
|
|
- Image.asset(
|
|
|
- "assets/welcome.png",
|
|
|
- width: 300,
|
|
|
- height: 200,
|
|
|
+ // Image.asset(
|
|
|
+ // "assets/welcome.png",
|
|
|
+ // width: 300,
|
|
|
+ // height: 200,
|
|
|
+ // ),
|
|
|
+ Padding(
|
|
|
+ padding: EdgeInsets.all(32),
|
|
|
),
|
|
|
- Padding(padding: EdgeInsets.all(12)),
|
|
|
- TextFormField(
|
|
|
- decoration: InputDecoration(
|
|
|
- hintText: 'your name',
|
|
|
- contentPadding: EdgeInsets.all(12),
|
|
|
+ Padding(
|
|
|
+ padding: const EdgeInsets.fromLTRB(32, 0, 32, 0),
|
|
|
+ child: TextFormField(
|
|
|
+ decoration: InputDecoration(
|
|
|
+ hintText: 'your name',
|
|
|
+ hintStyle: TextStyle(
|
|
|
+ color: Colors.white30,
|
|
|
+ ),
|
|
|
+ contentPadding: EdgeInsets.all(12),
|
|
|
+ ),
|
|
|
+ onChanged: (value) {
|
|
|
+ setState(() {
|
|
|
+ _name = value;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ autofocus: true,
|
|
|
+ autocorrect: false,
|
|
|
+ keyboardType: TextInputType.text,
|
|
|
+ textCapitalization: TextCapitalization.words,
|
|
|
+ initialValue: _name,
|
|
|
),
|
|
|
- onChanged: (value) {
|
|
|
- setState(() {
|
|
|
- _name = value;
|
|
|
- });
|
|
|
- },
|
|
|
- autofocus: true,
|
|
|
- autocorrect: false,
|
|
|
- keyboardType: TextInputType.text,
|
|
|
- textCapitalization: TextCapitalization.words,
|
|
|
- initialValue: _name,
|
|
|
),
|
|
|
Padding(padding: EdgeInsets.all(8)),
|
|
|
- TextFormField(
|
|
|
- decoration: InputDecoration(
|
|
|
- hintText: 'you@email.com',
|
|
|
- contentPadding: EdgeInsets.all(12),
|
|
|
+ Padding(
|
|
|
+ padding: const EdgeInsets.fromLTRB(32, 0, 32, 0),
|
|
|
+ child: TextFormField(
|
|
|
+ decoration: InputDecoration(
|
|
|
+ hintText: 'you@email.com',
|
|
|
+ hintStyle: TextStyle(
|
|
|
+ color: Colors.white30,
|
|
|
+ ),
|
|
|
+ contentPadding: EdgeInsets.all(12),
|
|
|
+ ),
|
|
|
+ onChanged: (value) {
|
|
|
+ setState(() {
|
|
|
+ _email = value;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ autocorrect: false,
|
|
|
+ keyboardType: TextInputType.emailAddress,
|
|
|
+ initialValue: _email,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ Padding(padding: EdgeInsets.all(20)),
|
|
|
+ Padding(
|
|
|
+ padding: const EdgeInsets.all(8.0),
|
|
|
+ child: ClipRRect(
|
|
|
+ borderRadius: BorderRadius.circular(20),
|
|
|
+ child: Container(
|
|
|
+ color: Colors.grey[700],
|
|
|
+ padding: EdgeInsets.all(24),
|
|
|
+ child: Row(
|
|
|
+ // crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ Padding(
|
|
|
+ padding: const EdgeInsets.all(8.0),
|
|
|
+ child: Icon(Icons.info),
|
|
|
+ ),
|
|
|
+ Padding(
|
|
|
+ padding: EdgeInsets.fromLTRB(12, 0, 0, 0),
|
|
|
+ ),
|
|
|
+ Expanded(
|
|
|
+ child: Text(
|
|
|
+ "ente will be free to use until we have launched a stable web client. After that it will cost $amount/100GB monthly. We'll make sure it's worth it.",
|
|
|
+ overflow: TextOverflow.visible,
|
|
|
+ style: TextStyle(
|
|
|
+ color: Colors.white70,
|
|
|
+ )),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ),
|
|
|
),
|
|
|
- onChanged: (value) {
|
|
|
- setState(() {
|
|
|
- _email = value;
|
|
|
- });
|
|
|
- },
|
|
|
- autocorrect: false,
|
|
|
- keyboardType: TextInputType.emailAddress,
|
|
|
- initialValue: _email,
|
|
|
),
|
|
|
Padding(padding: EdgeInsets.all(8)),
|
|
|
Padding(
|
|
|
- padding: const EdgeInsets.all(6),
|
|
|
+ padding: const EdgeInsets.all(12),
|
|
|
child: RichText(
|
|
|
text: TextSpan(
|
|
|
children: [
|
|
|
- TextSpan(text: "By clicking Sign In, I agree to the "),
|
|
|
+ TextSpan(
|
|
|
+ text: "By clicking Sign In, I agree to the ",
|
|
|
+ ),
|
|
|
TextSpan(
|
|
|
text: "Terms of Service",
|
|
|
style: TextStyle(
|
|
@@ -129,7 +173,9 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
|
|
|
],
|
|
|
style: TextStyle(
|
|
|
height: 1.25,
|
|
|
- // color: Colors.grey,
|
|
|
+ fontSize: 14,
|
|
|
+ fontFamily: 'Ubuntu',
|
|
|
+ color: Colors.white70,
|
|
|
),
|
|
|
),
|
|
|
textAlign: TextAlign.center,
|
|
@@ -138,43 +184,25 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
|
|
|
Padding(padding: EdgeInsets.all(8)),
|
|
|
Container(
|
|
|
width: double.infinity,
|
|
|
- height: 44,
|
|
|
- child: button("Sign In", onPressed: () {
|
|
|
- if (!isValidEmail(_email)) {
|
|
|
- showErrorDialog(context, "Invalid email address",
|
|
|
- "Please enter a valid email address.");
|
|
|
- return;
|
|
|
- }
|
|
|
- _config.setEmail(_email);
|
|
|
- _config.setName(_name);
|
|
|
- UserService.instance.getOtt(context, _email);
|
|
|
- }),
|
|
|
- ),
|
|
|
- Padding(padding: EdgeInsets.all(12)),
|
|
|
- Container(
|
|
|
- // width: double.infinity,
|
|
|
- color: Colors.grey[900],
|
|
|
- padding: EdgeInsets.all(16),
|
|
|
- child: Row(
|
|
|
- mainAxisAlignment: MainAxisAlignment.start,
|
|
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
- children: [
|
|
|
- Padding(
|
|
|
- padding: const EdgeInsets.all(8.0),
|
|
|
- child: Text("ℹ️"),
|
|
|
- ),
|
|
|
- Padding(
|
|
|
- padding: EdgeInsets.fromLTRB(8, 0, 0, 0),
|
|
|
- ),
|
|
|
- Expanded(
|
|
|
- child: Text(
|
|
|
- "ente will be free to use until we have launched a stable web client. After that it will cost $amount/100GB monthly.",
|
|
|
- overflow: TextOverflow.visible,
|
|
|
- ),
|
|
|
- ),
|
|
|
- ],
|
|
|
+ height: 64,
|
|
|
+ padding: const EdgeInsets.fromLTRB(80, 0, 80, 0),
|
|
|
+ child: button(
|
|
|
+ "sign in",
|
|
|
+ onPressed: _email != null && _name != null
|
|
|
+ ? () {
|
|
|
+ if (!isValidEmail(_email)) {
|
|
|
+ showErrorDialog(context, "Invalid email address",
|
|
|
+ "Please enter a valid email address.");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ _config.setEmail(_email);
|
|
|
+ _config.setName(_name);
|
|
|
+ UserService.instance.getOtt(context, _email);
|
|
|
+ }
|
|
|
+ : null,
|
|
|
+ fontSize: 18,
|
|
|
),
|
|
|
- )
|
|
|
+ ),
|
|
|
],
|
|
|
),
|
|
|
),
|