Reconfig app
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:patient_manager/components/MIH_Layout/MIH_Action.dart';
|
import 'package:patient_manager/MIH_Components/MIH_Layout/MIH_Action.dart';
|
||||||
import 'package:patient_manager/components/MIH_Layout/MIH_Body.dart';
|
import 'package:patient_manager/MIH_Components/MIH_Layout/MIH_Body.dart';
|
||||||
import 'package:patient_manager/components/MIH_Layout/MIH_Header.dart';
|
import 'package:patient_manager/MIH_Components/MIH_Layout/MIH_Header.dart';
|
||||||
|
|
||||||
class MIHLayoutBuilder extends StatefulWidget {
|
class MIHLayoutBuilder extends StatefulWidget {
|
||||||
final MIHAction actionButton;
|
final MIHAction actionButton;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihDateInput.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihDateInput.dart';
|
||||||
|
|
||||||
class Medcertinput extends StatefulWidget {
|
class Medcertinput extends StatefulWidget {
|
||||||
final startDateController;
|
final startDateController;
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:patient_manager/components/builders/buildMedList.dart';
|
import 'package:patient_manager/MIH_Packages/patient_profile/builder/buildMedList.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihLoadingCircle.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihLoadingCircle.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihErrorMessage.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihErrorMessage.dart';
|
||||||
import 'package:patient_manager/env/env.dart';
|
import 'package:patient_manager/env/env.dart';
|
||||||
import 'package:patient_manager/main.dart';
|
import 'package:patient_manager/main.dart';
|
||||||
import 'package:patient_manager/objects/medicine.dart';
|
import 'package:patient_manager/objects/medicine.dart';
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihButton.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihButton.dart';
|
||||||
import 'package:patient_manager/main.dart';
|
import 'package:patient_manager/main.dart';
|
||||||
|
|
||||||
class MIHDeleteMessage extends StatefulWidget {
|
class MIHDeleteMessage extends StatefulWidget {
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihButton.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihButton.dart';
|
||||||
import 'package:patient_manager/main.dart';
|
import 'package:patient_manager/main.dart';
|
||||||
|
|
||||||
class MIHSuccessMessage extends StatefulWidget {
|
class MIHSuccessMessage extends StatefulWidget {
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihLoadingCircle.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihLoadingCircle.dart';
|
||||||
import 'package:patient_manager/env/env.dart';
|
import 'package:patient_manager/env/env.dart';
|
||||||
import 'package:patient_manager/MIH_Packages/MIH_Home/homeTileGrid.dart';
|
import 'package:patient_manager/MIH_Packages/MIH_Home/homeTileGrid.dart';
|
||||||
import 'package:patient_manager/objects/appUser.dart';
|
import 'package:patient_manager/objects/appUser.dart';
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:google_nav_bar/google_nav_bar.dart';
|
import 'package:google_nav_bar/google_nav_bar.dart';
|
||||||
import 'package:patient_manager/components/MIH_Layout/MIH_Tile.dart';
|
import 'package:patient_manager/MIH_Components/MIH_Layout/MIH_Tile.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihSearchInput.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihSearchInput.dart';
|
||||||
import 'package:patient_manager/components/mihAppDrawer.dart';
|
import 'package:patient_manager/MIH_Components/MIH_Layout/MIH_AppDrawer.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihDeleteMessage.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihDeleteMessage.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihLoadingCircle.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihLoadingCircle.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihWarningMessage.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihWarningMessage.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihErrorMessage.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihErrorMessage.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihSuccessMessage.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihSuccessMessage.dart';
|
||||||
import 'package:patient_manager/env/env.dart';
|
import 'package:patient_manager/env/env.dart';
|
||||||
import 'package:patient_manager/main.dart';
|
import 'package:patient_manager/main.dart';
|
||||||
import 'package:patient_manager/objects/appUser.dart';
|
import 'package:patient_manager/objects/appUser.dart';
|
||||||
@@ -149,10 +149,31 @@ class _HomeTileGridState extends State<HomeTileGrid> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void setAppsBusiness(List<MIHTile> tileList) {
|
void setAppsBusiness(List<MIHTile> tileList) {
|
||||||
|
// tileList.add(MIHTile(
|
||||||
|
// onTap: () {
|
||||||
|
// Navigator.of(context).pushNamed(
|
||||||
|
// '/business-profile',
|
||||||
|
// arguments: BusinessArguments(
|
||||||
|
// widget.signedInUser,
|
||||||
|
// widget.businessUser,
|
||||||
|
// widget.business,
|
||||||
|
// ),
|
||||||
|
// );
|
||||||
|
// },
|
||||||
|
// tileName: "Manage Business",
|
||||||
|
// tileIcon: Icon(
|
||||||
|
// Icons.business,
|
||||||
|
// color: getSec(),
|
||||||
|
// size: 200,
|
||||||
|
// ),
|
||||||
|
// p: getPrim(),
|
||||||
|
// s: getSec(),
|
||||||
|
// ));
|
||||||
|
//if (widget.businessUser!.access == "Full") {
|
||||||
tileList.add(MIHTile(
|
tileList.add(MIHTile(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.of(context).pushNamed(
|
Navigator.of(context).pushNamed(
|
||||||
'/business-profile',
|
'/business-profile/manage',
|
||||||
arguments: BusinessArguments(
|
arguments: BusinessArguments(
|
||||||
widget.signedInUser,
|
widget.signedInUser,
|
||||||
widget.businessUser,
|
widget.businessUser,
|
||||||
@@ -160,7 +181,7 @@ class _HomeTileGridState extends State<HomeTileGrid> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
tileName: "Manage Business",
|
tileName: "Business Profile",
|
||||||
tileIcon: Icon(
|
tileIcon: Icon(
|
||||||
Icons.business,
|
Icons.business,
|
||||||
color: getSec(),
|
color: getSec(),
|
||||||
@@ -169,28 +190,7 @@ class _HomeTileGridState extends State<HomeTileGrid> {
|
|||||||
p: getPrim(),
|
p: getPrim(),
|
||||||
s: getSec(),
|
s: getSec(),
|
||||||
));
|
));
|
||||||
if (widget.businessUser!.access == "Full") {
|
//}
|
||||||
tileList.add(MIHTile(
|
|
||||||
onTap: () {
|
|
||||||
Navigator.of(context).pushNamed(
|
|
||||||
'/business-profile/manage',
|
|
||||||
arguments: BusinessArguments(
|
|
||||||
widget.signedInUser,
|
|
||||||
widget.businessUser,
|
|
||||||
widget.business,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
tileName: "Manage Team",
|
|
||||||
tileIcon: Icon(
|
|
||||||
Icons.people_outline,
|
|
||||||
color: getSec(),
|
|
||||||
size: 200,
|
|
||||||
),
|
|
||||||
p: getPrim(),
|
|
||||||
s: getSec(),
|
|
||||||
));
|
|
||||||
}
|
|
||||||
if (widget.business!.type == "Doctors Office") {
|
if (widget.business!.type == "Doctors Office") {
|
||||||
tileList.add(MIHTile(
|
tileList.add(MIHTile(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:patient_manager/components/MIH_Layout/MIH_Action.dart';
|
import 'package:patient_manager/MIH_Components/MIH_Layout/MIH_Action.dart';
|
||||||
import 'package:patient_manager/components/MIH_Layout/MIH_Body.dart';
|
import 'package:patient_manager/MIH_Components/MIH_Layout/MIH_Body.dart';
|
||||||
import 'package:patient_manager/components/MIH_Layout/MIH_Header.dart';
|
import 'package:patient_manager/MIH_Components/MIH_Layout/MIH_Header.dart';
|
||||||
import 'package:patient_manager/components/MIH_Layout/MIH_LayoutBuilder.dart';
|
import 'package:patient_manager/MIH_Components/MIH_Layout/MIH_LayoutBuilder.dart';
|
||||||
import 'package:patient_manager/components/MIH_Layout/MIH_Tile.dart';
|
import 'package:patient_manager/MIH_Components/MIH_Layout/MIH_Tile.dart';
|
||||||
import 'package:patient_manager/main.dart';
|
import 'package:patient_manager/main.dart';
|
||||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihButton.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihButton.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihErrorMessage.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihErrorMessage.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihSuccessMessage.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihSuccessMessage.dart';
|
||||||
import 'package:patient_manager/env/env.dart';
|
import 'package:patient_manager/env/env.dart';
|
||||||
import 'package:patient_manager/main.dart';
|
import 'package:patient_manager/main.dart';
|
||||||
import 'package:patient_manager/objects/accessRequest.dart';
|
import 'package:patient_manager/objects/accessRequest.dart';
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:patient_manager/components/MIH_Layout/MIH_Action.dart';
|
import 'package:patient_manager/MIH_Components/MIH_Layout/MIH_Action.dart';
|
||||||
import 'package:patient_manager/components/MIH_Layout/MIH_Body.dart';
|
import 'package:patient_manager/MIH_Components/MIH_Layout/MIH_Body.dart';
|
||||||
import 'package:patient_manager/components/MIH_Layout/MIH_Header.dart';
|
import 'package:patient_manager/MIH_Components/MIH_Layout/MIH_Header.dart';
|
||||||
import 'package:patient_manager/components/MIH_Layout/MIH_LayoutBuilder.dart';
|
import 'package:patient_manager/MIH_Components/MIH_Layout/MIH_LayoutBuilder.dart';
|
||||||
import 'package:patient_manager/MIH_Packages/access_review/builder/buildAccessRequestList.dart';
|
import 'package:patient_manager/MIH_Packages/access_review/builder/buildAccessRequestList.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihDropdownInput.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihDropdownInput.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihLoadingCircle.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihLoadingCircle.dart';
|
||||||
import 'package:patient_manager/env/env.dart';
|
import 'package:patient_manager/env/env.dart';
|
||||||
import 'package:patient_manager/main.dart';
|
import 'package:patient_manager/main.dart';
|
||||||
import 'package:patient_manager/objects/accessRequest.dart';
|
import 'package:patient_manager/objects/accessRequest.dart';
|
||||||
|
|||||||
@@ -2,11 +2,11 @@ import 'dart:convert';
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihErrorMessage.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihErrorMessage.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihTextInput.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihTextInput.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihButton.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihButton.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihLoadingCircle.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihLoadingCircle.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihSuccessMessage.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihSuccessMessage.dart';
|
||||||
import 'package:patient_manager/env/env.dart';
|
import 'package:patient_manager/env/env.dart';
|
||||||
import 'package:patient_manager/main.dart';
|
import 'package:patient_manager/main.dart';
|
||||||
import 'package:supabase_auth_ui/supabase_auth_ui.dart';
|
import 'package:supabase_auth_ui/supabase_auth_ui.dart';
|
||||||
|
|||||||
@@ -2,12 +2,12 @@ import 'dart:convert';
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihLoadingCircle.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihLoadingCircle.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihErrorMessage.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihErrorMessage.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihPassInput.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihPassInput.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihSuccessMessage.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihSuccessMessage.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihTextInput.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihTextInput.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihButton.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihButton.dart';
|
||||||
import 'package:patient_manager/env/env.dart';
|
import 'package:patient_manager/env/env.dart';
|
||||||
import 'package:patient_manager/main.dart';
|
import 'package:patient_manager/main.dart';
|
||||||
//import 'package:patient_manager/objects/sessionST.dart';
|
//import 'package:patient_manager/objects/sessionST.dart';
|
||||||
|
|||||||
@@ -2,11 +2,11 @@ import 'dart:convert';
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihPassInput.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihPassInput.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihErrorMessage.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihErrorMessage.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihButton.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihButton.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihLoadingCircle.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihLoadingCircle.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihSuccessMessage.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihSuccessMessage.dart';
|
||||||
import 'package:patient_manager/env/env.dart';
|
import 'package:patient_manager/env/env.dart';
|
||||||
import 'package:patient_manager/main.dart';
|
import 'package:patient_manager/main.dart';
|
||||||
import 'package:supabase_auth_ui/supabase_auth_ui.dart';
|
import 'package:supabase_auth_ui/supabase_auth_ui.dart';
|
||||||
|
|||||||
@@ -2,12 +2,12 @@ import 'dart:convert';
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:patient_manager/components/MIH_Layout/MIH_Tile.dart';
|
import 'package:patient_manager/MIH_Components/MIH_Layout/MIH_Tile.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihLoadingCircle.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihLoadingCircle.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihErrorMessage.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihErrorMessage.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihPassInput.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihPassInput.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihTextInput.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihTextInput.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihButton.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihButton.dart';
|
||||||
import 'package:patient_manager/env/env.dart';
|
import 'package:patient_manager/env/env.dart';
|
||||||
import 'package:patient_manager/main.dart';
|
import 'package:patient_manager/main.dart';
|
||||||
import 'package:supabase_auth_ui/supabase_auth_ui.dart';
|
import 'package:supabase_auth_ui/supabase_auth_ui.dart';
|
||||||
|
|||||||
@@ -1,484 +0,0 @@
|
|||||||
import 'dart:convert';
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter/services.dart';
|
|
||||||
import 'package:patient_manager/components/builders/buildEmployeeList.dart';
|
|
||||||
import 'package:patient_manager/components/builders/buildUserList.dart';
|
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihSearchInput.dart';
|
|
||||||
import 'package:patient_manager/components/popUpMessages/mihLoadingCircle.dart';
|
|
||||||
import 'package:patient_manager/components/popUpMessages/mihErrorMessage.dart';
|
|
||||||
import 'package:patient_manager/components/popUpMessages/mihSuccessMessage.dart';
|
|
||||||
import 'package:patient_manager/env/env.dart';
|
|
||||||
import 'package:patient_manager/main.dart';
|
|
||||||
import 'package:patient_manager/objects/appUser.dart';
|
|
||||||
import 'package:patient_manager/objects/arguments.dart';
|
|
||||||
import 'package:patient_manager/objects/businessEmployee.dart';
|
|
||||||
import 'package:supertokens_flutter/http.dart' as http;
|
|
||||||
|
|
||||||
class ManageBusinessProfile extends StatefulWidget {
|
|
||||||
final BusinessArguments arguments;
|
|
||||||
const ManageBusinessProfile({
|
|
||||||
super.key,
|
|
||||||
required this.arguments,
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<ManageBusinessProfile> createState() => _ManageBusinessProfileState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _ManageBusinessProfileState extends State<ManageBusinessProfile> {
|
|
||||||
final FocusNode _focusNode = FocusNode();
|
|
||||||
final baseAPI = AppEnviroment.baseApiUrl;
|
|
||||||
final TextEditingController searchController = TextEditingController();
|
|
||||||
|
|
||||||
String userSearch = "";
|
|
||||||
String errorCode = "";
|
|
||||||
String errorBody = "";
|
|
||||||
int selectionIndex = 0;
|
|
||||||
|
|
||||||
late Future<List<BusinessEmployee>> employeeList;
|
|
||||||
late Future<List<AppUser>> userSearchResults;
|
|
||||||
|
|
||||||
Future<List<BusinessEmployee>> fetchEmployees() async {
|
|
||||||
//print("Patien manager page: $endpoint");
|
|
||||||
final response = await http.get(Uri.parse(
|
|
||||||
"${AppEnviroment.baseApiUrl}/business-user/employees/${widget.arguments.businessUser!.business_id}"));
|
|
||||||
errorCode = response.statusCode.toString();
|
|
||||||
errorBody = response.body;
|
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
|
||||||
//print("Here1");
|
|
||||||
Iterable l = jsonDecode(response.body);
|
|
||||||
//print("Here2");
|
|
||||||
List<BusinessEmployee> patientQueue = List<BusinessEmployee>.from(
|
|
||||||
l.map((model) => BusinessEmployee.fromJson(model)));
|
|
||||||
//print("Here3");
|
|
||||||
//print(patientQueue);
|
|
||||||
return patientQueue;
|
|
||||||
} else {
|
|
||||||
throw Exception('failed to load employees');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<List<AppUser>> fetchUsers(String search) async {
|
|
||||||
//TODO
|
|
||||||
final response = await http
|
|
||||||
.get(Uri.parse("${AppEnviroment.baseApiUrl}/users/search/$search"));
|
|
||||||
errorCode = response.statusCode.toString();
|
|
||||||
errorBody = response.body;
|
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
|
||||||
Iterable l = jsonDecode(response.body);
|
|
||||||
List<AppUser> users =
|
|
||||||
List<AppUser>.from(l.map((model) => AppUser.fromJson(model)));
|
|
||||||
return users;
|
|
||||||
} else {
|
|
||||||
throw Exception('failed to load patients');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget employeesview(double w, double h) {
|
|
||||||
return SizedBox(
|
|
||||||
width: w,
|
|
||||||
height: h - 157,
|
|
||||||
child: Column(mainAxisSize: MainAxisSize.max, children: [
|
|
||||||
const Text(
|
|
||||||
"Business Team",
|
|
||||||
style: TextStyle(
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
fontSize: 25,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 15),
|
|
||||||
FutureBuilder(
|
|
||||||
future: employeeList,
|
|
||||||
builder: (context, snapshot) {
|
|
||||||
//print("patient Queue List ${snapshot.hasData}");
|
|
||||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
|
||||||
return Expanded(
|
|
||||||
child: Container(
|
|
||||||
height: 500,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color:
|
|
||||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
|
||||||
borderRadius: BorderRadius.circular(25.0),
|
|
||||||
border: Border.all(
|
|
||||||
color: MzanziInnovationHub.of(context)!
|
|
||||||
.theme
|
|
||||||
.secondaryColor(),
|
|
||||||
width: 3.0),
|
|
||||||
),
|
|
||||||
child: const Mihloadingcircle(),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
} else if (snapshot.connectionState == ConnectionState.done) {
|
|
||||||
//List<BusinessEmployee> employeeListResults;
|
|
||||||
// if (searchString == "") {
|
|
||||||
// patientQueueList = [];
|
|
||||||
// } else {
|
|
||||||
|
|
||||||
// print(patientQueueList);
|
|
||||||
// }
|
|
||||||
|
|
||||||
return Expanded(
|
|
||||||
child: displayEmployeeList(snapshot.requireData),
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return Expanded(
|
|
||||||
child: Container(
|
|
||||||
//height: 500,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color:
|
|
||||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
|
||||||
borderRadius: BorderRadius.circular(25.0),
|
|
||||||
border: Border.all(
|
|
||||||
color: MzanziInnovationHub.of(context)!
|
|
||||||
.theme
|
|
||||||
.secondaryColor(),
|
|
||||||
width: 3.0),
|
|
||||||
),
|
|
||||||
child: Center(
|
|
||||||
child: Text(
|
|
||||||
"$errorCode: Error pulling Patients Data\n${AppEnviroment.baseApiUrl}/business-user/users/${widget.arguments.businessUser!.business_id}\n$errorBody",
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 25,
|
|
||||||
color: MzanziInnovationHub.of(context)!
|
|
||||||
.theme
|
|
||||||
.errorColor()),
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
|
||||||
]),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget displayEmployeeList(List<BusinessEmployee> employeeList) {
|
|
||||||
if (employeeList.isNotEmpty) {
|
|
||||||
return Container(
|
|
||||||
height: 500,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
|
||||||
borderRadius: BorderRadius.circular(25.0),
|
|
||||||
border: Border.all(
|
|
||||||
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
|
||||||
width: 3.0,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: BuildEmployeeList(
|
|
||||||
employees: employeeList,
|
|
||||||
arguments: widget.arguments,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return Container(
|
|
||||||
//height: 500,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
|
||||||
borderRadius: BorderRadius.circular(25.0),
|
|
||||||
border: Border.all(
|
|
||||||
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
|
||||||
width: 3.0),
|
|
||||||
),
|
|
||||||
child: Center(
|
|
||||||
child: Text(
|
|
||||||
"",
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 25,
|
|
||||||
color: MzanziInnovationHub.of(context)!.theme.messageTextColor()),
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget displayUserList(List<AppUser> userList) {
|
|
||||||
if (userList.isNotEmpty) {
|
|
||||||
return Container(
|
|
||||||
height: 500,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
|
||||||
borderRadius: BorderRadius.circular(25.0),
|
|
||||||
border: Border.all(
|
|
||||||
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
|
||||||
width: 3.0,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: BuildUserList(
|
|
||||||
users: userList,
|
|
||||||
arguments: widget.arguments,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return Container(
|
|
||||||
//height: 500,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
|
||||||
borderRadius: BorderRadius.circular(25.0),
|
|
||||||
border: Border.all(
|
|
||||||
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
|
||||||
width: 3.0),
|
|
||||||
),
|
|
||||||
child: Center(
|
|
||||||
child: Text(
|
|
||||||
"Enter Username or Email to search",
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 25,
|
|
||||||
color: MzanziInnovationHub.of(context)!.theme.messageTextColor()),
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
void submitUserForm() {
|
|
||||||
if (searchController.text != "") {
|
|
||||||
setState(() {
|
|
||||||
userSearch = searchController.text;
|
|
||||||
userSearchResults = fetchUsers(userSearch);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
showDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (context) {
|
|
||||||
return const MIHErrorMessage(errorType: "Input Error");
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget userSearchView(double w, double h) {
|
|
||||||
return KeyboardListener(
|
|
||||||
focusNode: _focusNode,
|
|
||||||
autofocus: true,
|
|
||||||
onKeyEvent: (event) async {
|
|
||||||
if (event is KeyDownEvent &&
|
|
||||||
event.logicalKey == LogicalKeyboardKey.enter) {
|
|
||||||
submitUserForm();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
child: SizedBox(
|
|
||||||
width: w,
|
|
||||||
height: h - 157,
|
|
||||||
child: Column(mainAxisSize: MainAxisSize.max, children: [
|
|
||||||
const SizedBox(height: 5),
|
|
||||||
const Text(
|
|
||||||
"User Search",
|
|
||||||
style: TextStyle(fontSize: 25, fontWeight: FontWeight.bold),
|
|
||||||
),
|
|
||||||
//spacer
|
|
||||||
const SizedBox(height: 10),
|
|
||||||
MIHSearchField(
|
|
||||||
controller: searchController,
|
|
||||||
hintText: "Username or Email Search",
|
|
||||||
required: true,
|
|
||||||
editable: true,
|
|
||||||
onTap: () {
|
|
||||||
submitUserForm();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
//spacer
|
|
||||||
const SizedBox(height: 10),
|
|
||||||
FutureBuilder(
|
|
||||||
future: userSearchResults,
|
|
||||||
builder: (context, snapshot) {
|
|
||||||
//print("patient Liust ${snapshot.data}");
|
|
||||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
|
||||||
return Expanded(
|
|
||||||
child: Container(
|
|
||||||
//height: 500,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color:
|
|
||||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
|
||||||
borderRadius: BorderRadius.circular(25.0),
|
|
||||||
border: Border.all(
|
|
||||||
color: MzanziInnovationHub.of(context)!
|
|
||||||
.theme
|
|
||||||
.secondaryColor(),
|
|
||||||
width: 3.0),
|
|
||||||
),
|
|
||||||
child: const Mihloadingcircle(),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
} else if (snapshot.connectionState == ConnectionState.done &&
|
|
||||||
snapshot.hasData) {
|
|
||||||
List<AppUser> patientsList;
|
|
||||||
if (userSearch == "") {
|
|
||||||
patientsList = [];
|
|
||||||
} else {
|
|
||||||
patientsList = snapshot.data!;
|
|
||||||
//print(patientsList);
|
|
||||||
}
|
|
||||||
|
|
||||||
return Expanded(
|
|
||||||
child: displayUserList(patientsList),
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return Expanded(
|
|
||||||
child: Container(
|
|
||||||
//height: 500,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color:
|
|
||||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
|
||||||
borderRadius: BorderRadius.circular(25.0),
|
|
||||||
border: Border.all(
|
|
||||||
color: MzanziInnovationHub.of(context)!
|
|
||||||
.theme
|
|
||||||
.secondaryColor(),
|
|
||||||
width: 3.0),
|
|
||||||
),
|
|
||||||
child: Center(
|
|
||||||
child: Text(
|
|
||||||
"$errorCode: Error pulling Patients Data\n/patients/search/$userSearch\n$errorBody",
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 25,
|
|
||||||
color: MzanziInnovationHub.of(context)!
|
|
||||||
.theme
|
|
||||||
.errorColor()),
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
|
||||||
]),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
void internetConnectionPopUp() {
|
|
||||||
showDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (context) {
|
|
||||||
return const MIHErrorMessage(errorType: "Internet Connection");
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
void successPopUp(String message) {
|
|
||||||
showDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (context) {
|
|
||||||
return MIHSuccessMessage(
|
|
||||||
successType: "Success",
|
|
||||||
successMessage: message,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
void emailError() {
|
|
||||||
showDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (context) {
|
|
||||||
return const MIHErrorMessage(errorType: "Invalid Email");
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget showSelection(
|
|
||||||
int selectionIndex, double screenWidth, double screenHeight) {
|
|
||||||
if (selectionIndex == 0) {
|
|
||||||
return SizedBox(
|
|
||||||
//width: 660,
|
|
||||||
child: employeesview(screenWidth, screenHeight),
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return userSearchView(screenWidth, screenHeight);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void dispose() {
|
|
||||||
searchController.dispose();
|
|
||||||
_focusNode.dispose();
|
|
||||||
super.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
userSearchResults = fetchUsers("abc");
|
|
||||||
employeeList = fetchEmployees();
|
|
||||||
super.initState();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
final screenWidth = MediaQuery.of(context).size.width;
|
|
||||||
final screenHeight = MediaQuery.of(context).size.height;
|
|
||||||
return Scaffold(
|
|
||||||
// appBar: const MIHAppBar(
|
|
||||||
// barTitle: "Business Profile",
|
|
||||||
// propicFile: null,
|
|
||||||
// ),
|
|
||||||
//drawer: MIHAppDrawer(signedInUser: widget.arguments.signedInUser),
|
|
||||||
body: SafeArea(
|
|
||||||
child: Stack(
|
|
||||||
children: [
|
|
||||||
SingleChildScrollView(
|
|
||||||
padding: const EdgeInsets.all(15),
|
|
||||||
child: Column(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
children: [
|
|
||||||
//const SizedBox(height: 20),
|
|
||||||
SizedBox(
|
|
||||||
width: screenWidth,
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
|
||||||
children: [
|
|
||||||
IconButton(
|
|
||||||
onPressed: () {
|
|
||||||
setState(() {
|
|
||||||
selectionIndex = 0;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
icon: const Icon(
|
|
||||||
Icons.people_outline,
|
|
||||||
size: 35,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
IconButton(
|
|
||||||
onPressed: () {
|
|
||||||
setState(() {
|
|
||||||
selectionIndex = 1;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
icon: const Icon(
|
|
||||||
Icons.add,
|
|
||||||
size: 35,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
showSelection(selectionIndex, screenWidth, screenHeight),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Positioned(
|
|
||||||
top: 10,
|
|
||||||
left: 5,
|
|
||||||
width: 50,
|
|
||||||
height: 50,
|
|
||||||
child: IconButton(
|
|
||||||
onPressed: () {
|
|
||||||
Navigator.of(context).pop();
|
|
||||||
},
|
|
||||||
icon: const Icon(Icons.arrow_back),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihButton.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihButton.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihDropdownInput.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihDropdownInput.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihTextInput.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihTextInput.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihDeleteMessage.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihDeleteMessage.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihErrorMessage.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihErrorMessage.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihLoadingCircle.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihLoadingCircle.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihSuccessMessage.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihSuccessMessage.dart';
|
||||||
import 'package:patient_manager/env/env.dart';
|
import 'package:patient_manager/env/env.dart';
|
||||||
import 'package:patient_manager/main.dart';
|
import 'package:patient_manager/main.dart';
|
||||||
import 'package:patient_manager/objects/arguments.dart';
|
import 'package:patient_manager/objects/arguments.dart';
|
||||||
@@ -284,6 +284,7 @@ class _BuildEmployeeListState extends State<BuildEmployeeList> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ListView.separated(
|
return ListView.separated(
|
||||||
|
shrinkWrap: true,
|
||||||
separatorBuilder: (BuildContext context, index) {
|
separatorBuilder: (BuildContext context, index) {
|
||||||
return Divider(
|
return Divider(
|
||||||
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihButton.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihButton.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihDropdownInput.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihDropdownInput.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihTextInput.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihTextInput.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihErrorMessage.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihErrorMessage.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihLoadingCircle.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihLoadingCircle.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihSuccessMessage.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihSuccessMessage.dart';
|
||||||
import 'package:patient_manager/env/env.dart';
|
import 'package:patient_manager/env/env.dart';
|
||||||
import 'package:patient_manager/main.dart';
|
import 'package:patient_manager/main.dart';
|
||||||
import 'package:patient_manager/objects/appUser.dart';
|
import 'package:patient_manager/objects/appUser.dart';
|
||||||
@@ -231,6 +231,7 @@ class _BuildUserListState extends State<BuildUserList> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ListView.separated(
|
return ListView.separated(
|
||||||
|
shrinkWrap: true,
|
||||||
separatorBuilder: (BuildContext context, index) {
|
separatorBuilder: (BuildContext context, index) {
|
||||||
return Divider(
|
return Divider(
|
||||||
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
@@ -3,13 +3,13 @@ import 'dart:convert';
|
|||||||
import 'package:file_picker/file_picker.dart';
|
import 'package:file_picker/file_picker.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihLoadingCircle.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihLoadingCircle.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihDropdownInput.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihDropdownInput.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihErrorMessage.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihErrorMessage.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihFileInput.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihFileInput.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihSuccessMessage.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihSuccessMessage.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihTextInput.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihTextInput.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihButton.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihButton.dart';
|
||||||
import 'package:patient_manager/env/env.dart';
|
import 'package:patient_manager/env/env.dart';
|
||||||
import 'package:patient_manager/main.dart';
|
import 'package:patient_manager/main.dart';
|
||||||
import 'package:patient_manager/objects/arguments.dart';
|
import 'package:patient_manager/objects/arguments.dart';
|
||||||
@@ -17,20 +17,20 @@ import 'package:supertokens_flutter/http.dart' as http;
|
|||||||
import 'package:supertokens_flutter/supertokens.dart';
|
import 'package:supertokens_flutter/supertokens.dart';
|
||||||
import 'package:http/http.dart' as http2;
|
import 'package:http/http.dart' as http2;
|
||||||
|
|
||||||
class ProfileBusinessUpdate extends StatefulWidget {
|
class BusinessDetails extends StatefulWidget {
|
||||||
final BusinessArguments arguments;
|
final BusinessArguments arguments;
|
||||||
const ProfileBusinessUpdate({
|
const BusinessDetails({
|
||||||
super.key,
|
super.key,
|
||||||
required this.arguments,
|
required this.arguments,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<ProfileBusinessUpdate> createState() => _ProfileBusinessUpdateState();
|
State<BusinessDetails> createState() => _BusinessDetailsState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class BusinessUserScreenArguments {}
|
class BusinessUserScreenArguments {}
|
||||||
|
|
||||||
class _ProfileBusinessUpdateState extends State<ProfileBusinessUpdate> {
|
class _BusinessDetailsState extends State<BusinessDetails> {
|
||||||
final FocusNode _focusNode = FocusNode();
|
final FocusNode _focusNode = FocusNode();
|
||||||
final baseAPI = AppEnviroment.baseApiUrl;
|
final baseAPI = AppEnviroment.baseApiUrl;
|
||||||
|
|
||||||
@@ -317,206 +317,185 @@ class _ProfileBusinessUpdateState extends State<ProfileBusinessUpdate> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return SafeArea(
|
||||||
// appBar: const MIHAppBar(
|
child: KeyboardListener(
|
||||||
// barTitle: "Business Profile",
|
focusNode: _focusNode,
|
||||||
// propicFile: null,
|
autofocus: true,
|
||||||
// ),
|
onKeyEvent: (event) async {
|
||||||
//drawer: MIHAppDrawer(signedInUser: widget.arguments.signedInUser),
|
if (event is KeyDownEvent &&
|
||||||
body: SafeArea(
|
event.logicalKey == LogicalKeyboardKey.enter) {
|
||||||
child: Stack(
|
//print(business_id);
|
||||||
children: [
|
submitForm(business_id);
|
||||||
KeyboardListener(
|
}
|
||||||
focusNode: _focusNode,
|
},
|
||||||
autofocus: true,
|
child: SingleChildScrollView(
|
||||||
onKeyEvent: (event) async {
|
child: Column(
|
||||||
if (event is KeyDownEvent &&
|
children: [
|
||||||
event.logicalKey == LogicalKeyboardKey.enter) {
|
Visibility(
|
||||||
//print(business_id);
|
visible: isFullAccess(),
|
||||||
submitForm(business_id);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
child: SingleChildScrollView(
|
|
||||||
padding: const EdgeInsets.all(15),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Visibility(
|
const Text(
|
||||||
visible: isFullAccess(),
|
"Business Profile",
|
||||||
child: Column(
|
style: TextStyle(
|
||||||
children: [
|
fontWeight: FontWeight.bold,
|
||||||
const Text(
|
fontSize: 25,
|
||||||
"Business Profile",
|
|
||||||
style: TextStyle(
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
fontSize: 25,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 25.0),
|
|
||||||
MIHTextField(
|
|
||||||
controller: regController,
|
|
||||||
hintText: "Registration No.",
|
|
||||||
editable: true,
|
|
||||||
required: true,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 10.0),
|
|
||||||
MIHTextField(
|
|
||||||
controller: nameController,
|
|
||||||
hintText: "Business Name",
|
|
||||||
editable: true,
|
|
||||||
required: true,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 10.0),
|
|
||||||
MIHDropdownField(
|
|
||||||
controller: typeController,
|
|
||||||
hintText: "Business Type",
|
|
||||||
dropdownOptions: const ["Doctors Office", "Other"],
|
|
||||||
required: true,
|
|
||||||
editable: true,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 10.0),
|
|
||||||
MIHTextField(
|
|
||||||
controller: contactController,
|
|
||||||
hintText: "Contact Number",
|
|
||||||
editable: true,
|
|
||||||
required: true,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 10.0),
|
|
||||||
MIHTextField(
|
|
||||||
controller: emailController,
|
|
||||||
hintText: "Email",
|
|
||||||
editable: true,
|
|
||||||
required: true,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 10.0),
|
|
||||||
MIHFileField(
|
|
||||||
controller: logonameController,
|
|
||||||
hintText: "Logo",
|
|
||||||
editable: false,
|
|
||||||
required: true,
|
|
||||||
onPressed: () async {
|
|
||||||
FilePickerResult? result =
|
|
||||||
await FilePicker.platform.pickFiles(
|
|
||||||
type: FileType.custom,
|
|
||||||
allowedExtensions: ['jpg', 'png', 'pdf'],
|
|
||||||
);
|
|
||||||
if (result == null) return;
|
|
||||||
final selectedFile = result.files.first;
|
|
||||||
setState(() {
|
|
||||||
selectedLogo = selectedFile;
|
|
||||||
});
|
|
||||||
setState(() {
|
|
||||||
logonameController.text = selectedFile.name;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
),
|
|
||||||
const SizedBox(height: 15.0),
|
|
||||||
Divider(
|
|
||||||
color: MzanziInnovationHub.of(context)
|
|
||||||
?.theme
|
|
||||||
.secondaryColor(),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Column(
|
Divider(
|
||||||
children: [
|
color: MzanziInnovationHub.of(context)
|
||||||
//const SizedBox(height: 15.0),
|
?.theme
|
||||||
const Text(
|
.secondaryColor(),
|
||||||
"My Business User",
|
|
||||||
style: TextStyle(
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
fontSize: 25,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 25.0),
|
|
||||||
MIHDropdownField(
|
|
||||||
controller: titleController,
|
|
||||||
hintText: "Title",
|
|
||||||
dropdownOptions: const ["Doctor", "Assistant"],
|
|
||||||
required: true,
|
|
||||||
editable: true,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 10.0),
|
|
||||||
MIHTextField(
|
|
||||||
controller: fnameController,
|
|
||||||
hintText: "Name",
|
|
||||||
editable: false,
|
|
||||||
required: true,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 10.0),
|
|
||||||
MIHTextField(
|
|
||||||
controller: lnameController,
|
|
||||||
hintText: "Surname",
|
|
||||||
editable: false,
|
|
||||||
required: true,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 10.0),
|
|
||||||
MIHFileField(
|
|
||||||
controller: signtureController,
|
|
||||||
hintText: "Signature",
|
|
||||||
editable: false,
|
|
||||||
required: true,
|
|
||||||
onPressed: () async {
|
|
||||||
FilePickerResult? result =
|
|
||||||
await FilePicker.platform.pickFiles(
|
|
||||||
type: FileType.custom,
|
|
||||||
allowedExtensions: ['jpg', 'png', 'pdf'],
|
|
||||||
);
|
|
||||||
if (result == null) return;
|
|
||||||
final selectedFile = result.files.first;
|
|
||||||
setState(() {
|
|
||||||
selectedSignature = selectedFile;
|
|
||||||
});
|
|
||||||
setState(() {
|
|
||||||
signtureController.text = selectedFile.name;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
),
|
|
||||||
const SizedBox(height: 15.0),
|
|
||||||
MIHDropdownField(
|
|
||||||
controller: accessController,
|
|
||||||
hintText: "Access",
|
|
||||||
dropdownOptions: const ["Full", "Partial"],
|
|
||||||
required: true,
|
|
||||||
editable: false,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 30.0),
|
|
||||||
SizedBox(
|
|
||||||
width: 500.0,
|
|
||||||
height: 50.0,
|
|
||||||
child: MIHButton(
|
|
||||||
buttonText: "Update",
|
|
||||||
buttonColor: MzanziInnovationHub.of(context)!
|
|
||||||
.theme
|
|
||||||
.secondaryColor(),
|
|
||||||
textColor: MzanziInnovationHub.of(context)!
|
|
||||||
.theme
|
|
||||||
.primaryColor(),
|
|
||||||
onTap: () {
|
|
||||||
//print(business_id);
|
|
||||||
submitForm(business_id);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
|
const SizedBox(height: 10.0),
|
||||||
|
MIHTextField(
|
||||||
|
controller: regController,
|
||||||
|
hintText: "Registration No.",
|
||||||
|
editable: true,
|
||||||
|
required: true,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10.0),
|
||||||
|
MIHTextField(
|
||||||
|
controller: nameController,
|
||||||
|
hintText: "Business Name",
|
||||||
|
editable: true,
|
||||||
|
required: true,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10.0),
|
||||||
|
MIHDropdownField(
|
||||||
|
controller: typeController,
|
||||||
|
hintText: "Business Type",
|
||||||
|
dropdownOptions: const ["Doctors Office", "Other"],
|
||||||
|
required: true,
|
||||||
|
editable: true,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10.0),
|
||||||
|
MIHTextField(
|
||||||
|
controller: contactController,
|
||||||
|
hintText: "Contact Number",
|
||||||
|
editable: true,
|
||||||
|
required: true,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10.0),
|
||||||
|
MIHTextField(
|
||||||
|
controller: emailController,
|
||||||
|
hintText: "Email",
|
||||||
|
editable: true,
|
||||||
|
required: true,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10.0),
|
||||||
|
MIHFileField(
|
||||||
|
controller: logonameController,
|
||||||
|
hintText: "Logo",
|
||||||
|
editable: false,
|
||||||
|
required: true,
|
||||||
|
onPressed: () async {
|
||||||
|
FilePickerResult? result =
|
||||||
|
await FilePicker.platform.pickFiles(
|
||||||
|
type: FileType.custom,
|
||||||
|
allowedExtensions: ['jpg', 'png', 'pdf'],
|
||||||
|
);
|
||||||
|
if (result == null) return;
|
||||||
|
final selectedFile = result.files.first;
|
||||||
|
setState(() {
|
||||||
|
selectedLogo = selectedFile;
|
||||||
|
});
|
||||||
|
setState(() {
|
||||||
|
logonameController.text = selectedFile.name;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
const SizedBox(height: 15.0),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
Column(
|
||||||
Positioned(
|
children: [
|
||||||
top: 10,
|
//const SizedBox(height: 15.0),
|
||||||
left: 5,
|
const Text(
|
||||||
width: 50,
|
"My Business User",
|
||||||
height: 50,
|
style: TextStyle(
|
||||||
child: IconButton(
|
fontWeight: FontWeight.bold,
|
||||||
onPressed: () {
|
fontSize: 25,
|
||||||
Navigator.of(context).pop();
|
),
|
||||||
},
|
),
|
||||||
icon: const Icon(Icons.arrow_back),
|
Divider(
|
||||||
|
color:
|
||||||
|
MzanziInnovationHub.of(context)?.theme.secondaryColor(),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10.0),
|
||||||
|
MIHDropdownField(
|
||||||
|
controller: titleController,
|
||||||
|
hintText: "Title",
|
||||||
|
dropdownOptions: const ["Doctor", "Assistant"],
|
||||||
|
required: true,
|
||||||
|
editable: true,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10.0),
|
||||||
|
MIHTextField(
|
||||||
|
controller: fnameController,
|
||||||
|
hintText: "Name",
|
||||||
|
editable: false,
|
||||||
|
required: true,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10.0),
|
||||||
|
MIHTextField(
|
||||||
|
controller: lnameController,
|
||||||
|
hintText: "Surname",
|
||||||
|
editable: false,
|
||||||
|
required: true,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10.0),
|
||||||
|
MIHFileField(
|
||||||
|
controller: signtureController,
|
||||||
|
hintText: "Signature",
|
||||||
|
editable: false,
|
||||||
|
required: true,
|
||||||
|
onPressed: () async {
|
||||||
|
FilePickerResult? result =
|
||||||
|
await FilePicker.platform.pickFiles(
|
||||||
|
type: FileType.custom,
|
||||||
|
allowedExtensions: ['jpg', 'png', 'pdf'],
|
||||||
|
);
|
||||||
|
if (result == null) return;
|
||||||
|
final selectedFile = result.files.first;
|
||||||
|
setState(() {
|
||||||
|
selectedSignature = selectedFile;
|
||||||
|
});
|
||||||
|
setState(() {
|
||||||
|
signtureController.text = selectedFile.name;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
const SizedBox(height: 15.0),
|
||||||
|
MIHDropdownField(
|
||||||
|
controller: accessController,
|
||||||
|
hintText: "Access",
|
||||||
|
dropdownOptions: const ["Full", "Partial"],
|
||||||
|
required: true,
|
||||||
|
editable: false,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 30.0),
|
||||||
|
SizedBox(
|
||||||
|
width: 500.0,
|
||||||
|
height: 50.0,
|
||||||
|
child: MIHButton(
|
||||||
|
buttonText: "Update",
|
||||||
|
buttonColor: MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.secondaryColor(),
|
||||||
|
textColor:
|
||||||
|
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||||
|
onTap: () {
|
||||||
|
//print(business_id);
|
||||||
|
submitForm(business_id);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
)
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -0,0 +1,445 @@
|
|||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:patient_manager/MIH_Packages/manage_business/businessDetails.dart';
|
||||||
|
import 'package:patient_manager/MIH_Components/MIH_Layout/MIH_Action.dart';
|
||||||
|
import 'package:patient_manager/MIH_Components/MIH_Layout/MIH_Body.dart';
|
||||||
|
import 'package:patient_manager/MIH_Components/MIH_Layout/MIH_Header.dart';
|
||||||
|
import 'package:patient_manager/MIH_Components/MIH_Layout/MIH_LayoutBuilder.dart';
|
||||||
|
import 'package:patient_manager/MIH_Packages/manage_business/builder/buildEmployeeList.dart';
|
||||||
|
import 'package:patient_manager/MIH_Packages/manage_business/builder/buildUserList.dart';
|
||||||
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihSearchInput.dart';
|
||||||
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihLoadingCircle.dart';
|
||||||
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihErrorMessage.dart';
|
||||||
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihSuccessMessage.dart';
|
||||||
|
import 'package:patient_manager/env/env.dart';
|
||||||
|
import 'package:patient_manager/main.dart';
|
||||||
|
import 'package:patient_manager/objects/appUser.dart';
|
||||||
|
import 'package:patient_manager/objects/arguments.dart';
|
||||||
|
import 'package:patient_manager/objects/businessEmployee.dart';
|
||||||
|
import 'package:supertokens_flutter/http.dart' as http;
|
||||||
|
|
||||||
|
class ManageBusinessProfile extends StatefulWidget {
|
||||||
|
final BusinessArguments arguments;
|
||||||
|
const ManageBusinessProfile({
|
||||||
|
super.key,
|
||||||
|
required this.arguments,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<ManageBusinessProfile> createState() => _ManageBusinessProfileState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _ManageBusinessProfileState extends State<ManageBusinessProfile> {
|
||||||
|
final FocusNode _focusNode = FocusNode();
|
||||||
|
final baseAPI = AppEnviroment.baseApiUrl;
|
||||||
|
final TextEditingController searchController = TextEditingController();
|
||||||
|
|
||||||
|
String userSearch = "";
|
||||||
|
String errorCode = "";
|
||||||
|
String errorBody = "";
|
||||||
|
int selectionIndex = 0;
|
||||||
|
|
||||||
|
late Future<List<BusinessEmployee>> employeeList;
|
||||||
|
late Future<List<AppUser>> userSearchResults;
|
||||||
|
|
||||||
|
Future<List<BusinessEmployee>> fetchEmployees() async {
|
||||||
|
//print("Patien manager page: $endpoint");
|
||||||
|
final response = await http.get(Uri.parse(
|
||||||
|
"${AppEnviroment.baseApiUrl}/business-user/employees/${widget.arguments.businessUser!.business_id}"));
|
||||||
|
errorCode = response.statusCode.toString();
|
||||||
|
errorBody = response.body;
|
||||||
|
|
||||||
|
if (response.statusCode == 200) {
|
||||||
|
//print("Here1");
|
||||||
|
Iterable l = jsonDecode(response.body);
|
||||||
|
//print("Here2");
|
||||||
|
List<BusinessEmployee> patientQueue = List<BusinessEmployee>.from(
|
||||||
|
l.map((model) => BusinessEmployee.fromJson(model)));
|
||||||
|
//print("Here3");
|
||||||
|
//print(patientQueue);
|
||||||
|
return patientQueue;
|
||||||
|
} else {
|
||||||
|
throw Exception('failed to load employees');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<List<AppUser>> fetchUsers(String search) async {
|
||||||
|
//TODO
|
||||||
|
final response = await http
|
||||||
|
.get(Uri.parse("${AppEnviroment.baseApiUrl}/users/search/$search"));
|
||||||
|
errorCode = response.statusCode.toString();
|
||||||
|
errorBody = response.body;
|
||||||
|
|
||||||
|
if (response.statusCode == 200) {
|
||||||
|
Iterable l = jsonDecode(response.body);
|
||||||
|
List<AppUser> users =
|
||||||
|
List<AppUser>.from(l.map((model) => AppUser.fromJson(model)));
|
||||||
|
return users;
|
||||||
|
} else {
|
||||||
|
throw Exception('failed to load patients');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget employeesview() {
|
||||||
|
return Column(mainAxisSize: MainAxisSize.max, children: [
|
||||||
|
const Text(
|
||||||
|
"Business Team",
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 25,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Divider(color: MzanziInnovationHub.of(context)!.theme.secondaryColor()),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
FutureBuilder(
|
||||||
|
future: employeeList,
|
||||||
|
builder: (context, snapshot) {
|
||||||
|
//print("patient Queue List ${snapshot.hasData}");
|
||||||
|
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||||
|
return const Mihloadingcircle();
|
||||||
|
} else if (snapshot.connectionState == ConnectionState.done) {
|
||||||
|
//List<BusinessEmployee> employeeListResults;
|
||||||
|
// if (searchString == "") {
|
||||||
|
// patientQueueList = [];
|
||||||
|
// } else {
|
||||||
|
|
||||||
|
// print(patientQueueList);
|
||||||
|
// }
|
||||||
|
|
||||||
|
return displayEmployeeList(snapshot.requireData);
|
||||||
|
} else {
|
||||||
|
return Center(
|
||||||
|
child: Text(
|
||||||
|
"$errorCode: Error pulling Patients Data\n${AppEnviroment.baseApiUrl}/business-user/users/${widget.arguments.businessUser!.business_id}\n$errorBody",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 25,
|
||||||
|
color: MzanziInnovationHub.of(context)!.theme.errorColor()),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget displayEmployeeList(List<BusinessEmployee> employeeList) {
|
||||||
|
if (employeeList.isNotEmpty) {
|
||||||
|
return BuildEmployeeList(
|
||||||
|
employees: employeeList,
|
||||||
|
arguments: widget.arguments,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return Center(
|
||||||
|
child: Text(
|
||||||
|
"",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 25,
|
||||||
|
color: MzanziInnovationHub.of(context)!.theme.messageTextColor()),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget displayUserList(List<AppUser> userList) {
|
||||||
|
if (userList.isNotEmpty) {
|
||||||
|
return BuildUserList(
|
||||||
|
users: userList,
|
||||||
|
arguments: widget.arguments,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return Center(
|
||||||
|
child: Text(
|
||||||
|
"Enter Username or Email to search",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 25,
|
||||||
|
color: MzanziInnovationHub.of(context)!.theme.messageTextColor()),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void submitUserForm() {
|
||||||
|
if (searchController.text != "") {
|
||||||
|
setState(() {
|
||||||
|
userSearch = searchController.text;
|
||||||
|
userSearchResults = fetchUsers(userSearch);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (context) {
|
||||||
|
return const MIHErrorMessage(errorType: "Input Error");
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget userSearchView() {
|
||||||
|
return KeyboardListener(
|
||||||
|
focusNode: _focusNode,
|
||||||
|
autofocus: true,
|
||||||
|
onKeyEvent: (event) async {
|
||||||
|
if (event is KeyDownEvent &&
|
||||||
|
event.logicalKey == LogicalKeyboardKey.enter) {
|
||||||
|
submitUserForm();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: Column(mainAxisSize: MainAxisSize.max, children: [
|
||||||
|
const Text(
|
||||||
|
"User Search",
|
||||||
|
style: TextStyle(fontSize: 25, fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
//spacer
|
||||||
|
Divider(color: MzanziInnovationHub.of(context)!.theme.secondaryColor()),
|
||||||
|
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
MIHSearchField(
|
||||||
|
controller: searchController,
|
||||||
|
hintText: "Username or Email Search",
|
||||||
|
required: true,
|
||||||
|
editable: true,
|
||||||
|
onTap: () {
|
||||||
|
submitUserForm();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
//spacer
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
FutureBuilder(
|
||||||
|
future: userSearchResults,
|
||||||
|
builder: (context, snapshot) {
|
||||||
|
//print("patient Liust ${snapshot.data}");
|
||||||
|
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||||
|
return const Mihloadingcircle();
|
||||||
|
} else if (snapshot.connectionState == ConnectionState.done &&
|
||||||
|
snapshot.hasData) {
|
||||||
|
List<AppUser> patientsList;
|
||||||
|
if (userSearch == "") {
|
||||||
|
patientsList = [];
|
||||||
|
} else {
|
||||||
|
patientsList = snapshot.data!;
|
||||||
|
//print(patientsList);
|
||||||
|
}
|
||||||
|
|
||||||
|
return displayUserList(patientsList);
|
||||||
|
} else {
|
||||||
|
return Center(
|
||||||
|
child: Text(
|
||||||
|
"$errorCode: Error pulling Patients Data\n/patients/search/$userSearch\n$errorBody",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 25,
|
||||||
|
color:
|
||||||
|
MzanziInnovationHub.of(context)!.theme.errorColor()),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
]),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void internetConnectionPopUp() {
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (context) {
|
||||||
|
return const MIHErrorMessage(errorType: "Internet Connection");
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void successPopUp(String message) {
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (context) {
|
||||||
|
return MIHSuccessMessage(
|
||||||
|
successType: "Success",
|
||||||
|
successMessage: message,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void emailError() {
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (context) {
|
||||||
|
return const MIHErrorMessage(errorType: "Invalid Email");
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget showSelection(int selectionIndex) {
|
||||||
|
if (selectionIndex == 0) {
|
||||||
|
return BusinessDetails(arguments: widget.arguments);
|
||||||
|
} else if (selectionIndex == 1) {
|
||||||
|
return employeesview();
|
||||||
|
} else {
|
||||||
|
return userSearchView();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MIHAction getActionButton() {
|
||||||
|
return MIHAction(
|
||||||
|
icon: Icons.arrow_back,
|
||||||
|
iconSize: 35,
|
||||||
|
onTap: () {
|
||||||
|
Navigator.of(context).pushNamedAndRemoveUntil('/', (route) => false);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
MIHHeader getHeader() {
|
||||||
|
bool isFullAccess = false;
|
||||||
|
if (widget.arguments.businessUser!.access == "Full") {
|
||||||
|
isFullAccess = true;
|
||||||
|
}
|
||||||
|
return MIHHeader(
|
||||||
|
headerAlignment: MainAxisAlignment.end,
|
||||||
|
headerItems: [
|
||||||
|
IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
setState(() {
|
||||||
|
selectionIndex = 0;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.business,
|
||||||
|
size: 35,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Visibility(
|
||||||
|
visible: isFullAccess,
|
||||||
|
child: IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
setState(() {
|
||||||
|
selectionIndex = 1;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.people_outline,
|
||||||
|
size: 35,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Visibility(
|
||||||
|
visible: isFullAccess,
|
||||||
|
child: IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
setState(() {
|
||||||
|
selectionIndex = 2;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.add,
|
||||||
|
size: 35,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
MIHBody getBody() {
|
||||||
|
return MIHBody(
|
||||||
|
borderOn: true,
|
||||||
|
bodyItems: [
|
||||||
|
showSelection(selectionIndex),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
searchController.dispose();
|
||||||
|
_focusNode.dispose();
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
userSearchResults = fetchUsers("abc");
|
||||||
|
employeeList = fetchEmployees();
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return MIHLayoutBuilder(
|
||||||
|
actionButton: getActionButton(),
|
||||||
|
header: getHeader(),
|
||||||
|
body: getBody(),
|
||||||
|
);
|
||||||
|
// return Scaffold(
|
||||||
|
// // appBar: const MIHAppBar(
|
||||||
|
// // barTitle: "Business Profile",
|
||||||
|
// // propicFile: null,
|
||||||
|
// // ),
|
||||||
|
// //drawer: MIHAppDrawer(signedInUser: widget.arguments.signedInUser),
|
||||||
|
// body: SafeArea(
|
||||||
|
// child: Stack(
|
||||||
|
// children: [
|
||||||
|
// SingleChildScrollView(
|
||||||
|
// padding: const EdgeInsets.all(15),
|
||||||
|
// child: Column(
|
||||||
|
// mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
// mainAxisSize: MainAxisSize.max,
|
||||||
|
// children: [
|
||||||
|
// //const SizedBox(height: 20),
|
||||||
|
// SizedBox(
|
||||||
|
// width: screenWidth,
|
||||||
|
// child: Row(
|
||||||
|
// mainAxisSize: MainAxisSize.min,
|
||||||
|
// crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
|
// mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
// children: [
|
||||||
|
// IconButton(
|
||||||
|
// onPressed: () {
|
||||||
|
// setState(() {
|
||||||
|
// selectionIndex = 0;
|
||||||
|
// });
|
||||||
|
// },
|
||||||
|
// icon: const Icon(
|
||||||
|
// Icons.people_outline,
|
||||||
|
// size: 35,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// IconButton(
|
||||||
|
// onPressed: () {
|
||||||
|
// setState(() {
|
||||||
|
// selectionIndex = 1;
|
||||||
|
// });
|
||||||
|
// },
|
||||||
|
// icon: const Icon(
|
||||||
|
// Icons.add,
|
||||||
|
// size: 35,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// showSelection(selectionIndex, screenWidth, screenHeight),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// Positioned(
|
||||||
|
// top: 10,
|
||||||
|
// left: 5,
|
||||||
|
// width: 50,
|
||||||
|
// height: 50,
|
||||||
|
// child: IconButton(
|
||||||
|
// onPressed: () {
|
||||||
|
// Navigator.of(context).pop();
|
||||||
|
// },
|
||||||
|
// icon: const Icon(Icons.arrow_back),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// );
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,13 +2,13 @@ import 'dart:convert';
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihLoadingCircle.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihLoadingCircle.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihDropdownInput.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihDropdownInput.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihErrorMessage.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihErrorMessage.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihFileInput.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihFileInput.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihSuccessMessage.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihSuccessMessage.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihTextInput.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihTextInput.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihButton.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihButton.dart';
|
||||||
import 'package:patient_manager/env/env.dart';
|
import 'package:patient_manager/env/env.dart';
|
||||||
import 'package:patient_manager/main.dart';
|
import 'package:patient_manager/main.dart';
|
||||||
import 'package:patient_manager/objects/appUser.dart';
|
import 'package:patient_manager/objects/appUser.dart';
|
||||||
@@ -3,16 +3,16 @@ import 'dart:convert';
|
|||||||
import 'package:file_picker/file_picker.dart';
|
import 'package:file_picker/file_picker.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:patient_manager/components/MIH_Layout/MIH_Action.dart';
|
import 'package:patient_manager/MIH_Components/MIH_Layout/MIH_Action.dart';
|
||||||
import 'package:patient_manager/components/MIH_Layout/MIH_Body.dart';
|
import 'package:patient_manager/MIH_Components/MIH_Layout/MIH_Body.dart';
|
||||||
import 'package:patient_manager/components/MIH_Layout/MIH_Header.dart';
|
import 'package:patient_manager/MIH_Components/MIH_Layout/MIH_Header.dart';
|
||||||
import 'package:patient_manager/components/MIH_Layout/MIH_LayoutBuilder.dart';
|
import 'package:patient_manager/MIH_Components/MIH_Layout/MIH_LayoutBuilder.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihFileInput.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihFileInput.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihLoadingCircle.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihLoadingCircle.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihErrorMessage.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihErrorMessage.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihSuccessMessage.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihSuccessMessage.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihTextInput.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihTextInput.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihButton.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihButton.dart';
|
||||||
import 'package:patient_manager/env/env.dart';
|
import 'package:patient_manager/env/env.dart';
|
||||||
import 'package:patient_manager/main.dart';
|
import 'package:patient_manager/main.dart';
|
||||||
import 'package:patient_manager/objects/arguments.dart';
|
import 'package:patient_manager/objects/arguments.dart';
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihLoadingCircle.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihLoadingCircle.dart';
|
||||||
import 'package:patient_manager/env/env.dart';
|
import 'package:patient_manager/env/env.dart';
|
||||||
import 'package:patient_manager/main.dart';
|
import 'package:patient_manager/main.dart';
|
||||||
import 'package:patient_manager/objects/arguments.dart';
|
import 'package:patient_manager/objects/arguments.dart';
|
||||||
|
|||||||
@@ -2,11 +2,11 @@ import 'dart:convert';
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:patient_manager/MIH_Packages/patient_profile/builder/BuildFileView.dart';
|
import 'package:patient_manager/MIH_Packages/patient_profile/builder/BuildFileView.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihLoadingCircle.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihLoadingCircle.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihDeleteMessage.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihDeleteMessage.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihErrorMessage.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihErrorMessage.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihSuccessMessage.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihSuccessMessage.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihButton.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihButton.dart';
|
||||||
import 'package:patient_manager/env/env.dart';
|
import 'package:patient_manager/env/env.dart';
|
||||||
import 'package:patient_manager/main.dart';
|
import 'package:patient_manager/main.dart';
|
||||||
import 'package:patient_manager/objects/appUser.dart';
|
import 'package:patient_manager/objects/appUser.dart';
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihTextInput.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihTextInput.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihDeleteMessage.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihDeleteMessage.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihErrorMessage.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihErrorMessage.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihMLTextInput.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihMLTextInput.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihSuccessMessage.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihSuccessMessage.dart';
|
||||||
import 'package:patient_manager/env/env.dart';
|
import 'package:patient_manager/env/env.dart';
|
||||||
import 'package:patient_manager/main.dart';
|
import 'package:patient_manager/main.dart';
|
||||||
import 'package:patient_manager/objects/appUser.dart';
|
import 'package:patient_manager/objects/appUser.dart';
|
||||||
import 'package:patient_manager/objects/arguments.dart';
|
import 'package:patient_manager/objects/arguments.dart';
|
||||||
import 'package:patient_manager/objects/business.dart';
|
import 'package:patient_manager/objects/business.dart';
|
||||||
import 'package:patient_manager/objects/businessUser.dart';
|
import 'package:patient_manager/objects/businessUser.dart';
|
||||||
//import 'package:patient_manager/components/mybutton.dart';
|
//import 'package:patient_manager/MIH_Components/mybutton.dart';
|
||||||
import 'package:patient_manager/objects/notes.dart';
|
import 'package:patient_manager/objects/notes.dart';
|
||||||
import 'package:patient_manager/objects/patients.dart';
|
import 'package:patient_manager/objects/patients.dart';
|
||||||
import 'package:supertokens_flutter/http.dart' as http;
|
import 'package:supertokens_flutter/http.dart' as http;
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihDateInput.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihDateInput.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihTextInput.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihTextInput.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihTimeInput.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihTimeInput.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihErrorMessage.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihErrorMessage.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihButton.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihButton.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihSuccessMessage.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihSuccessMessage.dart';
|
||||||
import 'package:patient_manager/env/env.dart';
|
import 'package:patient_manager/env/env.dart';
|
||||||
import 'package:patient_manager/main.dart';
|
import 'package:patient_manager/main.dart';
|
||||||
import 'package:patient_manager/objects/appUser.dart';
|
import 'package:patient_manager/objects/appUser.dart';
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihWarningMessage.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihWarningMessage.dart';
|
||||||
import 'package:patient_manager/env/env.dart';
|
import 'package:patient_manager/env/env.dart';
|
||||||
import 'package:patient_manager/main.dart';
|
import 'package:patient_manager/main.dart';
|
||||||
import 'package:patient_manager/objects/appUser.dart';
|
import 'package:patient_manager/objects/appUser.dart';
|
||||||
@@ -2,12 +2,12 @@ import 'dart:convert';
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihDropdownInput.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihDropdownInput.dart';
|
||||||
//import 'package:patient_manager/components/mihAppDrawer.dart';
|
//import 'package:patient_manager/MIH_Components/mihAppDrawer.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihErrorMessage.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihErrorMessage.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihSuccessMessage.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihSuccessMessage.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihTextInput.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihTextInput.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihButton.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihButton.dart';
|
||||||
import 'package:patient_manager/env/env.dart';
|
import 'package:patient_manager/env/env.dart';
|
||||||
import 'package:patient_manager/main.dart';
|
import 'package:patient_manager/main.dart';
|
||||||
import 'package:patient_manager/objects/appUser.dart';
|
import 'package:patient_manager/objects/appUser.dart';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihTextInput.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihTextInput.dart';
|
||||||
import 'package:patient_manager/main.dart';
|
import 'package:patient_manager/main.dart';
|
||||||
import 'package:patient_manager/objects/appUser.dart';
|
import 'package:patient_manager/objects/appUser.dart';
|
||||||
import 'package:patient_manager/objects/arguments.dart';
|
import 'package:patient_manager/objects/arguments.dart';
|
||||||
|
|||||||
@@ -2,11 +2,11 @@ import 'dart:convert';
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihDropdownInput.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihDropdownInput.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihErrorMessage.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihErrorMessage.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihSuccessMessage.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihSuccessMessage.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihTextInput.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihTextInput.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihButton.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihButton.dart';
|
||||||
import 'package:patient_manager/env/env.dart';
|
import 'package:patient_manager/env/env.dart';
|
||||||
import 'package:patient_manager/main.dart';
|
import 'package:patient_manager/main.dart';
|
||||||
import 'package:patient_manager/objects/appUser.dart';
|
import 'package:patient_manager/objects/appUser.dart';
|
||||||
|
|||||||
@@ -4,13 +4,13 @@ import 'dart:convert';
|
|||||||
import 'package:file_picker/file_picker.dart';
|
import 'package:file_picker/file_picker.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:patient_manager/MIH_Packages/patient_profile/builder/buildFilesList.dart';
|
import 'package:patient_manager/MIH_Packages/patient_profile/builder/buildFilesList.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihFileInput.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihFileInput.dart';
|
||||||
import 'package:patient_manager/components/medCertInput.dart';
|
import 'package:patient_manager/MIH_Components/medCertInput.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihLoadingCircle.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihLoadingCircle.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihErrorMessage.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihErrorMessage.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihSuccessMessage.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihSuccessMessage.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihButton.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihButton.dart';
|
||||||
import 'package:patient_manager/components/prescipInput.dart';
|
import 'package:patient_manager/MIH_Packages/patient_profile/prescipInput.dart';
|
||||||
import 'package:patient_manager/env/env.dart';
|
import 'package:patient_manager/env/env.dart';
|
||||||
import 'package:patient_manager/main.dart';
|
import 'package:patient_manager/main.dart';
|
||||||
import 'package:patient_manager/objects/appUser.dart';
|
import 'package:patient_manager/objects/appUser.dart';
|
||||||
|
|||||||
@@ -4,15 +4,15 @@ import 'package:intl/intl.dart';
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:patient_manager/components/builders/buildPatientList.dart';
|
import 'package:patient_manager/MIH_Packages/patient_profile/builder/buildPatientList.dart';
|
||||||
import 'package:patient_manager/components/builders/buildPatientQueueList.dart';
|
import 'package:patient_manager/MIH_Packages/patient_profile/builder/buildPatientQueueList.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihLoadingCircle.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihLoadingCircle.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihDateInput.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihDateInput.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihErrorMessage.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihErrorMessage.dart';
|
||||||
import 'package:patient_manager/objects/arguments.dart';
|
import 'package:patient_manager/objects/arguments.dart';
|
||||||
import 'package:patient_manager/objects/patientQueue.dart';
|
import 'package:patient_manager/objects/patientQueue.dart';
|
||||||
import 'package:supertokens_flutter/http.dart' as http;
|
import 'package:supertokens_flutter/http.dart' as http;
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihSearchInput.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihSearchInput.dart';
|
||||||
import 'package:patient_manager/env/env.dart';
|
import 'package:patient_manager/env/env.dart';
|
||||||
import 'package:patient_manager/main.dart';
|
import 'package:patient_manager/main.dart';
|
||||||
import 'package:patient_manager/objects/patients.dart';
|
import 'package:patient_manager/objects/patients.dart';
|
||||||
@@ -2,12 +2,12 @@ import 'dart:convert';
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:patient_manager/MIH_Packages/patient_profile/builder/buildNotesList.dart';
|
import 'package:patient_manager/MIH_Packages/patient_profile/builder/buildNotesList.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihLoadingCircle.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihLoadingCircle.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihErrorMessage.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihErrorMessage.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihMLTextInput.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihMLTextInput.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihSuccessMessage.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihSuccessMessage.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihTextInput.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihTextInput.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihButton.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihButton.dart';
|
||||||
import 'package:patient_manager/env/env.dart';
|
import 'package:patient_manager/env/env.dart';
|
||||||
import 'package:patient_manager/main.dart';
|
import 'package:patient_manager/main.dart';
|
||||||
import 'package:patient_manager/objects/appUser.dart';
|
import 'package:patient_manager/objects/appUser.dart';
|
||||||
|
|||||||
@@ -4,10 +4,10 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:patient_manager/MIH_Packages/patient_profile/patientDetails.dart';
|
import 'package:patient_manager/MIH_Packages/patient_profile/patientDetails.dart';
|
||||||
import 'package:patient_manager/MIH_Packages/patient_profile/patientFiles.dart';
|
import 'package:patient_manager/MIH_Packages/patient_profile/patientFiles.dart';
|
||||||
import 'package:patient_manager/MIH_Packages/patient_profile/patientNotes.dart';
|
import 'package:patient_manager/MIH_Packages/patient_profile/patientNotes.dart';
|
||||||
import 'package:patient_manager/components/MIH_Layout/MIH_Action.dart';
|
import 'package:patient_manager/MIH_Components/MIH_Layout/MIH_Action.dart';
|
||||||
import 'package:patient_manager/components/MIH_Layout/MIH_Body.dart';
|
import 'package:patient_manager/MIH_Components/MIH_Layout/MIH_Body.dart';
|
||||||
import 'package:patient_manager/components/MIH_Layout/MIH_Header.dart';
|
import 'package:patient_manager/MIH_Components/MIH_Layout/MIH_Header.dart';
|
||||||
import 'package:patient_manager/components/MIH_Layout/MIH_LayoutBuilder.dart';
|
import 'package:patient_manager/MIH_Components/MIH_Layout/MIH_LayoutBuilder.dart';
|
||||||
import 'package:patient_manager/env/env.dart';
|
import 'package:patient_manager/env/env.dart';
|
||||||
import 'package:patient_manager/main.dart';
|
import 'package:patient_manager/main.dart';
|
||||||
import 'package:patient_manager/objects/arguments.dart';
|
import 'package:patient_manager/objects/arguments.dart';
|
||||||
|
|||||||
@@ -2,13 +2,13 @@ import 'dart:convert';
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:patient_manager/components/medicineSearch.dart';
|
import 'package:patient_manager/MIH_Components/medicineSearch.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihDropdownInput.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihDropdownInput.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihLoadingCircle.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihLoadingCircle.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihErrorMessage.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihErrorMessage.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihSearchInput.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihSearchInput.dart';
|
||||||
import 'package:patient_manager/components/inputsAndButtons/mihButton.dart';
|
import 'package:patient_manager/MIH_Components/inputsAndButtons/mihButton.dart';
|
||||||
import 'package:patient_manager/components/popUpMessages/mihSuccessMessage.dart';
|
import 'package:patient_manager/MIH_Components/popUpMessages/mihSuccessMessage.dart';
|
||||||
import 'package:patient_manager/env/env.dart';
|
import 'package:patient_manager/env/env.dart';
|
||||||
import 'package:patient_manager/main.dart';
|
import 'package:patient_manager/main.dart';
|
||||||
import 'package:patient_manager/objects/appUser.dart';
|
import 'package:patient_manager/objects/appUser.dart';
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:patient_manager/main.dart';
|
|
||||||
|
|
||||||
class MIHAppBar extends StatefulWidget implements PreferredSizeWidget {
|
|
||||||
final String barTitle;
|
|
||||||
final ImageProvider<Object>? propicFile;
|
|
||||||
const MIHAppBar({
|
|
||||||
super.key,
|
|
||||||
required this.barTitle,
|
|
||||||
required this.propicFile,
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<MIHAppBar> createState() => _MIHAppBarState();
|
|
||||||
|
|
||||||
@override
|
|
||||||
// TODO: implement preferredSize
|
|
||||||
Size get preferredSize => const Size.fromHeight(60);
|
|
||||||
}
|
|
||||||
|
|
||||||
class _MIHAppBarState extends State<MIHAppBar> {
|
|
||||||
@override
|
|
||||||
void dispose() {
|
|
||||||
// TODO: implement dispose
|
|
||||||
super.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return AppBar(
|
|
||||||
elevation: 8,
|
|
||||||
shadowColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
|
||||||
// actions: [
|
|
||||||
// IconButton(
|
|
||||||
// icon: const Icon(
|
|
||||||
// Icons.home,
|
|
||||||
// size: 40,
|
|
||||||
// ),
|
|
||||||
// onPressed: () {
|
|
||||||
// // Navigator.pushNamedAndRemoveUntil(
|
|
||||||
// // context,
|
|
||||||
// // '/home',
|
|
||||||
// // );
|
|
||||||
// Navigator.of(context)
|
|
||||||
// .pushNamedAndRemoveUntil('/home', (route) => false);
|
|
||||||
// },
|
|
||||||
// )
|
|
||||||
// ],
|
|
||||||
title: Text(
|
|
||||||
widget.barTitle,
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
),
|
|
||||||
centerTitle: true,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -7,14 +7,14 @@ import 'package:patient_manager/MIH_Packages/about_MIH/MIH_About.dart';
|
|||||||
import 'package:patient_manager/MIH_Packages/authentication/forgotPassword.dart';
|
import 'package:patient_manager/MIH_Packages/authentication/forgotPassword.dart';
|
||||||
import 'package:patient_manager/MIH_Packages/authentication/resetPassword.dart';
|
import 'package:patient_manager/MIH_Packages/authentication/resetPassword.dart';
|
||||||
import 'package:patient_manager/MIH_Packages/patient_profile/fullScreenFile.dart';
|
import 'package:patient_manager/MIH_Packages/patient_profile/fullScreenFile.dart';
|
||||||
import 'package:patient_manager/MIH_Packages/manageBusinessProfile.dart';
|
import 'package:patient_manager/MIH_Packages/manage_business/manageBusinessProfile.dart';
|
||||||
import 'package:patient_manager/MIH_Packages/access_review/patientAccessReview.dart';
|
import 'package:patient_manager/MIH_Packages/access_review/patientAccessReview.dart';
|
||||||
import 'package:patient_manager/MIH_Packages/patient_profile/patientAdd.dart';
|
import 'package:patient_manager/MIH_Packages/patient_profile/patientAdd.dart';
|
||||||
import 'package:patient_manager/MIH_Packages/patient_profile/patientEdit.dart';
|
import 'package:patient_manager/MIH_Packages/patient_profile/patientEdit.dart';
|
||||||
import 'package:patient_manager/MIH_Packages/patientManager.dart';
|
import 'package:patient_manager/MIH_Packages/patient_profile/patientManager.dart';
|
||||||
import 'package:patient_manager/MIH_Packages/patient_profile/patientView.dart';
|
import 'package:patient_manager/MIH_Packages/patient_profile/patientView.dart';
|
||||||
import 'package:patient_manager/MIH_Packages/profileBusinessAdd.dart';
|
import 'package:patient_manager/MIH_Packages/manage_business/profileBusinessAdd.dart';
|
||||||
import 'package:patient_manager/MIH_Packages/profileBusinessUpdate.dart';
|
import 'package:patient_manager/MIH_Packages/manage_business/businessDetails.dart';
|
||||||
import 'package:patient_manager/MIH_Packages/mzansi_profile/profileUserUpdate.dart';
|
import 'package:patient_manager/MIH_Packages/mzansi_profile/profileUserUpdate.dart';
|
||||||
|
|
||||||
class RouteGenerator {
|
class RouteGenerator {
|
||||||
@@ -68,7 +68,7 @@ class RouteGenerator {
|
|||||||
if (args is BusinessArguments) {
|
if (args is BusinessArguments) {
|
||||||
return MaterialPageRoute(
|
return MaterialPageRoute(
|
||||||
settings: settings,
|
settings: settings,
|
||||||
builder: (_) => ProfileBusinessUpdate(
|
builder: (_) => BusinessDetails(
|
||||||
arguments: args,
|
arguments: args,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user