forked from yaso_meth/mih-project
Remove supabase reference from the app
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:patient_manager/components/signInOrRegister.dart';
|
||||
//import 'package:patient_manager/main.dart';
|
||||
import 'package:patient_manager/pages/home.dart';
|
||||
//import 'package:supabase_flutter/supabase_flutter.dart';
|
||||
import 'package:supertokens_flutter/supertokens.dart';
|
||||
|
||||
class AuthCheck extends StatelessWidget {
|
||||
@@ -23,25 +21,5 @@ class AuthCheck extends StatelessWidget {
|
||||
return const SignInOrRegister();
|
||||
}
|
||||
});
|
||||
// return StreamBuilder<AuthState>(
|
||||
// stream: client.auth.onAuthStateChange.distinct(),
|
||||
// builder: (context, snapshot) {
|
||||
// if (snapshot.connectionState == ConnectionState.active) {
|
||||
// final user = snapshot.data?.session;
|
||||
// if (user == null) {
|
||||
// // User not authenticated, show login screen
|
||||
// return const SignInOrRegister();
|
||||
// //Navigator.of(context).pushNamed('/signin');
|
||||
// } else {
|
||||
// // User authenticated, show home screen
|
||||
// return const Home();
|
||||
// //Navigator.of(context).pushNamed('/homme');
|
||||
// }
|
||||
// }
|
||||
|
||||
// // Connection state not active, show loading indicator
|
||||
// return const CircularProgressIndicator();
|
||||
// },
|
||||
// );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'package:patient_manager/components/myErrorMessage.dart';
|
||||
import 'package:patient_manager/env/env.dart';
|
||||
import 'package:patient_manager/main.dart';
|
||||
import 'package:patient_manager/objects/medicine.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:supertokens_flutter/http.dart' as http;
|
||||
|
||||
class MedicineSearch extends StatefulWidget {
|
||||
final TextEditingController searchVlaue;
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'dart:convert';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:patient_manager/env/env.dart';
|
||||
import 'package:patient_manager/main.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:supertokens_flutter/http.dart' as http;
|
||||
import 'package:patient_manager/objects/appUser.dart';
|
||||
import 'package:supertokens_flutter/supertokens.dart';
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import 'package:patient_manager/components/mybutton.dart';
|
||||
import 'package:patient_manager/env/env.dart';
|
||||
import 'package:patient_manager/main.dart';
|
||||
import 'package:patient_manager/objects/notes.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:supertokens_flutter/http.dart' as http;
|
||||
|
||||
class PatientNotes extends StatefulWidget {
|
||||
final int patientIndex;
|
||||
|
||||
@@ -10,7 +10,7 @@ import 'package:patient_manager/env/env.dart';
|
||||
import 'package:patient_manager/main.dart';
|
||||
import 'package:patient_manager/objects/appUser.dart';
|
||||
import '../components/myAppBar.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:supertokens_flutter/http.dart' as http;
|
||||
|
||||
class AddPatient extends StatefulWidget {
|
||||
final String userEmail;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:patient_manager/components/myAppBar.dart';
|
||||
import 'package:patient_manager/components/myDropdownInput.dart';
|
||||
import 'package:patient_manager/components/myErrorMessage.dart';
|
||||
import 'package:patient_manager/components/mySuccessMessage.dart';
|
||||
@@ -9,10 +10,9 @@ import 'package:patient_manager/components/mybutton.dart';
|
||||
import 'package:patient_manager/env/env.dart';
|
||||
import 'package:patient_manager/main.dart';
|
||||
import 'package:patient_manager/objects/appUser.dart';
|
||||
import 'package:supabase_flutter/supabase_flutter.dart';
|
||||
import '../components/myAppBar.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import '../objects/patients.dart';
|
||||
import 'package:patient_manager/objects/patients.dart';
|
||||
import 'package:supertokens_flutter/supertokens.dart';
|
||||
import 'package:supertokens_flutter/http.dart' as http;
|
||||
|
||||
class EditPatient extends StatefulWidget {
|
||||
final Patient selectedPatient;
|
||||
@@ -39,10 +39,11 @@ class _EditPatientState extends State<EditPatient> {
|
||||
final medAidController = TextEditingController();
|
||||
final medMainMemController = TextEditingController();
|
||||
final medAidCodeController = TextEditingController();
|
||||
|
||||
final baseAPI = AppEnviroment.baseApiUrl;
|
||||
final docOfficeIdApiUrl = "${AppEnviroment.baseApiUrl}/users/profile/";
|
||||
final apiUrlEdit = "${AppEnviroment.baseApiUrl}/patients/update/";
|
||||
final apiUrlDelete = "${AppEnviroment.baseApiUrl}/patients/delete/";
|
||||
|
||||
late int futureDocOfficeId;
|
||||
late String userEmail;
|
||||
late bool medRequired;
|
||||
@@ -139,9 +140,12 @@ class _EditPatientState extends State<EditPatient> {
|
||||
}
|
||||
|
||||
Future<void> getLoginUserEmail() async {
|
||||
userEmail =
|
||||
(await Supabase.instance.client.auth.currentUser?.email.toString())!;
|
||||
//print(userEmail);
|
||||
var uid = await SuperTokens.getUserId();
|
||||
var response = await http.get(Uri.parse("$baseAPI/user/$uid"));
|
||||
if (response.statusCode == 200) {
|
||||
var user = jsonDecode(response.body);
|
||||
userEmail = user["email"];
|
||||
}
|
||||
}
|
||||
|
||||
void messagePopUp(error) {
|
||||
|
||||
@@ -5,7 +5,6 @@ import 'package:flutter/material.dart';
|
||||
import 'package:patient_manager/components/buildPatientList.dart';
|
||||
import 'package:patient_manager/components/myAppBar.dart';
|
||||
import 'package:supertokens_flutter/http.dart' as http;
|
||||
//import 'package:http/http.dart' as http;
|
||||
import 'package:patient_manager/components/mySearchInput.dart';
|
||||
import 'package:patient_manager/components/patManAppDrawer.dart';
|
||||
import 'package:patient_manager/env/env.dart';
|
||||
|
||||
Reference in New Issue
Block a user