feature/medora-116 (#7)
fixed bugs from qa test Co-authored-by: Jipson George <152465898+Jipson-cosq@users.noreply.github.com> Co-authored-by: DhanshCOSQ <dhanshas@cosq.net> Reviewed-on: cosqnet/telemednet#7 Co-authored-by: Jipson George <jipsongeorge@cosq.net> Co-committed-by: Jipson George <jipsongeorge@cosq.net>
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 19 KiB |
BIN
images/logo.jpg
|
Before Width: | Height: | Size: 274 KiB After Width: | Height: | Size: 324 KiB |
|
Before Width: | Height: | Size: 501 KiB After Width: | Height: | Size: 282 KiB |
|
Before Width: | Height: | Size: 901 B After Width: | Height: | Size: 645 B |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 8.8 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 5.0 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 9.1 KiB |
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 7.0 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 8.4 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 9.1 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 15 KiB |
@ -97,11 +97,11 @@ class DoctorController {
|
||||
}
|
||||
|
||||
void addQualification(String qualification) {
|
||||
model.qualifications!.add(qualification.trim());
|
||||
model.qualifications!.add(qualification);
|
||||
}
|
||||
|
||||
void removeQualification(String qualification) {
|
||||
model.qualifications!.remove(qualification.trim());
|
||||
model.qualifications!.remove(qualification);
|
||||
}
|
||||
|
||||
void updateFloorBuilding(String floorBuilding) {
|
||||
|
||||
@ -8,46 +8,41 @@ import 'package:medora/screens/authentication/launch_screen.dart';
|
||||
import 'package:medora/controllers/patient_controller.dart';
|
||||
import 'package:medora/route/route_names.dart';
|
||||
import 'package:medora/screens/common/loading_screen.dart';
|
||||
import 'package:medora/screens/doctorScreens/doctorConsultationSchedule/business_center_screen.dart';
|
||||
import 'package:medora/screens/doctorScreens/doctorConsultationSchedule/center_fee_and_duration_screen.dart';
|
||||
import 'package:medora/screens/doctorScreens/doctorConsultationSchedule/consultation_day_screen.dart';
|
||||
import 'package:medora/screens/doctorScreens/doctorConsultationSchedule/consultation_schedule.dart';
|
||||
import 'package:medora/screens/doctorScreens/doctorConsultationSchedule/consultation_time_slot_screen.dart';
|
||||
import 'package:medora/screens/doctorScreens/doctorDashboard/doctor_dashboard_home_screen.dart';
|
||||
import 'package:medora/screens/doctorScreens/doctorDashboard/doctor_dashboard_screen.dart';
|
||||
import 'package:medora/screens/doctorScreens/doctorDashboard/doctor_landing_screen.dart';
|
||||
import 'package:medora/screens/doctorScreens/doctorDashboard/doctor_personal_profile_screen.dart';
|
||||
import 'package:medora/screens/doctorScreens/doctorDashboard/doctor_services_menu_screen.dart';
|
||||
import 'package:medora/screens/doctorScreens/doctorProfileScreens/doctor_profile_screen.dart';
|
||||
import 'package:medora/screens/doctorScreens/doctorProfileScreens/qualifications_screen.dart';
|
||||
import 'package:medora/screens/patientScreens/appoinmentBooking/consultation_booking_screen.dart';
|
||||
import 'package:medora/screens/patientScreens/appoinmentBooking/consultation_time_screen.dart';
|
||||
import 'package:medora/screens/patientScreens/appoinmentBooking/consultations_center_screen.dart';
|
||||
import 'package:medora/screens/patientScreens/appoinmentBooking/doctor_details_screen.dart';
|
||||
import 'package:medora/screens/patientScreens/appoinmentBooking/doctors_list_screen.dart';
|
||||
import 'package:medora/screens/patientScreens/appoinmentBooking/speciality_screen.dart';
|
||||
|
||||
import 'package:medora/screens/doctorScreens/doctorProfileScreens/achivements_screen.dart';
|
||||
import 'package:medora/screens/doctorScreens/doctorProfileScreens/address_screen.dart';
|
||||
|
||||
import 'package:medora/screens/doctorScreens/doctorProfileScreens/digital_signature_screen.dart';
|
||||
|
||||
import 'package:medora/screens/doctorScreens/doctorProfileScreens/experience_screen.dart';
|
||||
import 'package:medora/screens/doctorScreens/doctorProfileScreens/profile_description_screen.dart';
|
||||
|
||||
import 'package:medora/screens/doctorScreens/doctorProfileScreens/specialities_selection_screen.dart';
|
||||
import 'package:medora/screens/patientScreens/patientDashboard/patient_dashboard_screen.dart';
|
||||
import 'package:medora/screens/patientScreens/patientDashboard/patient_home_screen.dart';
|
||||
|
||||
import 'package:medora/screens/patientScreens/patientDashboard/patient_profile_screen.dart';
|
||||
import 'package:medora/screens/patientScreens/registrationScreens/patient_adress_screen.dart';
|
||||
import 'package:medora/screens/patientScreens/registrationScreens/patient_family_members_screen.dart';
|
||||
import 'package:medora/screens/patientScreens/registrationScreens/patient_registration_screen.dart';
|
||||
import 'package:medora/screens/doctor_screen/doctor_consultation_schedule/business_center_screen.dart';
|
||||
import 'package:medora/screens/doctor_screen/doctor_consultation_schedule/center_fee_and_duration_screen.dart';
|
||||
import 'package:medora/screens/doctor_screen/doctor_consultation_schedule/consultation_day_screen.dart';
|
||||
import 'package:medora/screens/doctor_screen/doctor_consultation_schedule/consultation_schedule.dart';
|
||||
import 'package:medora/screens/doctor_screen/doctor_consultation_schedule/consultation_time_slot_screen.dart';
|
||||
import 'package:medora/screens/doctor_screen/doctor_dashboard/doctor_dashboard_home_screen.dart';
|
||||
import 'package:medora/screens/doctor_screen/doctor_dashboard/doctor_dashboard_screen.dart';
|
||||
import 'package:medora/screens/doctor_screen/doctor_dashboard/doctor_landing_screen.dart';
|
||||
import 'package:medora/screens/doctor_screen/doctor_dashboard/doctor_personal_profile_screen.dart';
|
||||
import 'package:medora/screens/doctor_screen/doctor_dashboard/doctor_services_menu_screen.dart';
|
||||
import 'package:medora/screens/doctor_screen/doctor_profile_screens/achivements_screen.dart';
|
||||
import 'package:medora/screens/doctor_screen/doctor_profile_screens/address_screen.dart';
|
||||
import 'package:medora/screens/doctor_screen/doctor_profile_screens/digital_signature_screen.dart';
|
||||
import 'package:medora/screens/doctor_screen/doctor_profile_screens/doctor_profile_screen.dart';
|
||||
import 'package:medora/screens/doctor_screen/doctor_profile_screens/experience_screen.dart';
|
||||
import 'package:medora/screens/doctor_screen/doctor_profile_screens/profile_description_screen.dart';
|
||||
import 'package:medora/screens/doctor_screen/doctor_profile_screens/qualifications_screen.dart';
|
||||
import 'package:medora/screens/doctor_screen/doctor_profile_screens/specialities_selection_screen.dart';
|
||||
import 'package:medora/screens/patient_screens/appoinment_bookings/consultation_booking_screen.dart';
|
||||
import 'package:medora/screens/patient_screens/appoinment_bookings/consultation_time_screen.dart';
|
||||
import 'package:medora/screens/patient_screens/appoinment_bookings/consultations_center_screen.dart';
|
||||
import 'package:medora/screens/patient_screens/appoinment_bookings/doctor_details_screen.dart';
|
||||
import 'package:medora/screens/patient_screens/appoinment_bookings/doctors_list_screen.dart';
|
||||
import 'package:medora/screens/patient_screens/appoinment_bookings/speciality_screen.dart';
|
||||
import 'package:medora/screens/patient_screens/patient_dashboard/patient_dashboard_screen.dart';
|
||||
import 'package:medora/screens/patient_screens/patient_dashboard/patient_home_screen.dart';
|
||||
import 'package:medora/screens/patient_screens/patient_dashboard/patient_profile_screen.dart';
|
||||
import 'package:medora/screens/patient_screens/registration_screens/patient_adress_screen.dart';
|
||||
import 'package:medora/screens/patient_screens/registration_screens/patient_family_members_screen.dart';
|
||||
import 'package:medora/screens/patient_screens/registration_screens/patient_registration_screen.dart';
|
||||
import 'package:medora/screens/splash_screen.dart';
|
||||
|
||||
import '../controllers/doctor_controller.dart';
|
||||
import '../screens/patientScreens/patient_landing_screen.dart';
|
||||
import '../screens/patientScreens/registrationScreens/family_members_edit_screen.dart';
|
||||
import '../screens/patient_screens/patient_landing_screen.dart';
|
||||
import '../screens/patient_screens/registration_screens/family_members_edit_screen.dart';
|
||||
|
||||
final Map<String, Widget Function(BuildContext)> routes = {
|
||||
RouteNames.launch: (context) => const LaunchScreen(),
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:intl_phone_field/intl_phone_field.dart';
|
||||
import 'package:medora/data/services/data_service.dart';
|
||||
@ -24,6 +26,123 @@ class _SignUpScreenState extends State<SignUpScreen> {
|
||||
bool _isLoading = false;
|
||||
bool _obscurePassword = true;
|
||||
|
||||
// Add focus nodes to handle keyboard navigation
|
||||
final _emailFocusNode = FocusNode();
|
||||
final _passwordFocusNode = FocusNode();
|
||||
|
||||
// Email validation patterns
|
||||
final RegExp _emailRegex = RegExp(
|
||||
r'^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$',
|
||||
caseSensitive: false,
|
||||
);
|
||||
|
||||
// Common email domain validation
|
||||
final List<String> _commonEmailDomains = [
|
||||
'gmail.com',
|
||||
'yahoo.com',
|
||||
'hotmail.com',
|
||||
'outlook.com'
|
||||
];
|
||||
|
||||
String? _validateEmail(String? value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return 'Email address is required';
|
||||
}
|
||||
|
||||
value = value.trim();
|
||||
|
||||
// Basic format validation
|
||||
if (!_emailRegex.hasMatch(value)) {
|
||||
return 'Please enter a valid email address';
|
||||
}
|
||||
|
||||
// Check email length
|
||||
if (value.length > 254) {
|
||||
return 'Email address is too long';
|
||||
}
|
||||
|
||||
// Split email into local and domain parts
|
||||
final parts = value.split('@');
|
||||
if (parts.length != 2) {
|
||||
return 'Invalid email format';
|
||||
}
|
||||
|
||||
final localPart = parts[0];
|
||||
final domainPart = parts[1].toLowerCase();
|
||||
|
||||
// Validate local part
|
||||
if (localPart.isEmpty || localPart.length > 64) {
|
||||
return 'Invalid email username';
|
||||
}
|
||||
|
||||
// Check for common typos in popular domains
|
||||
for (final domain in _commonEmailDomains) {
|
||||
if (domainPart.length > 3 &&
|
||||
domainPart != domain &&
|
||||
_calculateLevenshteinDistance(domainPart, domain) <= 2) {
|
||||
return 'Did you mean @$domain?';
|
||||
}
|
||||
}
|
||||
|
||||
// Additional domain validation
|
||||
if (!domainPart.contains('.')) {
|
||||
return 'Invalid email domain';
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
String? _validatePassword(String? value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return 'Password is required';
|
||||
}
|
||||
|
||||
if (value.length < 6) {
|
||||
return 'Password must be at least 6 characters';
|
||||
}
|
||||
|
||||
if (!value.contains(RegExp(r'[A-Z]'))) {
|
||||
return 'Password must contain at least one uppercase letter';
|
||||
}
|
||||
|
||||
if (!value.contains(RegExp(r'[0-9]'))) {
|
||||
return 'Password must contain at least one number';
|
||||
}
|
||||
|
||||
if (!value.contains(RegExp(r'[!@#$%^&*(),.?":{}|<>]'))) {
|
||||
return 'Password must contain at least one special character';
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
// Calculate Levenshtein distance for typo detection
|
||||
int _calculateLevenshteinDistance(String a, String b) {
|
||||
if (a.isEmpty) return b.length;
|
||||
if (b.isEmpty) return a.length;
|
||||
|
||||
List<int> previousRow = List<int>.generate(b.length + 1, (i) => i);
|
||||
List<int> currentRow = List<int>.filled(b.length + 1, 0);
|
||||
|
||||
for (int i = 0; i < a.length; i++) {
|
||||
currentRow[0] = i + 1;
|
||||
|
||||
for (int j = 0; j < b.length; j++) {
|
||||
int insertCost = previousRow[j + 1] + 1;
|
||||
int deleteCost = currentRow[j] + 1;
|
||||
int replaceCost = previousRow[j] + (a[i] != b[j] ? 1 : 0);
|
||||
|
||||
currentRow[j + 1] = [insertCost, deleteCost, replaceCost].reduce(min);
|
||||
}
|
||||
|
||||
List<int> temp = previousRow;
|
||||
previousRow = currentRow;
|
||||
currentRow = temp;
|
||||
}
|
||||
|
||||
return previousRow[b.length];
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
@ -51,6 +170,7 @@ class _SignUpScreenState extends State<SignUpScreen> {
|
||||
children: [
|
||||
TextFormField(
|
||||
controller: _emailController,
|
||||
focusNode: _emailFocusNode,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Email',
|
||||
border: OutlineInputBorder(
|
||||
@ -65,22 +185,25 @@ class _SignUpScreenState extends State<SignUpScreen> {
|
||||
),
|
||||
prefixIcon: const Icon(Icons.email_outlined,
|
||||
color: Colors.blue),
|
||||
errorMaxLines: 2,
|
||||
),
|
||||
keyboardType: TextInputType.emailAddress,
|
||||
validator: (value) {
|
||||
if (value?.isEmpty ?? true) {
|
||||
return 'Please enter your email';
|
||||
textInputAction: TextInputAction.next,
|
||||
onFieldSubmitted: (_) {
|
||||
_passwordFocusNode.requestFocus();
|
||||
},
|
||||
validator: _validateEmail,
|
||||
onChanged: (value) {
|
||||
// Trigger validation on change if the field was previously invalid
|
||||
if (_formKey.currentState?.validate() ?? false) {
|
||||
setState(() {});
|
||||
}
|
||||
if (!RegExp(r'^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$')
|
||||
.hasMatch(value!)) {
|
||||
return 'Please enter a valid email';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
TextFormField(
|
||||
controller: _passwordController,
|
||||
focusNode: _passwordFocusNode,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Password',
|
||||
border: OutlineInputBorder(
|
||||
@ -106,16 +229,15 @@ class _SignUpScreenState extends State<SignUpScreen> {
|
||||
onPressed: () => setState(
|
||||
() => _obscurePassword = !_obscurePassword),
|
||||
),
|
||||
errorMaxLines: 2,
|
||||
),
|
||||
obscureText: _obscurePassword,
|
||||
validator: (value) {
|
||||
if (value?.isEmpty ?? true) {
|
||||
return 'Please enter your password';
|
||||
validator: _validatePassword,
|
||||
onChanged: (value) {
|
||||
// Trigger validation on change if the field was previously invalid
|
||||
if (_formKey.currentState?.validate() ?? false) {
|
||||
setState(() {});
|
||||
}
|
||||
if ((value?.length ?? 0) < 6) {
|
||||
return 'Password must be at least 6 characters';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
@ -140,7 +262,7 @@ class _SignUpScreenState extends State<SignUpScreen> {
|
||||
},
|
||||
validator: (phone) {
|
||||
if (phone?.completeNumber.isEmpty ?? true) {
|
||||
return 'Please enter your phone number';
|
||||
return 'Phone number is required';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
@ -165,6 +287,7 @@ class _SignUpScreenState extends State<SignUpScreen> {
|
||||
|
||||
Future<void> _handleSignUp() async {
|
||||
if (_formKey.currentState == null || !_formKey.currentState!.validate()) {
|
||||
_showErrorSnackBar('Please fix the errors in the form');
|
||||
return;
|
||||
}
|
||||
|
||||
@ -222,6 +345,8 @@ class _SignUpScreenState extends State<SignUpScreen> {
|
||||
void dispose() {
|
||||
_emailController.dispose();
|
||||
_passwordController.dispose();
|
||||
_emailFocusNode.dispose();
|
||||
_passwordFocusNode.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@ import 'package:flutter/services.dart';
|
||||
|
||||
import 'package:medora/controllers/consultation_center_controller.dart';
|
||||
import 'package:medora/data/services/consultation_center_service.dart';
|
||||
import 'package:medora/screens/doctorScreens/doctorConsultationSchedule/consultation_day_screen.dart';
|
||||
import 'package:medora/screens/doctor_screen/doctor_consultation_schedule/consultation_day_screen.dart';
|
||||
import '../../../route/route_names.dart';
|
||||
|
||||
class CenterFeeAndDurationScreen extends StatefulWidget {
|
||||
@ -3,7 +3,7 @@ import 'package:medora/controllers/consultation_center_controller.dart';
|
||||
import 'package:medora/data/models/consultation_center.dart';
|
||||
import 'package:medora/data/services/consultation_center_service.dart';
|
||||
import 'package:medora/route/route_names.dart';
|
||||
import 'package:medora/screens/doctorScreens/doctorConsultationSchedule/consultation_time_slot_screen.dart';
|
||||
import 'package:medora/screens/doctor_screen/doctor_consultation_schedule/consultation_time_slot_screen.dart';
|
||||
|
||||
class ConsultationDayScreen extends StatefulWidget {
|
||||
final ConsultationCenterController controller;
|
||||
@ -1,8 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
||||
import 'package:medora/screens/patientScreens/appoinmentBooking/speciality_screen.dart';
|
||||
import 'package:medora/screens/patient_screens/appoinment_bookings/speciality_screen.dart';
|
||||
|
||||
class DoctorDashboardHomeScreen extends StatefulWidget {
|
||||
const DoctorDashboardHomeScreen({super.key});
|
||||
@ -1,9 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:animations/animations.dart';
|
||||
import 'package:curved_navigation_bar/curved_navigation_bar.dart';
|
||||
import 'package:medora/screens/doctorScreens/doctorDashboard/doctor_dashboard_home_screen.dart';
|
||||
import 'package:medora/screens/doctorScreens/doctorDashboard/doctor_personal_profile_screen.dart';
|
||||
import 'package:medora/screens/doctorScreens/doctorDashboard/doctor_services_menu_screen.dart';
|
||||
import 'package:medora/screens/doctor_screen/doctor_dashboard/doctor_dashboard_home_screen.dart';
|
||||
import 'package:medora/screens/doctor_screen/doctor_dashboard/doctor_personal_profile_screen.dart';
|
||||
import 'package:medora/screens/doctor_screen/doctor_dashboard/doctor_services_menu_screen.dart';
|
||||
|
||||
class DoctorDashboardScreen extends StatefulWidget {
|
||||
const DoctorDashboardScreen({super.key});
|
||||
@ -88,11 +88,11 @@ class _DoctorServicesMenuScreen extends State<DoctorServicesMenuScreen> {
|
||||
],
|
||||
),
|
||||
),
|
||||
const Icon(
|
||||
Icons.chevron_right,
|
||||
color: Colors.white,
|
||||
size: 30,
|
||||
),
|
||||
// const Icon(
|
||||
// Icons.chevron_right,
|
||||
// color: Colors.white,
|
||||
// size: 30,
|
||||
// ),
|
||||
],
|
||||
),
|
||||
);
|
||||
@ -60,39 +60,19 @@ class _DoctorAddressScreenState extends State<DoctorAddressScreen> {
|
||||
_addressTypeController =
|
||||
TextEditingController(text: doctor.addressType ?? '');
|
||||
selectedAddressType = widget.controller?.model.addressType;
|
||||
if (selectedAddressType != null &&
|
||||
!addressTypes.contains(selectedAddressType)) {
|
||||
showCustomTypeField = true;
|
||||
if (widget.controller?.model.addressType != null) {
|
||||
final existingType = widget.controller!.model.addressType!;
|
||||
selectedAddressType = existingType;
|
||||
|
||||
// If it's a custom type (not in predefined list)
|
||||
if (!addressTypes.contains(existingType)) {
|
||||
showCustomTypeField = true;
|
||||
_addressTypeController.text = existingType;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// bool _validateAndProceed() {if (_formKey.currentState!.validate()) {
|
||||
// // Update the address model
|
||||
// _controller.updateFloorBuilding(_floorBuildingController.text);
|
||||
// _controller.updateStreet(_streetController.text);
|
||||
// _controller.updateCity(_cityController.text);
|
||||
// _controller.updateState(_stateController.text);
|
||||
// _controller.updateCountry(_countryController.text);
|
||||
// _controller.updatePostalCode(_postalCodeController.text);
|
||||
|
||||
// // Validate the address fields
|
||||
// if (_areFieldsValid()) {
|
||||
// return true;
|
||||
// }
|
||||
|
||||
// ScaffoldMessenger.of(context).showSnackBar(
|
||||
// const SnackBar(content: Text('Please fill in all required fields')),
|
||||
// );
|
||||
// return false;
|
||||
// }
|
||||
bool _validateAndProceed() {
|
||||
// if (!_formKey.currentState!.validate()) return false;
|
||||
// if (selectedAddressType == null) {
|
||||
// ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
|
||||
// content: Text('Please select an address type'),
|
||||
// backgroundColor: Colors.red,
|
||||
// ));
|
||||
// }
|
||||
if (_formKey.currentState!.validate()) {
|
||||
_controller.updateFloorBuilding(_floorBuildingController.text);
|
||||
_controller.updateStreet(_streetController.text);
|
||||
@ -117,20 +97,6 @@ class _DoctorAddressScreenState extends State<DoctorAddressScreen> {
|
||||
_addressTypeController.text.isNotEmpty;
|
||||
}
|
||||
|
||||
// bool _validateAndProceed() {
|
||||
// if (!_formKey.currentState!.validate()) return false;
|
||||
// if (selectedAddressType == null) {
|
||||
// ScaffoldMessenger.of(context).showSnackBar(
|
||||
// const SnackBar(
|
||||
// content: Text('Please select an address type'),
|
||||
// backgroundColor: Colors.red,
|
||||
// ),
|
||||
// );
|
||||
// return false;
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
|
||||
void _handleAddressTypeSelection(String type) {
|
||||
setState(() {
|
||||
if (type == 'Others') {
|
||||
@ -138,11 +104,15 @@ class _DoctorAddressScreenState extends State<DoctorAddressScreen> {
|
||||
if (!showCustomTypeField) {
|
||||
_addressTypeController.clear();
|
||||
selectedAddressType = null;
|
||||
widget.controller?.updateAddressType('');
|
||||
}
|
||||
} else {
|
||||
showCustomTypeField = false;
|
||||
_addressTypeController
|
||||
.clear(); // Clear the custom field if it was active
|
||||
selectedAddressType = type;
|
||||
widget.controller?.updateAddressType(type);
|
||||
widget.controller
|
||||
?.updateAddressType(type); // Update controller with selected type
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -434,7 +404,7 @@ class _DoctorAddressScreenState extends State<DoctorAddressScreen> {
|
||||
if (isMandatory && (value == null || value.isEmpty)) {
|
||||
return '$label is required';
|
||||
}
|
||||
if (value != null && !RegExp(r'^[0-9]+$').hasMatch(value)) {
|
||||
if (value != null && !RegExp(r'^(?!0{6})\d{6}$').hasMatch(value)) {
|
||||
return 'Please enter numbers only';
|
||||
}
|
||||
return null;
|
||||
@ -242,7 +242,6 @@ class _ProfileUploadPageState extends State<ProfileUploadPage> {
|
||||
children: [
|
||||
_buildUniformField(
|
||||
label: 'Name',
|
||||
|
||||
icon: Icons.person,
|
||||
child:
|
||||
Container(), // The child parameter is not used in this implementation
|
||||
@ -1,8 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:animations/animations.dart';
|
||||
import 'package:curved_navigation_bar/curved_navigation_bar.dart';
|
||||
import 'package:medora/screens/patientScreens/patientDashboard/patient_home_screen.dart';
|
||||
import 'package:medora/screens/patientScreens/patientDashboard/patient_profile_screen.dart';
|
||||
import 'package:medora/screens/patient_screens/patient_dashboard/patient_home_screen.dart';
|
||||
import 'package:medora/screens/patient_screens/patient_dashboard/patient_profile_screen.dart';
|
||||
|
||||
class PatientDashboardScreen extends StatefulWidget {
|
||||
const PatientDashboardScreen({super.key});
|
||||
@ -6,8 +6,7 @@ import 'package:intl/intl.dart';
|
||||
import 'package:medora/data/models/consultation_booking.dart';
|
||||
import 'package:medora/data/services/consultation_booking_service.dart';
|
||||
import 'package:medora/route/route_names.dart';
|
||||
|
||||
import 'package:medora/screens/patientScreens/appoinmentBooking/speciality_screen.dart';
|
||||
import 'package:medora/screens/patient_screens/appoinment_bookings/speciality_screen.dart';
|
||||
|
||||
class PatientHomeScreen extends StatefulWidget {
|
||||
const PatientHomeScreen({super.key});
|
||||
@ -1,6 +1,6 @@
|
||||
import 'package:medora/data/models/patient.dart';
|
||||
import 'package:medora/screens/patientScreens/registrationScreens/family_members_edit_screen.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:medora/screens/patient_screens/registration_screens/family_members_edit_screen.dart';
|
||||
import '../../../controllers/patient_controller.dart';
|
||||
import 'package:flutter_slidable/flutter_slidable.dart';
|
||||
|
||||
@ -1 +0,0 @@
|
||||
// TODO Implement this library.
|
||||