forked from yaso_meth/mih-project
Change name of appbar file to mihAppbar and widget name to MIHAppBar
This commit is contained in:
@@ -1,103 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:patient_manager/main.dart';
|
||||
import 'package:supertokens_flutter/supertokens.dart';
|
||||
|
||||
class HomeAppDrawer extends StatefulWidget {
|
||||
final String userEmail;
|
||||
|
||||
const HomeAppDrawer({super.key, required this.userEmail});
|
||||
|
||||
@override
|
||||
State<HomeAppDrawer> createState() => _HomeAppDrawerState();
|
||||
}
|
||||
|
||||
class _HomeAppDrawerState extends State<HomeAppDrawer> {
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
super.initState();
|
||||
}
|
||||
|
||||
Future<bool> signOut() async {
|
||||
await SuperTokens.signOut();
|
||||
return true;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
//print(MzanziInnovationHub.of(context)?.theme.mode);
|
||||
return Drawer(
|
||||
//backgroundColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
child: Stack(children: [
|
||||
ListView(
|
||||
padding: EdgeInsets.zero,
|
||||
children: [
|
||||
DrawerHeader(
|
||||
decoration: BoxDecoration(
|
||||
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
),
|
||||
child: Text(
|
||||
widget.userEmail,
|
||||
style: TextStyle(
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor()),
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
title: Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.logout,
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
),
|
||||
SizedBox(width: 25.0),
|
||||
Text(
|
||||
"Sign Out",
|
||||
style: TextStyle(
|
||||
color: MzanziInnovationHub.of(context)!
|
||||
.theme
|
||||
.secondaryColor()),
|
||||
),
|
||||
],
|
||||
),
|
||||
onTap: () async {
|
||||
//client.auth.signOut();
|
||||
if (await signOut()) {
|
||||
Navigator.of(context).pushNamed('/');
|
||||
}
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
Positioned(
|
||||
top: 1,
|
||||
right: 1,
|
||||
width: 50,
|
||||
height: 50,
|
||||
child: IconButton(
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
if (MzanziInnovationHub.of(context)?.theme.mode == "Dark") {
|
||||
//darkm = !darkm;
|
||||
MzanziInnovationHub.of(context)!.changeTheme(ThemeMode.light);
|
||||
//print("Dark Mode: $darkm");
|
||||
} else {
|
||||
//darkm = !darkm;
|
||||
MzanziInnovationHub.of(context)!.changeTheme(ThemeMode.dark);
|
||||
//print("Dark Mode: $darkm");
|
||||
}
|
||||
Navigator.of(context).pushNamed('/home');
|
||||
});
|
||||
},
|
||||
icon: Icon(
|
||||
Icons.light_mode,
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
size: 35,
|
||||
),
|
||||
),
|
||||
),
|
||||
]),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:patient_manager/main.dart';
|
||||
|
||||
class MyAppBar extends StatelessWidget implements PreferredSizeWidget {
|
||||
class MIHAppBar extends StatelessWidget implements PreferredSizeWidget {
|
||||
@override
|
||||
Size get preferredSize => const Size.fromHeight(60);
|
||||
|
||||
final String barTitle;
|
||||
|
||||
const MyAppBar({super.key, required this.barTitle});
|
||||
const MIHAppBar({super.key, required this.barTitle});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -4,7 +4,7 @@ import 'package:flutter/material.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';
|
||||
import 'package:patient_manager/components/mihAppBar.dart';
|
||||
import 'package:patient_manager/main.dart';
|
||||
import 'package:patient_manager/objects/appUser.dart';
|
||||
import 'package:supertokens_flutter/supertokens.dart';
|
||||
@@ -86,7 +86,7 @@ class _HomeState extends State<Home> {
|
||||
if (snapshot.connectionState == ConnectionState.done) {
|
||||
if (snapshot.hasData) {
|
||||
return Scaffold(
|
||||
appBar: const MyAppBar(barTitle: "Mzansi Innovation Hub"),
|
||||
appBar: const MIHAppBar(barTitle: "Mzansi Innovation Hub"),
|
||||
drawer: MIHAppDrawer(
|
||||
signedInUser: snapshot.data!,
|
||||
logo: logo,
|
||||
|
||||
@@ -9,7 +9,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/appUser.dart';
|
||||
import '../components/myAppBar.dart';
|
||||
import '../components/mihAppBar.dart';
|
||||
import 'package:supertokens_flutter/http.dart' as http;
|
||||
|
||||
class AddPatient extends StatefulWidget {
|
||||
@@ -389,7 +389,7 @@ class _AddPatientState extends State<AddPatient> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: const MyAppBar(barTitle: "Add Patient"),
|
||||
appBar: const MIHAppBar(barTitle: "Add Patient"),
|
||||
body: displayForm(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:patient_manager/components/myAppBar.dart';
|
||||
import 'package:patient_manager/components/mihAppBar.dart';
|
||||
import 'package:patient_manager/components/myDropdownInput.dart';
|
||||
import 'package:patient_manager/components/myErrorMessage.dart';
|
||||
import 'package:patient_manager/components/mySuccessMessage.dart';
|
||||
@@ -571,7 +571,7 @@ class _EditPatientState extends State<EditPatient> {
|
||||
});
|
||||
|
||||
return Scaffold(
|
||||
appBar: const MyAppBar(barTitle: "Edit Patient"),
|
||||
appBar: const MIHAppBar(barTitle: "Edit Patient"),
|
||||
body: displayForm(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:patient_manager/components/buildPatientList.dart';
|
||||
import 'package:patient_manager/components/myAppBar.dart';
|
||||
import 'package:patient_manager/components/mihAppBar.dart';
|
||||
import 'package:supertokens_flutter/http.dart' as http;
|
||||
import 'package:patient_manager/components/mySearchInput.dart';
|
||||
import 'package:patient_manager/env/env.dart';
|
||||
@@ -237,7 +237,7 @@ class _PatientManagerState extends State<PatientManager> {
|
||||
final screenWidth = MediaQuery.of(context).size.width;
|
||||
final screenHeight = MediaQuery.of(context).size.height;
|
||||
return Scaffold(
|
||||
appBar: const MyAppBar(barTitle: "Patient Manager"),
|
||||
appBar: const MIHAppBar(barTitle: "Patient Manager"),
|
||||
// drawer: PatManAppDrawer(
|
||||
// userEmail: widget.userEmail,
|
||||
// logo: MzanziInnovationHub.of(context)!.theme.logoImage(),
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'dart:convert';
|
||||
import 'package:flutter/material.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/mihAppBar.dart';
|
||||
import 'package:patient_manager/components/patientFiles.dart';
|
||||
import 'package:patient_manager/components/patientNotes.dart';
|
||||
import 'package:patient_manager/env/env.dart';
|
||||
@@ -71,7 +71,7 @@ class _PatientViewState extends State<PatientView> {
|
||||
else if (snapshot.connectionState == ConnectionState.done) {
|
||||
if (snapshot.hasData) {
|
||||
return Scaffold(
|
||||
appBar: const MyAppBar(barTitle: "Patient View"),
|
||||
appBar: const MIHAppBar(barTitle: "Patient View"),
|
||||
drawer:
|
||||
MIHAppDrawer(signedInUser: widget.signedInUser, logo: logo),
|
||||
body: SingleChildScrollView(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:patient_manager/components/myAppBar.dart';
|
||||
import 'package:patient_manager/components/mihAppBar.dart';
|
||||
import 'package:patient_manager/components/profileOfficeUpdate.dart';
|
||||
import 'package:patient_manager/components/profileUserUpdate.dart';
|
||||
import 'package:patient_manager/objects/appUser.dart';
|
||||
@@ -38,7 +38,7 @@ class _ProfileUpdateState extends State<ProfileUpdate> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: const MyAppBar(barTitle: "Update Profile"),
|
||||
appBar: const MIHAppBar(barTitle: "Update Profile"),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.all(15.0),
|
||||
child: Center(
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:patient_manager/Authentication/authCheck.dart';
|
||||
import 'package:patient_manager/components/addOrViewPatient.dart';
|
||||
import 'package:patient_manager/components/myAppBar.dart';
|
||||
import 'package:patient_manager/components/mihAppBar.dart';
|
||||
import 'package:patient_manager/components/signInOrRegister.dart';
|
||||
import 'package:patient_manager/objects/appUser.dart';
|
||||
import 'package:patient_manager/objects/patients.dart';
|
||||
@@ -96,7 +96,7 @@ class RouteGenerator {
|
||||
Route<dynamic> _errorRoute() {
|
||||
return MaterialPageRoute(builder: (_) {
|
||||
return const Scaffold(
|
||||
appBar: MyAppBar(barTitle: "Error"),
|
||||
appBar: MIHAppBar(barTitle: "Error"),
|
||||
body: Center(
|
||||
child: Text("Error"),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user