Make things less dull

This commit is contained in:
Vishnu Mohandas 2020-12-12 06:01:06 +05:30
parent 5ace0864d1
commit d2e53b8094
19 changed files with 280 additions and 182 deletions

BIN
fonts/Ubuntu-Light.ttf Normal file

Binary file not shown.

BIN
fonts/Ubuntu-Regular.ttf Normal file

Binary file not shown.

View file

@ -27,6 +27,7 @@ PODS:
- Flutter
- fluttertoast (0.0.2):
- Flutter
- Toast
- FMDB (2.7.5):
- FMDB/standard (= 2.7.5)
- FMDB/standard (2.7.5)
@ -62,6 +63,7 @@ PODS:
- sqflite (0.0.1):
- Flutter
- FMDB (~> 2.7.2)
- Toast (4.0.0)
- uni_links (0.0.1):
- Flutter
- url_launcher (0.0.1):
@ -105,6 +107,7 @@ SPEC REPOS:
- Reachability
- SDWebImage
- SDWebImageWebPCoder
- Toast
EXTERNAL SOURCES:
connectivity:
@ -169,7 +172,7 @@ SPEC CHECKSUMS:
flutter_sodium: c84426b4de738514b5b66cfdeb8a06634e72fe0b
flutter_webview_plugin: ed9e8a6a96baf0c867e90e1bce2673913eeac694
fluttercontactpicker: 3a69f749dcc3fab94b816ad68fa838a6f0a1cf0f
fluttertoast: b644586ef3b16f67fae9a1f8754cef6b2d6b634b
fluttertoast: 6122fa75143e992b1d3470f61000f591a798cc58
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
libwebp: 946cb3063cea9236285f7e9a8505d806d30e07f3
Mantle: 35238ae6f2e2b2d474fa7b67fee82a59fea71915
@ -183,6 +186,7 @@ SPEC CHECKSUMS:
share_extend: b6748dc53695587891126a89533b862b92548c7b
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
sqflite: 4001a31ff81d210346b500c55b17f4d6c7589dd0
Toast: 91b396c56ee72a5790816f40d3a94dd357abc196
uni_links: d97da20c7701486ba192624d99bffaaffcfc298a
url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef
video_player: 9cc823b1d9da7e8427ee591e8438bfbcde500e6e

View file

@ -234,6 +234,7 @@
"${BUILT_PRODUCTS_DIR}/Reachability/Reachability.framework",
"${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework",
"${BUILT_PRODUCTS_DIR}/SDWebImageWebPCoder/SDWebImageWebPCoder.framework",
"${BUILT_PRODUCTS_DIR}/Toast/Toast.framework",
"${BUILT_PRODUCTS_DIR}/connectivity/connectivity.framework",
"${BUILT_PRODUCTS_DIR}/crisp/crisp.framework",
"${BUILT_PRODUCTS_DIR}/device_info/device_info.framework",
@ -267,6 +268,7 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Reachability.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImageWebPCoder.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Toast.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/connectivity.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/crisp.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/device_info.framework",

View file

@ -107,9 +107,9 @@ class Configuration {
}
String getHttpEndpoint() {
if (kDebugMode) {
return "http://192.168.1.111";
}
// if (kDebugMode) {
// return "http://192.168.1.111";
// }
return "https://api.ente.io";
}

View file

@ -77,7 +77,7 @@ class MyApp extends StatelessWidget with WidgetsBindingObserver {
return MaterialApp(
title: _title,
theme: ThemeData(
fontFamily: 'NunitoSans',
fontFamily: 'Ubuntu',
brightness: Brightness.dark,
hintColor: Colors.grey,
accentColor: Colors.pink[400],

View file

@ -68,7 +68,10 @@ class _CollectionsGalleryWidgetState extends State<CollectionsGalleryWidget>
return SingleChildScrollView(
child: Column(
children: [
SectionTitle("DEVICE FOLDERS"),
SectionTitle("device folders"),
Padding(
padding: EdgeInsets.all(6),
),
Container(
height: 160,
child: Align(
@ -86,8 +89,8 @@ class _CollectionsGalleryWidgetState extends State<CollectionsGalleryWidget>
),
),
Divider(height: 12),
SectionTitle("UPLOADED COLLECTIONS"),
Padding(padding: EdgeInsets.all(6)),
SectionTitle("uploaded collections"),
Padding(padding: EdgeInsets.all(16)),
GridView.builder(
shrinkWrap: true,
padding: EdgeInsets.only(bottom: 12),
@ -141,12 +144,14 @@ class _CollectionsGalleryWidgetState extends State<CollectionsGalleryWidget>
Widget _buildFolder(BuildContext context, DeviceFolder folder) {
return GestureDetector(
child: Padding(
child: Container(
height: 110,
width: 140,
padding: const EdgeInsets.all(8.0),
child: Column(
children: <Widget>[
ClipRRect(
borderRadius: BorderRadius.circular(4.0),
borderRadius: BorderRadius.circular(32.0),
child: Container(
child: Hero(
tag:
@ -161,7 +166,7 @@ class _CollectionsGalleryWidgetState extends State<CollectionsGalleryWidget>
child: Text(
folder.name,
style: TextStyle(
fontSize: 14,
fontSize: 12,
),
overflow: TextOverflow.ellipsis,
),
@ -187,6 +192,9 @@ class _CollectionsGalleryWidgetState extends State<CollectionsGalleryWidget>
return Container(
padding: EdgeInsets.fromLTRB(28, 12, 28, 46),
child: OutlineButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(32.0),
),
child: Icon(
Icons.add,
),
@ -205,7 +213,7 @@ class _CollectionsGalleryWidgetState extends State<CollectionsGalleryWidget>
child: Column(
children: <Widget>[
ClipRRect(
borderRadius: BorderRadius.circular(4.0),
borderRadius: BorderRadius.circular(12.0),
child: Container(
child: Hero(
tag: "collection" + c.thumbnail.tag(),
@ -260,7 +268,7 @@ class SectionTitle extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.fromLTRB(12, 12, 0, 0),
margin: EdgeInsets.fromLTRB(24, 12, 0, 0),
child: Column(children: [
Align(
alignment: Alignment.centerLeft,
@ -269,6 +277,9 @@ class SectionTitle extends StatelessWidget {
style: TextStyle(
fontWeight: FontWeight.bold,
color: Theme.of(context).primaryColorLight,
fontSize: 20,
fontFamily: 'Montserrat',
letterSpacing: 1,
),
),
),

View file

@ -15,6 +15,7 @@ RaisedButton button(
fontWeight: FontWeight.bold,
fontSize: fontSize,
),
textAlign: TextAlign.center,
),
onPressed: onPressed,
shape: RoundedRectangleBorder(

View file

@ -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),
),
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.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,
)),
),
],
),
),
),
),
Padding(padding: EdgeInsets.all(8)),
Padding(
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,
),
)
),
],
),
),

View file

@ -257,7 +257,7 @@ class _GalleryState extends State<Gallery> {
}
return Container(
padding: const EdgeInsets.all(8.0),
padding: const EdgeInsets.fromLTRB(14, 8, 0, 8),
alignment: Alignment.centerLeft,
child: Text(
title,

View file

@ -74,12 +74,17 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
Widget build(BuildContext context) {
if (widget.selectedFiles.files.isEmpty) {
return AppBar(
backgroundColor: Color(0x00000000),
elevation: 0,
title: Text(
widget.title,
style: TextStyle(
fontFamily: widget.type == GalleryAppBarType.homepage
? 'Montserrat'
: 'NunitoSans',
color: widget.type == GalleryAppBarType.homepage
? Colors.white.withOpacity(0.00)
: Colors.white.withOpacity(0.60),
),
),
actions: _getDefaultActions(context),

View file

@ -78,10 +78,13 @@ class _HomeWidgetState extends State<HomeWidget> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: GalleryAppBarWidget(
GalleryAppBarType.homepage,
widget.title,
_selectedFiles,
appBar: PreferredSize(
preferredSize: Size.fromHeight(20.0),
child: GalleryAppBarWidget(
GalleryAppBarType.homepage,
widget.title,
_selectedFiles,
),
),
bottomNavigationBar: _buildBottomNavigationBar(),
body: ExtentsPageView(
@ -177,15 +180,15 @@ class _HomeWidgetState extends State<HomeWidget> {
items: [
TabItem(
icon: Icons.photo_library,
title: "Photos",
title: "photos",
),
TabItem(
icon: Icons.folder_special,
title: "Collections",
title: "collections",
),
TabItem(
icon: Icons.folder_shared,
title: "Shared",
title: "shared",
),
],
onTap: (index) {

View file

@ -42,7 +42,10 @@ class _MemoriesWidgetState extends State<MemoriesWidget>
snapshot.data.length == 0) {
return Container();
} else {
return _buildMemories(snapshot.data);
return Padding(
padding: const EdgeInsets.all(8.0),
child: _buildMemories(snapshot.data),
);
}
},
);
@ -115,7 +118,7 @@ class MemoryWidget extends StatelessWidget {
child: Column(
children: [
_buildMemoryItem(context, index),
Padding(padding: EdgeInsets.all(2)),
Padding(padding: EdgeInsets.all(4)),
Hero(
tag: title,
child: Material(
@ -124,6 +127,7 @@ class MemoryWidget extends StatelessWidget {
title,
style: TextStyle(
fontSize: 12,
color: Colors.white60,
),
),
),

View file

@ -21,7 +21,7 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Verify Email"),
title: Text("verify email"),
),
body: _getBody(),
);
@ -42,54 +42,73 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
height: 220,
),
Padding(padding: EdgeInsets.all(12)),
Text.rich(
TextSpan(
style: TextStyle(fontSize: 18),
children: <TextSpan>[
TextSpan(text: "We've sent a mail to "),
TextSpan(
text: Configuration.instance.getEmail(),
style: TextStyle(
color: Theme.of(context).accentColor,
)),
],
),
textAlign: TextAlign.center,
),
Padding(padding: EdgeInsets.all(12)),
Text(
"Please check your inbox (and spam) to complete verification.",
textAlign: TextAlign.center,
"we've sent a mail to",
style: TextStyle(fontSize: 18),
),
Padding(padding: EdgeInsets.all(12)),
TextFormField(
decoration: InputDecoration(
hintText: 'Tap to enter verification code',
contentPadding: EdgeInsets.all(20),
Padding(padding: EdgeInsets.all(2)),
Text(
Configuration.instance.getEmail(),
style: TextStyle(
color: Theme.of(context).accentColor,
fontSize: 18,
),
),
// Text.rich(
// TextSpan(
// style: TextStyle(fontSize: 18),
// children: <TextSpan>[
// TextSpan(text: "we've sent a mail to "),
// TextSpan(
// text: Configuration.instance.getEmail(),
// style: TextStyle(
// color: Theme.of(context).accentColor,
// )),
// ],
// ),
// textAlign: TextAlign.center,
// ),
Padding(
padding: const EdgeInsets.all(32),
child: Text(
"please check your inbox (and spam) to complete verification.",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 12),
),
),
Padding(
padding: const EdgeInsets.fromLTRB(60, 0, 60, 32),
child: TextFormField(
decoration: InputDecoration(
hintText: 'tap to enter code',
contentPadding: EdgeInsets.all(12),
),
controller: _verificationCodeController,
autofocus: false,
autocorrect: false,
keyboardType: TextInputType.visiblePassword,
textAlign: TextAlign.center,
onChanged: (_) {
setState(() {});
},
),
controller: _verificationCodeController,
autofocus: false,
autocorrect: false,
keyboardType: TextInputType.visiblePassword,
textAlign: TextAlign.center,
onChanged: (_) {
setState(() {});
},
),
Padding(padding: EdgeInsets.all(8)),
Container(
width: double.infinity,
height: 44,
child: button(
"Verify",
onPressed: _verificationCodeController.text == null ||
_verificationCodeController.text.isEmpty
? null
: () {
UserService.instance.getCredentials(
context, _verificationCodeController.text);
},
)),
padding: const EdgeInsets.fromLTRB(60, 0, 60, 0),
width: double.infinity,
height: 64,
child: button(
"verify",
onPressed: _verificationCodeController.text == null ||
_verificationCodeController.text.isEmpty
? null
: () {
UserService.instance.getCredentials(
context, _verificationCodeController.text);
},
fontSize: 18,
),
),
Padding(padding: EdgeInsets.all(8)),
FlatButton(
onPressed: () {
@ -102,7 +121,7 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
);
},
child: Text(
"Did not get email?",
"did not get email?",
style: TextStyle(
decoration: TextDecoration.underline,
fontSize: 12,

View file

@ -54,6 +54,9 @@ class _PassphraseReentryPageState extends State<PassphraseReentryPage> {
hintText: "that thing you promised to never forget",
contentPadding: EdgeInsets.all(20),
),
style: TextStyle(
fontSize: 14,
),
controller: _passphraseController,
autofocus: false,
autocorrect: false,
@ -64,8 +67,9 @@ class _PassphraseReentryPageState extends State<PassphraseReentryPage> {
),
Padding(padding: EdgeInsets.all(12)),
Container(
padding: const EdgeInsets.fromLTRB(80, 0, 80, 0),
width: double.infinity,
height: 44,
height: 64,
child: button(
"Verify Passphrase",
onPressed: _passphraseController.text.isNotEmpty

View file

@ -91,8 +91,8 @@ class _SharedCollectionGalleryState extends State<SharedCollectionGallery>
return SingleChildScrollView(
child: Column(
children: [
SectionTitle("INCOMING"),
Padding(padding: EdgeInsets.all(8)),
SectionTitle("incoming"),
Padding(padding: EdgeInsets.all(16)),
collections.incoming.length > 0
? GridView.builder(
shrinkWrap: true,
@ -107,10 +107,11 @@ class _SharedCollectionGalleryState extends State<SharedCollectionGallery>
),
)
: nothingToSeeHere,
Padding(padding: EdgeInsets.all(4)),
Divider(height: 4),
SectionTitle("OUTGOING"),
Padding(padding: EdgeInsets.all(8)),
Padding(padding: EdgeInsets.all(16)),
Divider(height: 0),
Padding(padding: EdgeInsets.all(14)),
SectionTitle("outgoing"),
Padding(padding: EdgeInsets.all(16)),
collections.outgoing.length > 0
? ListView.builder(
shrinkWrap: true,

View file

@ -45,43 +45,48 @@ class _SignInHeaderState extends State<SignInHeader> {
child: Column(
children: [
Text(
"Preserve Your Memories",
"preserve your memories",
style: TextStyle(
fontSize: 16,
),
),
Container(
width: double.infinity,
height: 64,
padding: EdgeInsets.all(8),
child: button(
"Sign In",
fontSize: 18,
onPressed: () {
var page;
if (Configuration.instance.getToken() == null) {
page = EmailEntryPage();
} else {
// No key
if (Configuration.instance.getKeyAttributes() != null) {
// Yet to set or decrypt the key
page = PassphraseReentryPage();
Padding(
padding: EdgeInsets.all(10),
),
Padding(
padding: const EdgeInsets.fromLTRB(60, 0, 60, 0),
child: Container(
width: double.infinity,
height: 64,
child: button(
"sign in",
fontSize: 18,
onPressed: () {
var page;
if (Configuration.instance.getToken() == null) {
page = EmailEntryPage();
} else {
// Never had a key
page = PassphraseEntryPage();
// No key
if (Configuration.instance.getKeyAttributes() != null) {
// Yet to set or decrypt the key
page = PassphraseReentryPage();
} else {
// Never had a key
page = PassphraseEntryPage();
}
}
}
Navigator.of(context).push(
MaterialPageRoute(
builder: (BuildContext context) {
return page;
},
),
);
},
Navigator.of(context).push(
MaterialPageRoute(
builder: (BuildContext context) {
return page;
},
),
);
},
),
),
),
Padding(padding: EdgeInsets.all(4)),
Padding(padding: EdgeInsets.all(10)),
Divider(
height: 2,
),

View file

@ -59,7 +59,14 @@ class _ThumbnailWidgetState extends State<ThumbnailWidget> {
content = Stack(
children: [
image,
Icon(Icons.play_circle_outline),
Container(
height: 64,
child: Icon(
Icons.play_circle_outline,
size: 40,
color: Colors.white70,
),
),
],
fit: StackFit.expand,
);

View file

@ -92,6 +92,10 @@ flutter:
fonts:
- asset: fonts/NunitoSans-Regular.ttf
- asset: fonts/NunitoSans-Bold.ttf
- family: Ubuntu
fonts:
- asset: fonts/Ubuntu-Regular.ttf
- asset: fonts/Ubuntu-Light.ttf
- family: Montserrat
fonts:
- asset: fonts/Montserrat-Medium.ttf