diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index ce93409e..e9ef25e3 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -90,7 +90,7 @@ limitations under the License.
-
+
diff --git a/lib/account/init.dart b/lib/account/init.dart
new file mode 100644
index 00000000..3f944570
--- /dev/null
+++ b/lib/account/init.dart
@@ -0,0 +1,10 @@
+import 'package:supabase_flutter/supabase_flutter.dart';
+
+Future initSupabase() async {
+ await Supabase.initialize(
+ url: 'https://tefpmcttotopcptdivsj.supabase.co',
+ anonKey:
+ 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlhdCI6MTYyODA2NDAyNiwiZXhwIjoxOTQzNjQwMDI2fQ.xAN-giE3m1MPjoRkkdcg_0NJueLH0_L-Wu-V0TSnpwU',
+ authCallbackUrlHostname: 'register-callback',
+ );
+}
diff --git a/lib/account/login_screen.dart b/lib/account/login_screen.dart
index 1df1cb71..28f58094 100644
--- a/lib/account/login_screen.dart
+++ b/lib/account/login_screen.dart
@@ -35,11 +35,6 @@ import 'package:flutter/material.dart';
import 'package:gitjournal/widgets/scroll_view_without_animation.dart';
-//import 'package:gotrue/gotrue.dart';
-
-// const _localDevServer = 'http://192.168.1.130:9999/';
-// const _prodServer = 'https://api.gitjournal.io/auth/';
-
class LoginPage extends StatefulWidget {
LoginPage({Key? key, this.title}) : super(key: key);
@@ -148,23 +143,6 @@ class _LoginPageState extends State {
fontWeight: FontWeight.w400)),
),
),
- Expanded(
- flex: 5,
- child: Container(
- decoration: const BoxDecoration(
- color: Color(0xff2872ba),
- borderRadius: BorderRadius.only(
- bottomRight: Radius.circular(5),
- topRight: Radius.circular(5)),
- ),
- alignment: Alignment.center,
- child: const Text('Log in with Facebook',
- style: TextStyle(
- color: Colors.white,
- fontSize: 18,
- fontWeight: FontWeight.w400)),
- ),
- ),
],
),
);
diff --git a/lib/account/signup_screen.dart b/lib/account/signup_screen.dart
index 49265600..6d293814 100644
--- a/lib/account/signup_screen.dart
+++ b/lib/account/signup_screen.dart
@@ -1,6 +1,10 @@
import 'package:flutter/material.dart';
+import 'package:gotrue/gotrue.dart';
+import 'package:supabase_flutter/supabase_flutter.dart';
+
import 'package:gitjournal/account/login_screen.dart';
+import 'package:gitjournal/settings/settings_git_remote.dart';
class SignUpScreen extends StatefulWidget {
SignUpScreen({Key? key}) : super(key: key);
@@ -11,27 +15,25 @@ class SignUpScreen extends StatefulWidget {
class _SignUpScreenState extends State {
Widget _submitButton() {
- return Container(
- width: MediaQuery.of(context).size.width,
- padding: const EdgeInsets.symmetric(vertical: 15),
- alignment: Alignment.center,
- decoration: BoxDecoration(
- borderRadius: const BorderRadius.all(Radius.circular(5)),
- boxShadow: [
- BoxShadow(
- color: Colors.grey.shade200,
- offset: const Offset(2, 4),
- blurRadius: 5,
- spreadRadius: 2)
- ],
- gradient: const LinearGradient(
- begin: Alignment.centerLeft,
- end: Alignment.centerRight,
- colors: [Color(0xfffbb448), Color(0xfff7892b)])),
- child: const Text(
- 'Register Now',
- style: TextStyle(fontSize: 20, color: Colors.white),
- ),
+ return Button(
+ text: "Register Now",
+ onPressed: () async {
+ var auth = Supabase.instance.client.auth;
+ var result = await auth.signUp(
+ 'test@gitjournal.io',
+ 'hellohello',
+ options: AuthOptions(
+ redirectTo: 'gitjournal-identity://register-callback',
+ ),
+ );
+
+ if (result.data == null && result.error == null) {
+ // Email Validation
+ }
+ if (result.error != null) {
+ // Show the error
+ }
+ },
);
}
diff --git a/lib/main.dart b/lib/main.dart
index e0d3b4a8..72d7078c 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -7,8 +7,8 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:easy_logger/easy_logger.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:stack_trace/stack_trace.dart';
-import 'package:supabase_flutter/supabase_flutter.dart';
+import 'package:gitjournal/account/init.dart';
import 'package:gitjournal/app.dart';
import 'package:gitjournal/error_reporting.dart';
import 'package:gitjournal/settings/app_settings.dart';
@@ -21,13 +21,7 @@ void main() async {
LevelMessages.warning,
];
- // FIXME: Does this need to be done over here?
- await Supabase.initialize(
- url: 'https://tefpmcttotopcptdivsj.supabase.co',
- anonKey:
- 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlhdCI6MTYyODA2NDAyNiwiZXhwIjoxOTQzNjQwMDI2fQ.xAN-giE3m1MPjoRkkdcg_0NJueLH0_L-Wu-V0TSnpwU',
- authCallbackUrlHostname: 'login-callback',
- );
+ initSupabase();
var pref = await SharedPreferences.getInstance();
AppSettings.instance.load(pref);