Add Patient Manager Page

This commit is contained in:
2024-04-06 15:54:24 +02:00
parent e17b5e24aa
commit 491f854cf7
7 changed files with 60 additions and 31 deletions

View File

@@ -1,5 +1,7 @@
import 'package:flutter/material.dart';
import 'package:patient_manager/components/myAppBar.dart';
import 'package:patient_manager/components/myAppDrawer.dart';
import 'package:patient_manager/main.dart';
class PatientManager extends StatefulWidget {
const PatientManager({super.key});
@@ -9,15 +11,36 @@ class PatientManager extends StatefulWidget {
}
class _PatientManagerState extends State<PatientManager> {
String useremail = "";
Future<void> getUserEmail() async {
final res = await client.auth.getUser();
if (res.user!.email != null) {
//print("emai not null");
useremail = res.user!.email!;
//print(useremail);
}
}
String getEmail() {
return useremail;
}
@override
Widget build(BuildContext context) {
return const Scaffold(
appBar: PreferredSize(
preferredSize: Size.fromHeight(50),
child: MyAppBar(
barTitle: "Mzanzi Innovation Hub",
),
),
return FutureBuilder(
future: getUserEmail(),
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.done) {
return Scaffold(
appBar: const MyAppBar(barTitle: "Patient Manager"),
body: Center(child: Text(useremail)),
drawer: MyAppDrawer(drawerTitle: useremail),
);
} else {
return Center(child: CircularProgressIndicator());
}
},
);
}
}