update app drawe to show the following

name surname
username
type
This commit is contained in:
2024-07-29 11:38:27 +02:00
parent 0fbede68b1
commit 33088ca1fc
3 changed files with 38 additions and 34 deletions

View File

@@ -3,20 +3,20 @@ import 'package:patient_manager/main.dart';
import 'package:patient_manager/objects/appUser.dart';
import 'package:supertokens_flutter/supertokens.dart';
class PatManAppDrawer extends StatefulWidget {
class MIHAppDrawer extends StatefulWidget {
final AppUser signedInUser;
final Image logo;
const PatManAppDrawer({
const MIHAppDrawer({
super.key,
required this.signedInUser,
required this.logo,
});
@override
State<PatManAppDrawer> createState() => _PatManAppDrawerState();
State<MIHAppDrawer> createState() => _MIHAppDrawerState();
}
class _PatManAppDrawerState extends State<PatManAppDrawer> {
class _MIHAppDrawerState extends State<MIHAppDrawer> {
//String endpointUserData = "${AppEnviroment.baseApiUrl}/users/profile/";
//late Future<AppUser> signedInUser;
//late Image logo;
@@ -76,30 +76,34 @@ class _PatManAppDrawerState extends State<PatManAppDrawer> {
height: 60,
child: widget.logo,
),
const SizedBox(height: 50),
Row(
mainAxisSize: MainAxisSize.max,
children: [
Text(
"Username: ",
style: TextStyle(
fontWeight: FontWeight.bold,
color: MzanziInnovationHub.of(context)!
.theme
.primaryColor(),
),
),
const SizedBox(width: 15),
Text(
widget.signedInUser.username,
style: TextStyle(
fontWeight: FontWeight.bold,
color: MzanziInnovationHub.of(context)!
.theme
.primaryColor(),
),
),
],
Text(
"${widget.signedInUser.fname} ${widget.signedInUser.lname}",
style: TextStyle(
fontWeight: FontWeight.bold,
color: MzanziInnovationHub.of(context)!
.theme
.primaryColor(),
),
),
Text(
"@${widget.signedInUser.username}",
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.bold,
color: MzanziInnovationHub.of(context)!
.theme
.primaryColor(),
),
),
Text(
widget.signedInUser.type,
style: TextStyle(
fontSize: 10,
fontWeight: FontWeight.bold,
color: MzanziInnovationHub.of(context)!
.theme
.primaryColor(),
),
),
],
),
@@ -154,7 +158,7 @@ class _PatManAppDrawerState extends State<PatManAppDrawer> {
),
onTap: () {
//signedInUser = snapshot.data!;
//print("PatManAppDrawer: ${signedInUser.runtimeType}");
//print("MIHAppDrawer: ${signedInUser.runtimeType}");
Navigator.of(context)
.pushNamed('/profile', arguments: widget.signedInUser);
},

View File

@@ -1,7 +1,7 @@
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:patient_manager/components/patManAppDrawer.dart';
import 'package:patient_manager/components/mihAppDrawer.dart';
import 'package:patient_manager/env/env.dart';
import 'package:patient_manager/components/homeTileGrid.dart';
import 'package:patient_manager/components/myAppBar.dart';
@@ -87,7 +87,7 @@ class _HomeState extends State<Home> {
if (snapshot.hasData) {
return Scaffold(
appBar: const MyAppBar(barTitle: "Mzansi Innovation Hub"),
drawer: PatManAppDrawer(
drawer: MIHAppDrawer(
signedInUser: snapshot.data!,
logo: logo,
), //HomeAppDrawer(userEmail: useremail),

View File

@@ -1,7 +1,7 @@
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:patient_manager/components/patManAppDrawer.dart';
import 'package:patient_manager/components/mihAppDrawer.dart';
import 'package:patient_manager/components/patientDetails.dart';
import 'package:patient_manager/components/myAppBar.dart';
import 'package:patient_manager/components/patientFiles.dart';
@@ -72,8 +72,8 @@ class _PatientViewState extends State<PatientView> {
if (snapshot.hasData) {
return Scaffold(
appBar: const MyAppBar(barTitle: "Patient View"),
drawer: PatManAppDrawer(
signedInUser: widget.signedInUser, logo: logo),
drawer:
MIHAppDrawer(signedInUser: widget.signedInUser, logo: logo),
body: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.symmetric(