Just email reset

This commit is contained in:
Mrdabup 2024-07-14 21:56:16 -04:00
parent 3051127a0f
commit bb7c15d406
9 changed files with 78 additions and 31 deletions

View file

@ -49,7 +49,7 @@ android {
}
defaultConfig {
applicationId "me.voidspace.recon"
applicationId "debug.tojcklguy.opencontacts"
minSdkVersion 24
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()

View file

@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.voidspace.recon">
package="debug.tojcklguy.opencontacts">
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.

View file

@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.voidspace.recon">
package="debug.tojcklguy.opencontacts">
<!-- Required to fetch data from the internet. -->
<uses-permission android:name="android.permission.INTERNET" />

View file

@ -1,4 +1,4 @@
package de.voidspace.recon
package debug.tojcklguy.opencontacts
import io.flutter.embedding.android.FlutterActivity

View file

@ -1,4 +1,4 @@
package me.voidspace.recon
package debug.tojcklguy.opencontacts
import io.flutter.embedding.android.FlutterActivity

View file

@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.voidspace.recon">
package="debug.tojcklguy.opencontacts">
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.

View file

@ -27,6 +27,7 @@ class _LoginScreenState extends State<LoginScreen> {
late final FocusNode _totpFocusNode;
bool _isLoading = false;
bool _isUsernameEmail = false;
String _error = "";
bool _needsTotp = false;
@ -46,9 +47,21 @@ class _LoginScreenState extends State<LoginScreen> {
_totpFocusNode.dispose();
super.dispose();
}
RegExp emailReg = new RegExp(
r"^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$",
caseSensitive: false,
multiLine: false,
);
Future<void> submit() async {
if (_usernameController.text.isEmpty || _passwordController.text.isEmpty) {
if (_usernameController.text.contains(emailReg) || _passwordController.text.isEmpty) {
setState(() {
_error = "Email found! YAAAAY!";
_isUsernameEmail = true;
});
}
if (_usernameController.text.isEmpty ||_usernameController.text.contains(emailReg) || _passwordController.text.isEmpty) { //some little thing is giving me the hiccups
setState(() {
_error = "Please enter a valid username/password combination.";
});
@ -160,7 +173,7 @@ class _LoginScreenState extends State<LoginScreen> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text("ReCon"),
title: const Text("OpenContacts"),
),
body: Builder(builder: (context) {
return ListView(
@ -227,6 +240,16 @@ class _LoginScreenState extends State<LoginScreen> {
label: const Text("Login"),
),
),
Padding(
padding: const EdgeInsets.only(top: 16),
child: _isLoading
? const Center(child: CircularProgressIndicator())
: TextButton.icon(
onPressed: submit,
icon: const Icon(Icons.question_mark),
label: const Text("Forgot Password?"),
),
),
Center(
child: AnimatedOpacity(
opacity: _errorOpacity,

View file

@ -7,7 +7,7 @@ project(runner LANGUAGES CXX)
set(BINARY_NAME "recon")
# The unique GTK application identifier for this application. See:
# https://wiki.gnome.org/HowDoI/ChooseApplicationID
set(APPLICATION_ID "de.voidspace.recon")
set(APPLICATION_ID "debug.tojcklguy.opencontacts")
# Explicitly opt in to modern CMake behaviors to avoid warnings with recent
# versions of CMake.

View file

@ -125,10 +125,10 @@ packages:
dependency: "direct main"
description:
name: collection
sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
url: "https://pub.dev"
source: hosted
version: "1.17.2"
version: "1.18.0"
color:
dependency: "direct main"
description:
@ -528,6 +528,30 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.4.8"
leak_tracker:
dependency: transitive
description:
name: leak_tracker
sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a"
url: "https://pub.dev"
source: hosted
version: "10.0.4"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8"
url: "https://pub.dev"
source: hosted
version: "3.0.3"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
url: "https://pub.dev"
source: hosted
version: "3.0.1"
lints:
dependency: transitive
description:
@ -548,26 +572,26 @@ packages:
dependency: transitive
description:
name: matcher
sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e"
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
url: "https://pub.dev"
source: hosted
version: "0.12.16"
version: "0.12.16+1"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
url: "https://pub.dev"
source: hosted
version: "0.5.0"
version: "0.8.0"
meta:
dependency: transitive
description:
name: meta
sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
url: "https://pub.dev"
source: hosted
version: "1.9.1"
version: "1.12.0"
mime:
dependency: transitive
description:
@ -612,10 +636,10 @@ packages:
dependency: "direct main"
description:
name: path
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
url: "https://pub.dev"
source: hosted
version: "1.8.3"
version: "1.9.0"
path_provider:
dependency: "direct main"
description:
@ -873,18 +897,18 @@ packages:
dependency: transitive
description:
name: stack_trace
sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
url: "https://pub.dev"
source: hosted
version: "1.11.0"
version: "1.11.1"
stream_channel:
dependency: transitive
description:
name: stream_channel
sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
url: "https://pub.dev"
source: hosted
version: "2.1.1"
version: "2.1.2"
stream_transform:
dependency: transitive
description:
@ -921,10 +945,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8"
sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f"
url: "https://pub.dev"
source: hosted
version: "0.6.0"
version: "0.7.0"
timezone:
dependency: transitive
description:
@ -1021,14 +1045,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.4"
web:
vm_service:
dependency: transitive
description:
name: web
sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10
name: vm_service
sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec"
url: "https://pub.dev"
source: hosted
version: "0.1.4-beta"
version: "14.2.1"
web_socket_channel:
dependency: "direct main"
description:
@ -1070,5 +1094,5 @@ packages:
source: hosted
version: "6.3.0"
sdks:
dart: ">=3.1.0 <4.0.0"
flutter: ">=3.13.0"
dart: ">=3.3.0 <4.0.0"
flutter: ">=3.18.0-18.0.pre.54"