Merge pull request #242 from yaso-meth/QOL--New-User-UX-Enhancement

QOL--New-User-UX-Enhancement
This commit is contained in:
yaso-meth
2025-08-07 13:12:17 +02:00
committed by GitHub
31 changed files with 1677 additions and 519 deletions

View File

@@ -1,3 +1,4 @@
import 'package:country_code_picker/country_code_picker.dart';
import 'package:file_picker/file_picker.dart';
import 'package:flutter/material.dart';
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
@@ -185,6 +186,20 @@ class _PackageToolOneState extends State<PackageToolOne> {
],
),
const SizedBox(height: 20),
CountryCodePicker(
padding: EdgeInsetsGeometry.all(0),
onChanged: (selectedCode) {
debugPrint("Selected Country Code: $selectedCode");
},
initialSelection: '+27',
showDropDownButton: false,
pickerStyle: PickerStyle.bottomSheet,
dialogBackgroundColor:
MzansiInnovationHub.of(context)!.theme.primaryColor(),
barrierColor:
MzansiInnovationHub.of(context)!.theme.primaryColor(),
),
const SizedBox(height: 10),
Center(
child: MihButton(
onPressed: () {
@@ -305,7 +320,7 @@ class _PackageToolOneState extends State<PackageToolOne> {
"registration_no",
"logo_name",
"logo_path",
"contact_no",
"+27812345679",
"bus_email",
"app_id",
"gps_location",

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@@ -1,3 +1,4 @@
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
import 'package:mzansi_innovation_hub/mih_services/mih_validation_services.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_single_child_scroll.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_dropdwn_field.dart';
@@ -186,17 +187,77 @@ class _MihAccessRequestState extends State<MihAccessRequest> {
patientAccessList: accessRequestList,
);
} else {
return Center(
child: Text(
"No Request have been made.",
style: TextStyle(
fontSize: 25,
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const SizedBox(height: 50),
Icon(
MihIcons.accessControl,
size: 165,
color: MzansiInnovationHub.of(context)!
.theme
.messageTextColor()),
textAlign: TextAlign.center,
.secondaryColor(),
),
const SizedBox(height: 10),
Text(
"No Access has been granted to your MIH Profile",
textAlign: TextAlign.center,
overflow: TextOverflow.visible,
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
color: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
),
),
// const SizedBox(height: 10),
// Center(
// child: RichText(
// textAlign: TextAlign.center,
// text: TextSpan(
// style: TextStyle(
// fontSize: 20,
// fontWeight: FontWeight.normal,
// color: MzansiInnovationHub.of(context)!
// .theme
// .secondaryColor(),
// ),
// children: [
// TextSpan(text: "Press "),
// WidgetSpan(
// alignment: PlaceholderAlignment.middle,
// child: Icon(
// Icons.menu,
// size: 20,
// color: MzansiInnovationHub.of(context)!
// .theme
// .secondaryColor(),
// ),
// ),
// TextSpan(
// text: " to add your first loyalty card."),
// ],
// ),
// ),
// ),
],
),
);
// return Center(
// child: Text(
// "No Request have been made.",
// style: TextStyle(
// fontSize: 25,
// color: MzansiInnovationHub.of(context)!
// .theme
// .messageTextColor()),
// textAlign: TextAlign.center,
// ),
// );
}
// return Expanded(

View File

@@ -1,4 +1,5 @@
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
import 'package:mzansi_innovation_hub/mih_services/mih_alert_services.dart';
import 'package:mzansi_innovation_hub/mih_services/mih_mzansi_calendar_services.dart';
import 'package:mzansi_innovation_hub/mih_services/mih_validation_services.dart';
@@ -83,21 +84,79 @@ class _PatientAccessRequestState extends State<Appointments> {
}
return Expanded(
child: Padding(
padding: const EdgeInsets.only(top: 35.0),
child: Align(
alignment: Alignment.center,
child: Text(
"No Appointments for $selectedDay",
style: TextStyle(
fontSize: 25,
color: MzansiInnovationHub.of(context)!.theme.messageTextColor(),
padding: const EdgeInsets.symmetric(horizontal: 10.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const SizedBox(height: 50),
Icon(
MihIcons.calendar,
size: 165,
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
textAlign: TextAlign.center,
softWrap: true,
),
const SizedBox(height: 10),
Text(
"No Appointments for $selectedDay",
textAlign: TextAlign.center,
overflow: TextOverflow.visible,
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
),
const SizedBox(height: 10),
Center(
child: RichText(
textAlign: TextAlign.center,
text: TextSpan(
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.normal,
color:
MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
children: [
TextSpan(text: "Press "),
WidgetSpan(
alignment: PlaceholderAlignment.middle,
child: Icon(
Icons.menu,
size: 20,
color: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
),
),
TextSpan(
text:
" to add an appointment or select a different date"),
],
),
),
),
],
),
),
);
// return Expanded(
// child: Padding(
// padding: const EdgeInsets.only(top: 35.0),
// child: Align(
// alignment: Alignment.center,
// child: Text(
// "No Appointments for $selectedDay",
// style: TextStyle(
// fontSize: 25,
// color: MzansiInnovationHub.of(context)!.theme.messageTextColor(),
// ),
// textAlign: TextAlign.center,
// softWrap: true,
// ),
// ),
// ),
// );
}
void addAppointmentWindow(double width) {

View File

@@ -306,7 +306,8 @@ class _MihSignInState extends State<MihSignIn> {
passwordMode: true,
autofillHints: const [AutofillHints.password],
validator: (value) {
return MihValidationServices().validatePassword(value);
// return MihValidationServices().validatePassword(value);
return null;
},
),
const SizedBox(height: 10),

View File

@@ -230,29 +230,33 @@ class _MihBusinessHomeState extends State<MihBusinessHome>
// ),
// ),
// const SizedBox(height: 20),
Padding(
padding: EdgeInsets.symmetric(horizontal: width / 20),
child: MihSearchBar(
controller: searchController,
hintText: "Ask Mzansi",
prefixIcon: Icons.search,
prefixAltIcon: MihIcons.mzansiAi,
fillColor:
MzansiInnovationHub.of(context)!.theme.secondaryColor(),
hintColor: MzansiInnovationHub.of(context)!.theme.primaryColor(),
onPrefixIconTap: () {
Navigator.of(context).pushNamed(
'/mzansi-ai',
arguments: MzansiAiArguments(
widget.signedInUser,
searchController.text.isEmpty
? null
: searchController.text,
),
);
searchController.clear();
},
searchFocusNode: _searchFocusNode,
Visibility(
visible: !widget.isBusinessUserNew,
child: Padding(
padding: EdgeInsets.symmetric(horizontal: width / 20),
child: MihSearchBar(
controller: searchController,
hintText: "Ask Mzansi",
prefixIcon: Icons.search,
prefixAltIcon: MihIcons.mzansiAi,
fillColor:
MzansiInnovationHub.of(context)!.theme.secondaryColor(),
hintColor:
MzansiInnovationHub.of(context)!.theme.primaryColor(),
onPrefixIconTap: () {
Navigator.of(context).pushNamed(
'/mzansi-ai',
arguments: MzansiAiArguments(
widget.signedInUser,
searchController.text.isEmpty
? null
: searchController.text,
),
);
searchController.clear();
},
searchFocusNode: _searchFocusNode,
),
),
),
const SizedBox(height: 10),

View File

@@ -213,6 +213,18 @@ class _MihPersonalHomeState extends State<MihPersonalHome>
}
}
void autoNavToProfile() {
WidgetsBinding.instance.addPostFrameCallback((_) {
Navigator.of(context).pushNamed(
'/mzansi-profile',
arguments: AppProfileUpdateArguments(
widget.signedInUser,
widget.propicFile,
),
);
});
}
@override
void dispose() {
super.dispose();
@@ -229,17 +241,11 @@ class _MihPersonalHomeState extends State<MihPersonalHome>
searchController.addListener(searchPackage);
if (widget.isUserNew) {
personalPackagesMap = setNerUserPersonalPackage();
autoNavToProfile();
} else {
personalPackagesMap = setPersonalPackagesMap();
}
searchPackage();
//Scrolling Banner message
// _marqueeController = AnimationController(
// vsync: this,
// duration: const Duration(seconds: 12),
// );
// _scrollController = ScrollController();
// WidgetsBinding.instance.addPostFrameCallback((_) => _startMarquee());
}
@override
@@ -275,29 +281,33 @@ class _MihPersonalHomeState extends State<MihPersonalHome>
// ),
// ),
// const SizedBox(height: 20),
Padding(
padding: EdgeInsets.symmetric(horizontal: width / 20),
child: MihSearchBar(
controller: searchController,
hintText: "Ask Mzansi",
prefixIcon: Icons.search,
prefixAltIcon: MihIcons.mzansiAi,
fillColor:
MzansiInnovationHub.of(context)!.theme.secondaryColor(),
hintColor: MzansiInnovationHub.of(context)!.theme.primaryColor(),
onPrefixIconTap: () {
Navigator.of(context).pushNamed(
'/mzansi-ai',
arguments: MzansiAiArguments(
widget.signedInUser,
searchController.text.isEmpty
? null
: searchController.text,
),
);
searchController.clear();
},
searchFocusNode: _searchFocusNode,
Visibility(
visible: !widget.isUserNew,
child: Padding(
padding: EdgeInsets.symmetric(horizontal: width / 20),
child: MihSearchBar(
controller: searchController,
hintText: "Ask Mzansi",
prefixIcon: Icons.search,
prefixAltIcon: MihIcons.mzansiAi,
fillColor:
MzansiInnovationHub.of(context)!.theme.secondaryColor(),
hintColor:
MzansiInnovationHub.of(context)!.theme.primaryColor(),
onPrefixIconTap: () {
Navigator.of(context).pushNamed(
'/mzansi-ai',
arguments: MzansiAiArguments(
widget.signedInUser,
searchController.text.isEmpty
? null
: searchController.text,
),
);
searchController.clear();
},
searchFocusNode: _searchFocusNode,
),
),
),
const SizedBox(height: 20),

View File

@@ -2,6 +2,7 @@ import 'dart:async';
import 'dart:convert';
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
import 'package:mzansi_innovation_hub/main.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
import 'package:mzansi_innovation_hub/mih_services/mih_validation_services.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_dropdwn_field.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_numeric_stepper.dart';
@@ -653,6 +654,7 @@ class _AiChatState extends State<AiChat> {
},
child: Chat(
messages: _messages,
emptyState: noMessagescDisplay(),
// onAttachmentPressed: _handleAttachmentPressed,
// onMessageTap: _handleMessageTap,
// onPreviewDataFetched: _handlePreviewDataFetched,
@@ -794,4 +796,63 @@ class _AiChatState extends State<AiChat> {
],
);
}
Widget? noMessagescDisplay() {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const SizedBox(height: 50),
Icon(
MihIcons.mzansiAi,
size: 165,
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
const SizedBox(height: 10),
Text(
"Mzansi AI is here to help",
textAlign: TextAlign.center,
overflow: TextOverflow.visible,
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
),
const SizedBox(height: 10),
Center(
child: RichText(
textAlign: TextAlign.center,
text: TextSpan(
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.normal,
color:
MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
children: [
TextSpan(
text:
"Send us a message and we'll try our best to assist you"),
// WidgetSpan(
// alignment: PlaceholderAlignment.middle,
// child: Icon(
// Icons.menu,
// size: 20,
// color: MzansiInnovationHub.of(context)!
// .theme
// .secondaryColor(),
// ),
// ),
// TextSpan(text: " to add your first loyalty card."),
],
),
),
),
],
),
);
}
}

View File

@@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
import 'package:mzansi_innovation_hub/main.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_objects/bookmarked_business.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_objects/business.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tool_body.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_search_bar.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_single_child_scroll.dart';
@@ -143,55 +144,23 @@ class _MihFavouriteBusinessesState extends State<MihFavouriteBusinesses> {
children: [
const SizedBox(height: 50),
Icon(
Icons
.search_off_rounded, // A different icon for "no results"
size: 150,
MihIcons.iDontKnow,
size: 165,
color: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
),
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10.0),
child: SizedBox(
width: 500,
child: Text(
"No businesses found for '${businessSearchController.text}'", // Specific message for no search results
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
),
),
),
),
],
);
} else if (businesses.isEmpty) {
// Initial empty state
return Column(
children: [
const SizedBox(height: 50),
Icon(
Icons.business_center_rounded,
size: 150,
color: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
),
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10.0),
child: SizedBox(
width: 500,
child: Text(
"No favourites yet, use Mzansi Search to find and bookmark businesses you like",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
),
),
const SizedBox(height: 10),
Text(
"Let's Try Refining Your Search",
textAlign: TextAlign.center,
overflow: TextOverflow.visible,
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
color: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
),
),
],
@@ -206,31 +175,68 @@ class _MihFavouriteBusinessesState extends State<MihFavouriteBusinesses> {
);
} else {
// This block handles the case where there are no bookmarked businesses initially
return Column(
children: [
const SizedBox(height: 50),
Icon(
Icons.business_center_rounded,
size: 150,
color: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
child: SizedBox(
width: 500,
child: Text(
"No favourites yet, use Mzansi Search to find and bookmark businesses you like",
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const SizedBox(height: 50),
Icon(
MihIcons.businessProfile,
size: 165,
color: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
),
const SizedBox(height: 10),
Text(
"No Businesses added to your Favourites",
textAlign: TextAlign.center,
overflow: TextOverflow.visible,
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
color: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
),
),
const SizedBox(height: 10),
Center(
child: RichText(
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
text: TextSpan(
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.normal,
color: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
),
children: [
TextSpan(text: "Use the Mzansi Search"),
// WidgetSpan(
// alignment:
// PlaceholderAlignment.middle,
// child: Icon(
// Icons.search,
// size: 20,
// color:
// MzansiInnovationHub.of(context)!
// .theme
// .secondaryColor(),
// ),
// ),
TextSpan(
text: " to find Businesses of Mzansi"),
],
),
),
),
),
],
],
),
);
}
} else if (snapshot.hasError) {

View File

@@ -211,7 +211,7 @@ class _MihSearchMzansiState extends State<MihSearchMzansi> {
Expanded(
child: MihDropdownField(
controller: businessTypeController,
hintText: "Business Type Filter",
hintText: "Business Type",
dropdownOptions: options,
requiredText: true,
editable: true,
@@ -282,31 +282,89 @@ class _MihSearchMzansiState extends State<MihSearchMzansi> {
],
);
} else if (!snapshot.hasData) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const SizedBox(height: 50),
Icon(
MihIcons.personalProfile,
size: 165,
color:
MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
const SizedBox(height: 10),
Text(
"People Of Mzansi!",
textAlign: TextAlign.center,
overflow: TextOverflow.visible,
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const SizedBox(height: 50),
Icon(
MihIcons.personalProfile,
size: 165,
color:
MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
),
],
const SizedBox(height: 10),
Text(
"Search for People Of Mzansi!",
textAlign: TextAlign.center,
overflow: TextOverflow.visible,
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
color: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
),
),
const SizedBox(height: 10),
Center(
child: RichText(
textAlign: TextAlign.center,
text: TextSpan(
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.normal,
color: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
),
children: [
TextSpan(text: "Press "),
WidgetSpan(
alignment: PlaceholderAlignment.middle,
child: Icon(
Icons.swap_horiz_rounded,
size: 20,
color: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
),
),
TextSpan(text: " to search for Businesses of Mzansi"),
],
),
),
),
],
),
);
// return Column(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// const SizedBox(height: 50),
// Icon(
// MihIcons.personalProfile,
// size: 165,
// color:
// MzansiInnovationHub.of(context)!.theme.secondaryColor(),
// ),
// const SizedBox(height: 10),
// Text(
// "People Of Mzansi!",
// textAlign: TextAlign.center,
// overflow: TextOverflow.visible,
// style: TextStyle(
// fontSize: 25,
// fontWeight: FontWeight.bold,
// color:
// MzansiInnovationHub.of(context)!.theme.secondaryColor(),
// ),
// ),
// ],
// );
} else if (snapshot.connectionState == ConnectionState.done &&
snapshot.hasData &&
snapshot.requireData!.isEmpty) {
@@ -400,30 +458,92 @@ class _MihSearchMzansiState extends State<MihSearchMzansi> {
],
);
} else if (!snapshot.hasData) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const SizedBox(height: 50),
Icon(
MihIcons.businessProfile,
size: 165,
color:
MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
const SizedBox(height: 10),
Text(
"Businesses Of Mzansi!",
textAlign: TextAlign.center,
overflow: TextOverflow.visible,
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const SizedBox(height: 50),
Icon(
MihIcons.businessProfile,
size: 165,
color:
MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
),
],
const SizedBox(height: 10),
Text(
"Search for Business Of Mzansi!",
textAlign: TextAlign.center,
overflow: TextOverflow.visible,
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
color: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
),
),
const SizedBox(height: 10),
Center(
child: RichText(
textAlign: TextAlign.center,
text: TextSpan(
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.normal,
color: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
),
children: [
TextSpan(text: "Press "),
WidgetSpan(
alignment: PlaceholderAlignment.middle,
child: Icon(
Icons.swap_horiz_rounded,
size: 20,
color: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
),
),
TextSpan(text: " to search for People of Mzansi"),
],
),
),
),
const SizedBox(height: 10),
Center(
child: RichText(
textAlign: TextAlign.center,
text: TextSpan(
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.normal,
color: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
),
children: [
TextSpan(text: "Press "),
WidgetSpan(
alignment: PlaceholderAlignment.middle,
child: Icon(
Icons.filter_list_rounded,
size: 20,
color: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
),
),
TextSpan(text: " to filter business types"),
],
),
),
),
],
),
);
} else {
return Center(

View File

@@ -40,7 +40,8 @@ class _MihBusinessCardState extends State<MihBusinessCard> {
}
Future<void> _makePhoneCall(String phoneNumber) async {
final Uri url = Uri(scheme: 'tel', path: phoneNumber);
String formattedNumber = phoneNumber.replaceAll("-", "");
final Uri url = Uri(scheme: 'tel', path: formattedNumber);
if (await canLaunchUrl(url)) {
await launchUrl(url);
} else {

View File

@@ -29,9 +29,9 @@ class _MzansiSetupBusinessProfileTileState
arguments: widget.signedInUser,
);
},
appName: "Setup Business",
appName: "Set Up Business",
appIcon: Icon(
MihIcons.profileSetup,
MihIcons.businessSetup,
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
iconSize: widget.packageSize,

View File

@@ -1,8 +1,7 @@
import 'package:country_code_picker/country_code_picker.dart';
import 'package:file_picker/file_picker.dart';
import 'package:flutter/material.dart';
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
import 'package:mzansi_innovation_hub/main.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_floating_menu.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_loading_circle.dart';
import 'package:mzansi_innovation_hub/mih_packages/mzansi_profile/business_profile/components/mih_business_info_card.dart';
@@ -44,6 +43,7 @@ class _MihBusinessDetailsState extends State<MihBusinessDetails> {
final typeController = TextEditingController();
final practiceNoController = TextEditingController();
final vatNoController = TextEditingController();
final countryCodeController = TextEditingController();
final contactController = TextEditingController();
final emailController = TextEditingController();
final locationController = TextEditingController();
@@ -65,7 +65,8 @@ class _MihBusinessDetailsState extends State<MihBusinessDetails> {
practiceNoController.text,
vatNoController.text,
emailController.text,
contactController.text,
getNumberWithCountryCode(),
// contactController.text,
locationController.text,
fileNameController.text,
websiteController.text,
@@ -196,6 +197,34 @@ class _MihBusinessDetailsState extends State<MihBusinessDetails> {
}
}
void setContactNumberControllers() {
if (widget.arguments.business!.contact_no[0] == "+") {
List<String> contactDetails =
widget.arguments.business!.contact_no.split("-");
setState(() {
countryCodeController.text = contactDetails[0];
contactController.text = contactDetails[1];
});
} else {
setState(() {
countryCodeController.text = "+27";
contactController.text = widget.arguments.business!.contact_no;
});
}
}
String getNumberWithCountryCode() {
String numberWithoutBeginingZero = "";
if (contactController.text[0] == "0") {
numberWithoutBeginingZero = contactController.text
.replaceAll(" ", "")
.substring(1, contactController.text.length);
} else {
numberWithoutBeginingZero = contactController.text.replaceAll("-", " ");
}
return "${countryCodeController.text}-$numberWithoutBeginingZero";
}
void editBizProfileWindow(double width) {
showDialog(
context: context,
@@ -204,6 +233,7 @@ class _MihBusinessDetailsState extends State<MihBusinessDetails> {
windowTitle: 'Edit Profile',
onWindowTapClose: () {
Navigator.of(context).pop();
resetControllers();
},
windowBody: MihSingleChildScroll(
child: Padding(
@@ -284,17 +314,6 @@ class _MihBusinessDetailsState extends State<MihBusinessDetails> {
return MihValidationServices().isEmpty(value);
},
),
// MihDropdownField(
// controller: typeController,
// hintText: "Business Type",
// dropdownOptions: const ["Doctors Office", "Other"],
// editable: true,
// enableSearch: true,
// validator: (value) {
// return MihValidationServices().isEmpty(value);
// },
// requiredText: true,
// ),
const SizedBox(height: 10),
MihTextFormField(
fillColor: MzansiInnovationHub.of(context)!
@@ -313,37 +332,61 @@ class _MihBusinessDetailsState extends State<MihBusinessDetails> {
},
),
const SizedBox(height: 10),
MihTextFormField(
fillColor: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
inputColor: MzansiInnovationHub.of(context)!
.theme
.primaryColor(),
controller: contactController,
multiLineInput: false,
requiredText: true,
hintText: "Contact Number",
validator: (value) {
return MihValidationServices().isEmpty(value);
},
Container(
width: 300,
alignment: Alignment.topLeft,
child: const Text(
"Contact Number:",
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
),
),
),
const SizedBox(height: 10),
MihTextFormField(
fillColor: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
inputColor: MzansiInnovationHub.of(context)!
.theme
.primaryColor(),
controller: websiteController,
multiLineInput: false,
requiredText: false,
hintText: "Business Website",
validator: (value) {
return MihValidationServices()
.validateWebsite(value, false);
},
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
CountryCodePicker(
padding: EdgeInsetsGeometry.all(0),
onChanged: (selectedCode) {
setState(() {
countryCodeController.text =
selectedCode.toString();
});
debugPrint(
"Selected Country Code: ${countryCodeController.text}");
},
initialSelection: countryCodeController.text,
showDropDownButton: false,
pickerStyle: PickerStyle.bottomSheet,
dialogBackgroundColor:
MzansiInnovationHub.of(context)!
.theme
.primaryColor(),
barrierColor: MzansiInnovationHub.of(context)!
.theme
.primaryColor(),
),
Expanded(
child: MihTextFormField(
fillColor: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
inputColor: MzansiInnovationHub.of(context)!
.theme
.primaryColor(),
controller: contactController,
numberMode: true,
multiLineInput: false,
requiredText: true,
hintText: null,
validator: (value) {
return MihValidationServices()
.isEmpty(value);
},
),
),
],
),
const SizedBox(height: 10),
MihTextFormField(
@@ -394,6 +437,23 @@ class _MihBusinessDetailsState extends State<MihBusinessDetails> {
),
),
const SizedBox(height: 10.0),
MihTextFormField(
fillColor: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
inputColor: MzansiInnovationHub.of(context)!
.theme
.primaryColor(),
controller: websiteController,
multiLineInput: false,
requiredText: false,
hintText: "Business Website",
validator: (value) {
return MihValidationServices()
.validateWebsite(value, false);
},
),
const SizedBox(height: 10),
MihTextFormField(
fillColor: MzansiInnovationHub.of(context)!
.theme
@@ -403,10 +463,11 @@ class _MihBusinessDetailsState extends State<MihBusinessDetails> {
.primaryColor(),
controller: regController,
multiLineInput: false,
requiredText: true,
requiredText: false,
hintText: "Registration No.",
validator: (value) {
return MihValidationServices().isEmpty(value);
// return MihValidationServices().isEmpty(value);
return null;
},
),
const SizedBox(height: 10),
@@ -419,8 +480,7 @@ class _MihBusinessDetailsState extends State<MihBusinessDetails> {
.primaryColor(),
controller: practiceNoController,
multiLineInput: false,
requiredText:
typeController.text == "Doctors Office",
requiredText: false,
hintText: "Practice Number",
validator: (validateValue) {
return null;
@@ -436,10 +496,11 @@ class _MihBusinessDetailsState extends State<MihBusinessDetails> {
.primaryColor(),
controller: vatNoController,
multiLineInput: false,
requiredText: true,
requiredText: false,
hintText: "VAT Number",
validator: (value) {
return MihValidationServices().isEmpty(value);
// return MihValidationServices().isEmpty(value);
return null;
},
),
const SizedBox(height: 10),
@@ -547,6 +608,34 @@ class _MihBusinessDetailsState extends State<MihBusinessDetails> {
}
}
void resetControllers() {
setState(() {
fileNameController.text =
widget.arguments.business!.logo_path.split("/").last;
regController.text = widget.arguments.business!.registration_no;
nameController.text = widget.arguments.business!.Name;
typeController.text = widget.arguments.business!.type;
practiceNoController.text = widget.arguments.business!.practice_no;
vatNoController.text = widget.arguments.business!.vat_no;
emailController.text = widget.arguments.business!.bus_email;
locationController.text = widget.arguments.business!.gps_location;
websiteController.text = widget.arguments.business!.website;
ratingController.text = widget.arguments.business!.rating;
missionVisionController.text = widget.arguments.business!.mission_vision;
});
setContactNumberControllers();
if (AppEnviroment.getEnv() == "Prod") {
env = "Prod";
} else {
env = "Dev";
}
missionVisionController.addListener(() {
setState(() {
_counter.value = missionVisionController.text.characters.length;
});
});
}
@override
void dispose() {
super.dispose();
@@ -568,31 +657,7 @@ class _MihBusinessDetailsState extends State<MihBusinessDetails> {
@override
void initState() {
super.initState();
setState(() {
fileNameController.text =
widget.arguments.business!.logo_path.split("/").last;
regController.text = widget.arguments.business!.registration_no;
nameController.text = widget.arguments.business!.Name;
typeController.text = widget.arguments.business!.type;
practiceNoController.text = widget.arguments.business!.practice_no;
vatNoController.text = widget.arguments.business!.vat_no;
contactController.text = widget.arguments.business!.contact_no;
emailController.text = widget.arguments.business!.bus_email;
locationController.text = widget.arguments.business!.gps_location;
websiteController.text = widget.arguments.business!.website;
ratingController.text = widget.arguments.business!.rating;
missionVisionController.text = widget.arguments.business!.mission_vision;
});
if (AppEnviroment.getEnv() == "Prod") {
env = "Prod";
} else {
env = "Dev";
}
missionVisionController.addListener(() {
setState(() {
_counter.value = missionVisionController.text.characters.length;
});
});
resetControllers();
}
@override
@@ -733,33 +798,33 @@ class _MihBusinessDetailsState extends State<MihBusinessDetails> {
),
),
),
Positioned(
right: 5,
bottom: 10,
child: MihFloatingMenu(
animatedIcon: AnimatedIcons.menu_close,
children: [
SpeedDialChild(
child: Icon(
Icons.edit,
color: MzansiInnovationHub.of(context)!.theme.primaryColor(),
),
label: "Edit Profile",
labelBackgroundColor:
MzansiInnovationHub.of(context)!.theme.successColor(),
labelStyle: TextStyle(
color: MzansiInnovationHub.of(context)!.theme.primaryColor(),
fontWeight: FontWeight.bold,
),
backgroundColor:
MzansiInnovationHub.of(context)!.theme.successColor(),
onTap: () {
editBizProfileWindow(width);
},
)
],
),
),
// Positioned(
// right: 5,
// bottom: 10,
// child: MihFloatingMenu(
// animatedIcon: AnimatedIcons.menu_close,
// children: [
// SpeedDialChild(
// child: Icon(
// Icons.edit,
// color: MzansiInnovationHub.of(context)!.theme.primaryColor(),
// ),
// label: "Edit Profile",
// labelBackgroundColor:
// MzansiInnovationHub.of(context)!.theme.successColor(),
// labelStyle: TextStyle(
// color: MzansiInnovationHub.of(context)!.theme.primaryColor(),
// fontWeight: FontWeight.bold,
// ),
// backgroundColor:
// MzansiInnovationHub.of(context)!.theme.successColor(),
// onTap: () {
// editBizProfileWindow(width);
// },
// )
// ],
// ),
// ),
],
);
}

View File

@@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
import 'package:mzansi_innovation_hub/main.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_objects/business.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_objects/business_review.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_loading_circle.dart';
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
import 'package:mzansi_innovation_hub/mih_packages/mzansi_profile/business_profile/components/mih_review_business_window.dart';
@@ -60,25 +61,99 @@ class _MihBusinessReviewsState extends State<MihBusinessReviews> {
List<BusinessReview> reviews = asyncSnapshot.data!;
print("Reviews: ${reviews.length}");
if (reviews.isEmpty) {
return Column(
children: [
const SizedBox(height: 50),
Icon(
Icons.star_rate_rounded,
size: 150,
color:
MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
Text(
"No reviews yet, be the first the review\n${widget.business.Name}",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
child: Column(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
children: [
const SizedBox(height: 50),
Stack(
alignment: AlignmentDirectional.center,
children: [
Padding(
padding: const EdgeInsets.only(top: 10.0),
child: Icon(
MihIcons.mihRing,
size: 165,
color: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
),
),
Icon(
Icons.star_rate_rounded,
size: 150,
color: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
),
],
),
),
],
const SizedBox(height: 10),
Text(
"No reviews yet, be the first the review ${widget.business.Name}",
textAlign: TextAlign.center,
overflow: TextOverflow.visible,
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
color: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
),
),
// const SizedBox(height: 10),
// Center(
// child: RichText(
// textAlign: TextAlign.center,
// text: TextSpan(
// style: TextStyle(
// fontSize: 20,
// fontWeight: FontWeight.normal,
// color: MzansiInnovationHub.of(context)!
// .theme
// .secondaryColor(),
// ),
// children: [
// TextSpan(text: "Press "),
// WidgetSpan(
// alignment: PlaceholderAlignment.middle,
// child: Icon(
// Icons.menu,
// size: 20,
// color: MzansiInnovationHub.of(context)!
// .theme
// .secondaryColor(),
// ),
// ),
// TextSpan(text: " to add your first loyalty card"),
// ],
// ),
// ),
// ),
],
),
);
// return Column(
// children: [
// const SizedBox(height: 50),
// Icon(
// Icons.star_rate_rounded,
// size: 150,
// color:
// MzansiInnovationHub.of(context)!.theme.secondaryColor(),
// ),
// Text(
// "No reviews yet, be the first the review\n${widget.business.Name}",
// textAlign: TextAlign.center,
// style: TextStyle(
// fontSize: 18,
// fontWeight: FontWeight.bold,
// ),
// ),
// ],
// );
} else {
int descriptionDisplayCOunt = 75;
return ListView.separated(

View File

@@ -1,4 +1,5 @@
import 'package:mzansi_innovation_hub/main.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_single_child_scroll.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tool_body.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_search_bar.dart';
@@ -24,7 +25,7 @@ class _MihBusinessUserSearchState extends State<MihBusinessUserSearch> {
final TextEditingController searchController = TextEditingController();
late Future<List<AppUser>> userSearchResults;
final FocusNode _searchFocusNode = FocusNode();
bool hasSearchedBefore = false;
String userSearch = "";
String errorCode = "";
String errorBody = "";
@@ -49,6 +50,7 @@ class _MihBusinessUserSearchState extends State<MihBusinessUserSearch> {
if (searchController.text != "") {
setState(() {
userSearch = searchController.text;
hasSearchedBefore = true;
userSearchResults = fetchUsers(userSearch);
});
}
@@ -61,15 +63,94 @@ class _MihBusinessUserSearchState extends State<MihBusinessUserSearch> {
arguments: widget.arguments,
);
}
return Center(
child: Text(
"Enter Username or Email to search",
style: TextStyle(
fontSize: 25,
color: MzansiInnovationHub.of(context)!.theme.messageTextColor()),
textAlign: TextAlign.center,
),
);
if (hasSearchedBefore && userSearch.isNotEmpty) {
return Column(
children: [
const SizedBox(height: 50),
Icon(
MihIcons.iDontKnow,
size: 165,
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
const SizedBox(height: 10),
Text(
"Let's Try Refining Your Search",
textAlign: TextAlign.center,
overflow: TextOverflow.visible,
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
),
],
);
} else {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const SizedBox(height: 50),
Icon(
MihIcons.personalProfile,
size: 165,
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
const SizedBox(height: 10),
Text(
"Search for a Member of Mzansi to add to your team",
textAlign: TextAlign.center,
overflow: TextOverflow.visible,
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
),
const SizedBox(height: 10),
Center(
child: RichText(
textAlign: TextAlign.center,
text: TextSpan(
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.normal,
color:
MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
children: [
TextSpan(
text: "You can search using their Username or Email"),
// WidgetSpan(
// alignment: PlaceholderAlignment.middle,
// child: Icon(
// Icons.menu,
// size: 20,
// color: MzansiInnovationHub.of(context)!
// .theme
// .secondaryColor(),
// ),
// ),
// TextSpan(text: " to add your first loyalty card"),
],
),
),
),
],
),
);
}
// return Center(
// child: Text(
// "Enter Username or Email to search",
// style: TextStyle(
// fontSize: 25,
// color: MzansiInnovationHub.of(context)!.theme.messageTextColor()),
// textAlign: TextAlign.center,
// ),
// );
}
@override

View File

@@ -7,7 +7,6 @@ import 'package:mzansi_innovation_hub/mih_services/mih_my_business_user_services
import 'package:mzansi_innovation_hub/mih_services/mih_validation_services.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_single_child_scroll.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_dropdwn_field.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_form.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tool_body.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_alert.dart';
@@ -39,7 +38,6 @@ class _MihMyBusinessUserState extends State<MihMyBusinessUser> {
PlatformFile? userPicFile;
PlatformFile? userSignatureFile;
final fileNameController = TextEditingController();
final titleDropdownController = TextEditingController();
final titleTextController = TextEditingController();
final fnameController = TextEditingController();
final lnameController = TextEditingController();
@@ -49,7 +47,7 @@ class _MihMyBusinessUserState extends State<MihMyBusinessUser> {
late String env;
bool isFormFilled() {
if (titleDropdownController.text.isEmpty) {
if (titleTextController.text.isEmpty) {
return false;
} else {
return true;
@@ -93,7 +91,7 @@ class _MihMyBusinessUserState extends State<MihMyBusinessUser> {
int statusCode = await MihMyBusinessUserServices().updateBusinessUser(
widget.arguments.signedInUser.app_id,
widget.arguments.businessUser!.business_id,
titleDropdownController.text,
titleTextController.text,
accessController.text,
signtureController.text,
context,
@@ -171,7 +169,6 @@ class _MihMyBusinessUserState extends State<MihMyBusinessUser> {
void dispose() {
super.dispose();
fileNameController.dispose();
titleDropdownController.dispose();
titleTextController.dispose();
fnameController.dispose();
lnameController.dispose();
@@ -189,7 +186,6 @@ class _MihMyBusinessUserState extends State<MihMyBusinessUser> {
widget.arguments.signedInUser.pro_pic_path.split("/").last;
signtureController.text =
widget.arguments.businessUser!.sig_path.split("/").last;
titleDropdownController.text = widget.arguments.businessUser!.title;
titleTextController.text = widget.arguments.businessUser!.title;
fnameController.text = widget.arguments.signedInUser.fname;
lnameController.text = widget.arguments.signedInUser.lname;
@@ -252,18 +248,6 @@ class _MihMyBusinessUserState extends State<MihMyBusinessUser> {
),
),
const SizedBox(height: 20),
MihDropdownField(
controller: titleDropdownController,
hintText: "Title",
dropdownOptions: const ["Doctor", "Assistant", "Other"],
editable: true,
enableSearch: true,
validator: (value) {
return MihValidationServices().isEmpty(value);
},
requiredText: true,
),
const SizedBox(height: 10),
MihTextFormField(
fillColor:
MzansiInnovationHub.of(context)!.theme.secondaryColor(),
@@ -272,7 +256,8 @@ class _MihMyBusinessUserState extends State<MihMyBusinessUser> {
controller: titleTextController,
multiLineInput: false,
requiredText: true,
hintText: "Other Title",
readOnly: false,
hintText: "Title",
validator: (value) {
return MihValidationServices().isEmpty(value);
},
@@ -329,7 +314,7 @@ class _MihMyBusinessUserState extends State<MihMyBusinessUser> {
child: const Text(
"Signature:",
style: TextStyle(
fontSize: 15,
fontSize: 18,
fontWeight: FontWeight.bold,
),
),

View File

@@ -1,5 +1,6 @@
import 'dart:convert';
import 'package:country_code_picker/country_code_picker.dart';
import 'package:http/http.dart';
import 'package:mzansi_innovation_hub/main.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_loading_circle.dart';
@@ -14,7 +15,6 @@ import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_body.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_header.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_layout_builder.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_dropdwn_field.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_form.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_text_form_field.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_error_message.dart';
@@ -52,6 +52,7 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
final titleController = TextEditingController();
final signtureController = TextEditingController();
final accessController = TextEditingController();
final countryCodeController = TextEditingController();
final contactController = TextEditingController();
final emailController = TextEditingController();
final locationController = TextEditingController();
@@ -125,7 +126,8 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
practiceNoController.text,
vatNoController.text,
emailController.text,
contactController.text,
getNumberWithCountryCode(),
// "${countryCodeController.text}-${contactController.text}",
locationController.text,
logonameController.text,
websiteController.text,
@@ -142,6 +144,18 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
}
}
String getNumberWithCountryCode() {
String numberWithoutBeginingZero = "";
if (contactController.text[0] == "0") {
numberWithoutBeginingZero = contactController.text
.replaceAll(" ", "")
.substring(1, contactController.text.length);
} else {
numberWithoutBeginingZero = contactController.text.replaceAll("-", " ");
}
return "${countryCodeController.text}-$numberWithoutBeginingZero";
}
void internetConnectionPopUp() {
showDialog(
context: context,
@@ -320,17 +334,6 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
return MihValidationServices().isEmpty(value);
},
),
// MihDropdownField(
// controller: typeController,
// hintText: "Business Type",
// dropdownOptions: const ["Doctors Office", "Other"],
// editable: true,
// enableSearch: true,
// validator: (value) {
// return MihValidationServices().isEmpty(value);
// },
// requiredText: true,
// ),
const SizedBox(height: 10.0),
MihTextFormField(
fillColor: MzansiInnovationHub.of(context)!
@@ -348,37 +351,60 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
},
),
const SizedBox(height: 10.0),
MihTextFormField(
fillColor: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
inputColor: MzansiInnovationHub.of(context)!
.theme
.primaryColor(),
controller: contactController,
multiLineInput: false,
requiredText: true,
hintText: "Contact Number",
validator: (value) {
return MihValidationServices().isEmpty(value);
},
Container(
width: 300,
alignment: Alignment.topLeft,
child: const Text(
"Contact Number:",
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
),
),
),
const SizedBox(height: 10.0),
MihTextFormField(
fillColor: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
inputColor: MzansiInnovationHub.of(context)!
.theme
.primaryColor(),
controller: websiteController,
multiLineInput: false,
requiredText: false,
hintText: "Business Website",
validator: (value) {
return MihValidationServices()
.validateWebsite(value, false);
},
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
CountryCodePicker(
padding: EdgeInsetsGeometry.all(0),
onChanged: (selectedCode) {
setState(() {
countryCodeController.text =
selectedCode.toString();
});
debugPrint(
"Selected Country Code: ${countryCodeController.text}");
},
initialSelection: countryCodeController.text,
showDropDownButton: false,
pickerStyle: PickerStyle.bottomSheet,
dialogBackgroundColor:
MzansiInnovationHub.of(context)!
.theme
.primaryColor(),
barrierColor: MzansiInnovationHub.of(context)!
.theme
.primaryColor(),
),
Expanded(
child: MihTextFormField(
fillColor: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
inputColor: MzansiInnovationHub.of(context)!
.theme
.primaryColor(),
controller: contactController,
numberMode: true,
multiLineInput: false,
requiredText: true,
hintText: null,
validator: (value) {
return MihValidationServices().isEmpty(value);
},
),
),
],
),
const SizedBox(height: 10.0),
MihTextFormField(
@@ -429,6 +455,23 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
),
),
const SizedBox(height: 10.0),
MihTextFormField(
fillColor: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
inputColor: MzansiInnovationHub.of(context)!
.theme
.primaryColor(),
controller: websiteController,
multiLineInput: false,
requiredText: false,
hintText: "Business Website",
validator: (value) {
return MihValidationServices()
.validateWebsite(value, false);
},
),
const SizedBox(height: 10.0),
MihTextFormField(
fillColor: MzansiInnovationHub.of(context)!
@@ -439,10 +482,11 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
.primaryColor(),
controller: regController,
multiLineInput: false,
requiredText: true,
requiredText: false,
hintText: "Registration No.",
validator: (value) {
return MihValidationServices().isEmpty(value);
// return MihValidationServices().isEmpty(value);
return null;
},
),
const SizedBox(height: 10.0),
@@ -472,10 +516,11 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
.primaryColor(),
controller: vatNoController,
multiLineInput: false,
requiredText: true,
requiredText: false,
hintText: "VAT Number",
validator: (value) {
return MihValidationServices().isEmpty(value);
// return MihValidationServices().isEmpty(value);
return null;
},
),
const SizedBox(height: 10.0),
@@ -553,17 +598,32 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
.theme
.secondaryColor()),
const SizedBox(height: 10.0),
MihDropdownField(
MihTextFormField(
fillColor: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
inputColor: MzansiInnovationHub.of(context)!
.theme
.primaryColor(),
controller: titleController,
multiLineInput: false,
requiredText: true,
hintText: "Title",
dropdownOptions: const ["Doctor", "Assistant", "Other"],
editable: true,
enableSearch: true,
validator: (value) {
return MihValidationServices().isEmpty(value);
},
requiredText: true,
),
// MihDropdownField(
// controller: titleController,
// hintText: "Title",
// dropdownOptions: const ["Doctor", "Assistant", "Other"],
// editable: true,
// enableSearch: true,
// validator: (value) {
// return MihValidationServices().isEmpty(value);
// },
// requiredText: true,
// ),
const SizedBox(height: 10.0),
MihTextFormField(
fillColor: MzansiInnovationHub.of(context)!
@@ -575,6 +635,7 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
controller: fnameController,
multiLineInput: false,
requiredText: true,
readOnly: true,
hintText: "First Name",
validator: (value) {
return MihValidationServices().isEmpty(value);
@@ -591,23 +652,40 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
controller: lnameController,
multiLineInput: false,
requiredText: true,
readOnly: true,
hintText: "Surname",
validator: (value) {
return MihValidationServices().isEmpty(value);
},
),
const SizedBox(height: 15.0),
MihDropdownField(
MihTextFormField(
fillColor: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
inputColor: MzansiInnovationHub.of(context)!
.theme
.primaryColor(),
controller: accessController,
multiLineInput: false,
requiredText: true,
readOnly: true,
hintText: "Access Type",
dropdownOptions: const ["Full", "Partial"],
editable: true,
enableSearch: true,
validator: (value) {
return MihValidationServices().isEmpty(value);
},
requiredText: true,
),
// MihDropdownField(
// controller: accessController,
// hintText: "Access Type",
// dropdownOptions: const ["Full", "Partial"],
// editable: false,
// enableSearch: true,
// validator: (value) {
// return MihValidationServices().isEmpty(value);
// },
// requiredText: true,
// ),
const SizedBox(height: 20.0),
Center(
child: MihButton(
@@ -674,6 +752,7 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
fnameController.text = widget.signedInUser.fname;
lnameController.text = widget.signedInUser.lname;
accessController.text = "Full";
countryCodeController.text = "+27";
});
if (AppEnviroment.getEnv() == "Prod") {
env = "Prod";

View File

@@ -34,7 +34,7 @@ class _MzansiSetupProfileTileState extends State<MzansiSetupProfileTile> {
),
);
},
appName: "Setup Profile",
appName: "Set Up Profile",
appIcon: Icon(
MihIcons.profileSetup,
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),

View File

@@ -1,6 +1,4 @@
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
import 'package:mzansi_innovation_hub/main.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_floating_menu.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart';
import 'package:mzansi_innovation_hub/mih_services/mih_alert_services.dart';
import 'package:mzansi_innovation_hub/mih_services/mih_file_services.dart';
@@ -41,6 +39,7 @@ class _MihPersonalProfileState extends State<MihPersonalProfile> {
final ValueNotifier<int> _counter = ValueNotifier<int>(0);
PlatformFile? proPic;
late ImageProvider<Object>? propicPreview;
late bool originalProfileTypeIsBusiness;
late bool businessUser;
late String oldProPicName;
late String env;
@@ -125,13 +124,18 @@ class _MihPersonalProfileState extends State<MihPersonalProfile> {
context,
);
if (responseCode == 200) {
bool stayOnPersonalSide = true;
if (originalProfileTypeIsBusiness == false && businessUser == true) {
stayOnPersonalSide = false;
}
Navigator.of(context).pop();
Navigator.of(context).pop();
Navigator.of(context).pop();
Navigator.of(context).pushNamed(
'/',
arguments: AuthArguments(
true,
stayOnPersonalSide,
// true,
false,
),
);
@@ -302,7 +306,7 @@ class _MihPersonalProfileState extends State<MihPersonalProfile> {
controller: purposeController,
multiLineInput: true,
requiredText: true,
hintText: "Your Purpose",
hintText: "Your Personal Mission",
validator: (value) {
return MihValidationServices()
.validateLength(purposeController.text, 256);
@@ -423,6 +427,11 @@ class _MihPersonalProfileState extends State<MihPersonalProfile> {
usernameController.text = widget.arguments.signedInUser.username;
purposeController.text = widget.arguments.signedInUser.purpose;
businessUser = isBusinessUser();
if (businessUser) {
originalProfileTypeIsBusiness = true;
} else {
originalProfileTypeIsBusiness = false;
}
});
}
@@ -513,7 +522,7 @@ class _MihPersonalProfileState extends State<MihPersonalProfile> {
child: Text(
widget.arguments.signedInUser.purpose.isNotEmpty
? widget.arguments.signedInUser.purpose
: "No purpose added yet",
: "No Personal Mission added yet",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 15,
@@ -553,33 +562,33 @@ class _MihPersonalProfileState extends State<MihPersonalProfile> {
),
),
),
Positioned(
right: 5,
bottom: 10,
child: MihFloatingMenu(
animatedIcon: AnimatedIcons.menu_close,
children: [
SpeedDialChild(
child: Icon(
Icons.edit,
color: MzansiInnovationHub.of(context)!.theme.primaryColor(),
),
label: "Edit Profile",
labelBackgroundColor:
MzansiInnovationHub.of(context)!.theme.successColor(),
labelStyle: TextStyle(
color: MzansiInnovationHub.of(context)!.theme.primaryColor(),
fontWeight: FontWeight.bold,
),
backgroundColor:
MzansiInnovationHub.of(context)!.theme.successColor(),
onTap: () {
editProfileWindow(width);
},
)
],
),
),
// Positioned(
// right: 5,
// bottom: 10,
// child: MihFloatingMenu(
// animatedIcon: AnimatedIcons.menu_close,
// children: [
// SpeedDialChild(
// child: Icon(
// Icons.edit,
// color: MzansiInnovationHub.of(context)!.theme.primaryColor(),
// ),
// label: "Edit Profile",
// labelBackgroundColor:
// MzansiInnovationHub.of(context)!.theme.successColor(),
// labelStyle: TextStyle(
// color: MzansiInnovationHub.of(context)!.theme.primaryColor(),
// fontWeight: FontWeight.bold,
// ),
// backgroundColor:
// MzansiInnovationHub.of(context)!.theme.successColor(),
// onTap: () {
// editProfileWindow(width);
// },
// )
// ],
// ),
// ),
],
);
}

View File

@@ -157,7 +157,7 @@ class _MihPersonalProfileViewState extends State<MihPersonalProfileView> {
child: Text(
widget.user.purpose.isNotEmpty
? widget.user.purpose
: "No purpose added yet",
: "No Personal Mission added yet",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 15,

View File

@@ -1,6 +1,7 @@
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
import 'package:mzansi_innovation_hub/main.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_banner_ad.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
import 'package:mzansi_innovation_hub/mih_services/mih_alert_services.dart';
import 'package:mzansi_innovation_hub/mih_services/mih_mzansi_wallet_services.dart';
import 'package:mzansi_innovation_hub/mih_services/mih_validation_services.dart';
@@ -21,6 +22,8 @@ class BuildLoyaltyCardList extends StatefulWidget {
final List<MIHLoyaltyCard> cardList;
final int navIndex;
final MihBannerAd? bannerAd;
final bool favouritesMode;
final TextEditingController searchText;
final void Function()? onCardViewClose;
const BuildLoyaltyCardList({
@@ -28,6 +31,8 @@ class BuildLoyaltyCardList extends StatefulWidget {
required this.signedInUser,
required this.cardList,
required this.navIndex,
required this.favouritesMode,
required this.searchText,
this.bannerAd,
this.onCardViewClose,
});
@@ -502,11 +507,7 @@ class _BuildLoyaltyCardListState extends State<BuildLoyaltyCardList> {
padding: EdgeInsets.only(
left: getHorizontalPaddingSize(size),
right: getHorizontalPaddingSize(size),
//bottom: height / 5,
//top: 20,
),
// physics: ,
// shrinkWrap: true,
itemCount: widget.cardList.length,
gridDelegate: const SliverGridDelegateWithMaxCrossAxisExtent(
mainAxisSpacing: 0,
@@ -526,41 +527,148 @@ class _BuildLoyaltyCardListState extends State<BuildLoyaltyCardList> {
);
},
);
// return ListView.separated(
// shrinkWrap: true,
// physics: const NeverScrollableScrollPhysics(),
// separatorBuilder: (BuildContext context, int index) {
// return Divider(
// color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
// );
// },
// itemCount: widget.cardList.length,
// itemBuilder: (context, index) {
// return ListTile(
// title: MihCardDisplay(
// shopName: widget.cardList[index].shop_name, height: 200),
// onTap: () {
// viewCardWindow(index);
// },
// );
// },
// );
} else {
return Padding(
padding: const EdgeInsets.only(top: 25.0),
child: SizedBox(
height: size.height,
child: const Align(
alignment: Alignment.topCenter,
child: Text(
"No Cards Available",
style: TextStyle(fontSize: 25, color: Colors.grey),
textAlign: TextAlign.center,
),
if (!widget.favouritesMode) {
if (widget.searchText.text.isNotEmpty) {
return Column(
children: [
const SizedBox(height: 50),
Icon(
MihIcons.iDontKnow,
size: 165,
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
const SizedBox(height: 10),
Text(
"Let's Try Refining Your Search",
textAlign: TextAlign.center,
overflow: TextOverflow.visible,
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
color:
MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
),
],
);
}
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const SizedBox(height: 50),
Icon(
MihIcons.mzansiWallet,
size: 165,
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
const SizedBox(height: 10),
Text(
"No Cards added to your Mzansi Wallet",
textAlign: TextAlign.center,
overflow: TextOverflow.visible,
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
color:
MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
),
const SizedBox(height: 10),
Center(
child: RichText(
textAlign: TextAlign.center,
text: TextSpan(
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.normal,
color: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
),
children: [
TextSpan(text: "Press "),
WidgetSpan(
alignment: PlaceholderAlignment.middle,
child: Icon(
Icons.menu,
size: 20,
color: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
),
),
TextSpan(text: " to add your first loyalty card"),
],
),
),
),
],
),
),
);
);
} else {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const SizedBox(height: 50),
Icon(
MihIcons.mzansiWallet,
size: 165,
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
const SizedBox(height: 10),
Text(
"No Favourite Cards in your Mzansi Wallet",
textAlign: TextAlign.center,
overflow: TextOverflow.visible,
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
color:
MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
),
const SizedBox(height: 10),
Center(
child: RichText(
textAlign: TextAlign.center,
text: TextSpan(
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.normal,
color: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
),
children: [
TextSpan(text: "Press "),
WidgetSpan(
alignment: PlaceholderAlignment.middle,
child: Icon(
Icons.menu,
size: 20,
color: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
),
),
TextSpan(
text:
" when viewing loyalty card to add it to your favorites"),
],
),
),
),
],
),
);
}
}
}
}

View File

@@ -63,6 +63,8 @@ class _MihCardFavouritesState extends State<MihCardFavourites> {
signedInUser: widget.signedInUser,
navIndex: 0,
bannerAd: _bannerAd,
favouritesMode: true,
searchText: TextEditingController(),
onCardViewClose: () {
setState(() {
_bannerAd = MihBannerAd();

View File

@@ -372,6 +372,8 @@ class _MihCardsState extends State<MihCards> {
signedInUser: widget.signedInUser,
navIndex: 0,
bannerAd: _bannerAd,
favouritesMode: false,
searchText: cardSearchController,
onCardViewClose: () {
setState(() {
_bannerAd = MihBannerAd();

View File

@@ -1,4 +1,5 @@
import 'package:mzansi_innovation_hub/main.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
import 'package:mzansi_innovation_hub/mih_services/mih_service_calls.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_single_child_scroll.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tool_body.dart';
@@ -35,6 +36,7 @@ class _MihPatientSearchState extends State<MihPatientSearch> {
TextEditingController _mihPatientSearchController = TextEditingController();
final FocusNode _focusNode = FocusNode();
final FocusNode _searchFocusNode = FocusNode();
bool hasSearchedBefore = false;
String _mihPatientSearchString = "";
String baseUrl = AppEnviroment.baseApiUrl;
late Future<List<Patient>> _mihPatientSearchResults;
@@ -125,33 +127,97 @@ class _MihPatientSearchState extends State<MihPatientSearch> {
personalSelected: widget.personalSelected,
);
} else if (patientsList.isEmpty && searchString != "") {
return Padding(
padding: const EdgeInsets.only(top: 35.0),
child: Center(
child: Text(
"No ID or Medical Aid No. matches a Patient",
style: TextStyle(
fontSize: 25,
color:
MzansiInnovationHub.of(context)!.theme.messageTextColor()),
textAlign: TextAlign.center,
return Column(
children: [
const SizedBox(height: 50),
Icon(
MihIcons.iDontKnow,
size: 165,
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
),
const SizedBox(height: 10),
Text(
"Let's Try Refining Your Search",
textAlign: TextAlign.center,
overflow: TextOverflow.visible,
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
),
],
);
} else {
return Padding(
padding: const EdgeInsets.only(top: 35.0),
child: Center(
child: Text(
"Enter ID or Medical Aid No. of Patient",
style: TextStyle(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const SizedBox(height: 50),
Icon(
MihIcons.patientProfile,
size: 165,
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
const SizedBox(height: 10),
Text(
"Search for a Patient of Mzansi to add to your Patient List",
textAlign: TextAlign.center,
overflow: TextOverflow.visible,
style: TextStyle(
fontSize: 25,
color:
MzansiInnovationHub.of(context)!.theme.messageTextColor()),
textAlign: TextAlign.center,
),
fontWeight: FontWeight.bold,
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
),
const SizedBox(height: 10),
Center(
child: RichText(
textAlign: TextAlign.center,
text: TextSpan(
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.normal,
color:
MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
children: [
TextSpan(
text:
"You can search using their teamtient ID or Medical Aid No."),
// WidgetSpan(
// alignment: PlaceholderAlignment.middle,
// child: Icon(
// Icons.menu,
// size: 20,
// color: MzansiInnovationHub.of(context)!
// .theme
// .secondaryColor(),
// ),
// ),
// TextSpan(text: " to add your first loyalty card"),
],
),
),
),
],
),
);
// return Padding(
// padding: const EdgeInsets.only(top: 35.0),
// child: Center(
// child: Text(
// "Enter ID or Medical Aid No. of Patient",
// style: TextStyle(
// fontSize: 25,
// color:
// MzansiInnovationHub.of(context)!.theme.messageTextColor()),
// textAlign: TextAlign.center,
// ),
// ),
// );
}
}
@@ -161,6 +227,7 @@ class _MihPatientSearchState extends State<MihPatientSearch> {
_mihPatientSearchString = _mihPatientSearchController.text;
_mihPatientSearchResults =
MIHApiCalls.fetchPatients(_mihPatientSearchString);
hasSearchedBefore = true;
});
}
}

View File

@@ -1,4 +1,5 @@
import 'package:mzansi_innovation_hub/main.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
import 'package:mzansi_innovation_hub/mih_services/mih_service_calls.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_single_child_scroll.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tool_body.dart';
@@ -11,7 +12,6 @@ import 'package:mzansi_innovation_hub/mih_components/mih_objects/business_user.d
import 'package:mzansi_innovation_hub/mih_components/mih_objects/patient_access.dart';
import 'package:mzansi_innovation_hub/mih_packages/patient_profile/pat_manager/list_builders/build_my_patient_list_list.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class MyPatientList extends StatefulWidget {
final AppUser signedInUser;
@@ -35,6 +35,7 @@ class _MyPatientListState extends State<MyPatientList> {
late Future<List<PatientAccess>> _myPatientList;
TextEditingController _myPatientSearchController = TextEditingController();
final FocusNode _searchFocusNode = FocusNode();
bool hasSearchedBefore = false;
String _myPatientIdSearchString = "";
String baseUrl = AppEnviroment.baseApiUrl;
@@ -114,18 +115,98 @@ class _MyPatientListState extends State<MyPatientList> {
businessUser: widget.businessUser,
);
}
return Padding(
padding: const EdgeInsets.only(top: 35.0),
child: Center(
child: Text(
"No Patients matching search",
style: TextStyle(
if (hasSearchedBefore && _myPatientIdSearchString.isNotEmpty) {
return Column(
children: [
const SizedBox(height: 50),
Icon(
MihIcons.iDontKnow,
size: 165,
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
const SizedBox(height: 10),
Text(
"Let's Try Refining Your Search",
textAlign: TextAlign.center,
overflow: TextOverflow.visible,
style: TextStyle(
fontSize: 25,
color: MzansiInnovationHub.of(context)!.theme.messageTextColor()),
textAlign: TextAlign.center,
fontWeight: FontWeight.bold,
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
),
],
);
} else {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const SizedBox(height: 50),
Icon(
MihIcons.patientProfile,
size: 165,
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
const SizedBox(height: 10),
Text(
"You dont have access to any Patients Profile",
textAlign: TextAlign.center,
overflow: TextOverflow.visible,
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
),
const SizedBox(height: 10),
Center(
child: RichText(
textAlign: TextAlign.center,
text: TextSpan(
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.normal,
color:
MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
children: [
TextSpan(text: "Press "),
WidgetSpan(
alignment: PlaceholderAlignment.middle,
child: Icon(
Icons.search,
size: 20,
color: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
),
),
TextSpan(
text:
" to use Patient Search to request access to their profile."),
],
),
),
),
],
),
),
);
);
}
// return Padding(
// padding: const EdgeInsets.only(top: 35.0),
// child: Center(
// child: Text(
// "No Patients matching search",
// style: TextStyle(
// fontSize: 25,
// color: MzansiInnovationHub.of(context)!.theme.messageTextColor()),
// textAlign: TextAlign.center,
// ),
// ),
// );
}
List<PatientAccess> filterAccessResults(
@@ -143,6 +224,7 @@ class _MyPatientListState extends State<MyPatientList> {
setState(() {
_myPatientList = MIHApiCalls.getPatientAccessListOfBusiness(
widget.business!.business_id);
hasSearchedBefore = true;
});
}

View File

@@ -1,5 +1,6 @@
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
import 'package:mzansi_innovation_hub/main.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
import 'package:mzansi_innovation_hub/mih_services/mih_alert_services.dart';
import 'package:mzansi_innovation_hub/mih_services/mih_mzansi_calendar_services.dart';
import 'package:mzansi_innovation_hub/mih_services/mih_validation_services.dart';
@@ -170,21 +171,79 @@ class _WaitingRoomState extends State<WaitingRoom> {
}
return Expanded(
child: Padding(
padding: const EdgeInsets.only(top: 35.0),
child: Align(
alignment: Alignment.center,
child: Text(
"No Appointments for $selectedDay",
style: TextStyle(
fontSize: 25,
color: MzansiInnovationHub.of(context)!.theme.messageTextColor(),
padding: const EdgeInsets.symmetric(horizontal: 10.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const SizedBox(height: 50),
Icon(
MihIcons.calendar,
size: 165,
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
textAlign: TextAlign.center,
softWrap: true,
),
const SizedBox(height: 10),
Text(
"No Appointments for $selectedDay",
textAlign: TextAlign.center,
overflow: TextOverflow.visible,
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
),
const SizedBox(height: 10),
Center(
child: RichText(
textAlign: TextAlign.center,
text: TextSpan(
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.normal,
color:
MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
children: [
TextSpan(text: "Press "),
WidgetSpan(
alignment: PlaceholderAlignment.middle,
child: Icon(
Icons.menu,
size: 20,
color: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
),
),
TextSpan(
text:
" to add an appointment or select a different date"),
],
),
),
),
],
),
),
);
// return Expanded(
// child: Padding(
// padding: const EdgeInsets.only(top: 35.0),
// child: Align(
// alignment: Alignment.center,
// child: Text(
// "No Appointments for $selectedDay",
// style: TextStyle(
// fontSize: 25,
// color: MzansiInnovationHub.of(context)!.theme.messageTextColor(),
// ),
// textAlign: TextAlign.center,
// softWrap: true,
// ),
// ),
// ),
// );
}
void appointmentTypeSelection(double width) {

View File

@@ -3,6 +3,7 @@ import 'dart:async';
import 'package:fl_downloader/fl_downloader.dart';
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
import 'package:mzansi_innovation_hub/main.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
import 'package:mzansi_innovation_hub/mih_services/mih_claim_statement_generation_services.dart';
import 'package:mzansi_innovation_hub/mih_services/mih_file_services.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart';
@@ -349,11 +350,74 @@ class _BuildClaimStatementFileListState
},
);
} else {
return const Center(
child: Text(
"No Documents Available",
style: TextStyle(fontSize: 25, color: Colors.grey),
textAlign: TextAlign.center,
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
child: Column(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
children: [
const SizedBox(height: 50),
Stack(
alignment: AlignmentDirectional.center,
children: [
Icon(
MihIcons.mihRing,
size: 165,
color:
MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
Icon(
Icons.file_open_outlined,
size: 110,
color:
MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
],
),
const SizedBox(height: 10),
Text(
"No Claims or Statements have been added to this profile.",
textAlign: TextAlign.center,
overflow: TextOverflow.visible,
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
),
const SizedBox(height: 10),
Visibility(
visible: widget.business != null,
child: Center(
child: RichText(
textAlign: TextAlign.center,
text: TextSpan(
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.normal,
color: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
),
children: [
TextSpan(text: "Press "),
WidgetSpan(
alignment: PlaceholderAlignment.middle,
child: Icon(
Icons.menu,
size: 20,
color: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
),
),
TextSpan(text: " to generate the first document"),
],
),
),
),
),
],
),
);
}

View File

@@ -4,6 +4,7 @@ import 'dart:convert';
import 'package:fl_downloader/fl_downloader.dart';
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
import 'package:mzansi_innovation_hub/main.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
import 'package:mzansi_innovation_hub/mih_services/mih_file_services.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_delete_message.dart';
@@ -400,13 +401,82 @@ class _BuildFilesListState extends State<BuildFilesList> {
},
);
} else {
return const Center(
child: Text(
"No Documents Available",
style: TextStyle(fontSize: 25, color: Colors.grey),
textAlign: TextAlign.center,
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
child: Column(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
children: [
const SizedBox(height: 50),
Stack(
alignment: AlignmentDirectional.center,
children: [
Icon(
MihIcons.mihRing,
size: 165,
color:
MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
Icon(
Icons.file_present,
size: 110,
color:
MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
],
),
const SizedBox(height: 10),
Text(
"No Documents have been added to this profile.",
textAlign: TextAlign.center,
overflow: TextOverflow.visible,
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
),
const SizedBox(height: 10),
Center(
child: RichText(
textAlign: TextAlign.center,
text: TextSpan(
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.normal,
color:
MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
children: [
TextSpan(text: "Press "),
WidgetSpan(
alignment: PlaceholderAlignment.middle,
child: Icon(
Icons.menu,
size: 20,
color: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
),
),
TextSpan(text: " to add "),
widget.business != null
? TextSpan(text: " or generate a the first document")
: TextSpan(text: " the first document"),
],
),
),
),
],
),
);
// return const Center(
// child: Text(
// "No Documents Available",
// style: TextStyle(fontSize: 25, color: Colors.grey),
// textAlign: TextAlign.center,
// ),
// );
}
}
}

View File

@@ -2,6 +2,7 @@ import 'dart:convert';
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
import 'package:mzansi_innovation_hub/main.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_text_form_field.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_delete_message.dart';
@@ -281,13 +282,83 @@ class _BuildNotesListState extends State<BuildNotesList> {
},
);
} else {
return const Center(
child: Text(
"No Notes Available",
style: TextStyle(fontSize: 25, color: Colors.grey),
textAlign: TextAlign.center,
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
child: Column(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
children: [
const SizedBox(height: 50),
Stack(
alignment: AlignmentDirectional.center,
children: [
Icon(
MihIcons.mihRing,
size: 165,
color:
MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
Icon(
Icons.article_outlined,
size: 110,
color:
MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
],
),
const SizedBox(height: 10),
Text(
"No Notes have been added to this profile.",
textAlign: TextAlign.center,
overflow: TextOverflow.visible,
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
),
const SizedBox(height: 10),
Visibility(
visible: widget.business != null,
child: Center(
child: RichText(
textAlign: TextAlign.center,
text: TextSpan(
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.normal,
color: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
),
children: [
TextSpan(text: "Press "),
WidgetSpan(
alignment: PlaceholderAlignment.middle,
child: Icon(
Icons.menu,
size: 20,
color: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
),
),
TextSpan(text: " to add the first note"),
],
),
),
),
),
],
),
);
// return const Center(
// child: Text(
// "No Notes Available",
// style: TextStyle(fontSize: 25, color: Colors.grey),
// textAlign: TextAlign.center,
// ),
// );
}
}
}

View File

@@ -46,6 +46,7 @@ dependencies:
google_mobile_ads: ^6.0.0
redacted: ^1.0.13
custom_rating_bar: ^3.0.0
country_code_picker: ^3.3.0
dev_dependencies:
flutter_test: