diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png index 9d62deb..573806c 100644 Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png index 483eaf3..8901017 100644 Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png index 39ee74e..966302e 100644 Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png index 855e4b1..ebaf5f3 100644 Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png index a66e5f9..903b3c7 100644 Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/images/logo.jpg b/images/logo.jpg index a10dd73..bbeff10 100644 Binary files a/images/logo.jpg and b/images/logo.jpg differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png index 8ffe7d8..b4c2412 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png index 1e23d2b..f87a37c 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png index ac510f4..58b0fef 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png index c7323d5..8da8b13 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png index c1e6cca..82e7051 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png index afc5917..89beb4c 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png index 26fe87d..5bb1c82 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png index ac510f4..58b0fef 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png index 369ebad..2878ebe 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png index 31cff1b..b9eee56 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png index 8f72206..b956a51 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png index 84e54a0..43d5f9a 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png index a360c1f..da90b0a 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png index dd61c7c..0b2769e 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png index 31cff1b..b9eee56 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png index 4e9bb37..5c59ac8 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png index 9d62deb..573806c 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png index 855e4b1..ebaf5f3 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png index 439cee0..a65c720 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png index 1353dc5..1ee79e9 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png index 260e020..face7f1 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/lib/controllers/doctor_controller.dart b/lib/controllers/doctor_controller.dart index 1d0dca8..90366d7 100644 --- a/lib/controllers/doctor_controller.dart +++ b/lib/controllers/doctor_controller.dart @@ -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) { diff --git a/lib/route/routes.dart b/lib/route/routes.dart index 1b1480e..83e7bae 100644 --- a/lib/route/routes.dart +++ b/lib/route/routes.dart @@ -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 routes = { RouteNames.launch: (context) => const LaunchScreen(), diff --git a/lib/screens/authentication/sign_up_screen.dart b/lib/screens/authentication/sign_up_screen.dart index b8cf0d1..a464803 100644 --- a/lib/screens/authentication/sign_up_screen.dart +++ b/lib/screens/authentication/sign_up_screen.dart @@ -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 { 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 _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 previousRow = List.generate(b.length + 1, (i) => i); + List currentRow = List.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 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 { children: [ TextFormField( controller: _emailController, + focusNode: _emailFocusNode, decoration: InputDecoration( labelText: 'Email', border: OutlineInputBorder( @@ -65,22 +185,25 @@ class _SignUpScreenState extends State { ), 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 { 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 { }, 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 { Future _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 { void dispose() { _emailController.dispose(); _passwordController.dispose(); + _emailFocusNode.dispose(); + _passwordFocusNode.dispose(); super.dispose(); } } diff --git a/lib/screens/doctorScreens/doctorConsultationSchedule/business_center_screen.dart b/lib/screens/doctor_screen/doctor_consultation_schedule/business_center_screen.dart similarity index 100% rename from lib/screens/doctorScreens/doctorConsultationSchedule/business_center_screen.dart rename to lib/screens/doctor_screen/doctor_consultation_schedule/business_center_screen.dart diff --git a/lib/screens/doctorScreens/doctorConsultationSchedule/center_fee_and_duration_screen.dart b/lib/screens/doctor_screen/doctor_consultation_schedule/center_fee_and_duration_screen.dart similarity index 98% rename from lib/screens/doctorScreens/doctorConsultationSchedule/center_fee_and_duration_screen.dart rename to lib/screens/doctor_screen/doctor_consultation_schedule/center_fee_and_duration_screen.dart index eb0de20..e1fa206 100644 --- a/lib/screens/doctorScreens/doctorConsultationSchedule/center_fee_and_duration_screen.dart +++ b/lib/screens/doctor_screen/doctor_consultation_schedule/center_fee_and_duration_screen.dart @@ -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 { diff --git a/lib/screens/doctorScreens/doctorConsultationSchedule/consultation_day_screen.dart b/lib/screens/doctor_screen/doctor_consultation_schedule/consultation_day_screen.dart similarity index 99% rename from lib/screens/doctorScreens/doctorConsultationSchedule/consultation_day_screen.dart rename to lib/screens/doctor_screen/doctor_consultation_schedule/consultation_day_screen.dart index 00c5f11..cd96a06 100644 --- a/lib/screens/doctorScreens/doctorConsultationSchedule/consultation_day_screen.dart +++ b/lib/screens/doctor_screen/doctor_consultation_schedule/consultation_day_screen.dart @@ -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; diff --git a/lib/screens/doctorScreens/doctorConsultationSchedule/consultation_schedule.dart b/lib/screens/doctor_screen/doctor_consultation_schedule/consultation_schedule.dart similarity index 100% rename from lib/screens/doctorScreens/doctorConsultationSchedule/consultation_schedule.dart rename to lib/screens/doctor_screen/doctor_consultation_schedule/consultation_schedule.dart diff --git a/lib/screens/doctorScreens/doctorConsultationSchedule/consultation_time_slot_screen.dart b/lib/screens/doctor_screen/doctor_consultation_schedule/consultation_time_slot_screen.dart similarity index 100% rename from lib/screens/doctorScreens/doctorConsultationSchedule/consultation_time_slot_screen.dart rename to lib/screens/doctor_screen/doctor_consultation_schedule/consultation_time_slot_screen.dart diff --git a/lib/screens/doctorScreens/doctorDashboard/doctor_dashboard_home_screen.dart b/lib/screens/doctor_screen/doctor_dashboard/doctor_dashboard_home_screen.dart similarity index 98% rename from lib/screens/doctorScreens/doctorDashboard/doctor_dashboard_home_screen.dart rename to lib/screens/doctor_screen/doctor_dashboard/doctor_dashboard_home_screen.dart index 332a494..2e98593 100644 --- a/lib/screens/doctorScreens/doctorDashboard/doctor_dashboard_home_screen.dart +++ b/lib/screens/doctor_screen/doctor_dashboard/doctor_dashboard_home_screen.dart @@ -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}); diff --git a/lib/screens/doctorScreens/doctorDashboard/doctor_dashboard_screen.dart b/lib/screens/doctor_screen/doctor_dashboard/doctor_dashboard_screen.dart similarity index 86% rename from lib/screens/doctorScreens/doctorDashboard/doctor_dashboard_screen.dart rename to lib/screens/doctor_screen/doctor_dashboard/doctor_dashboard_screen.dart index 3ca0f9e..365002b 100644 --- a/lib/screens/doctorScreens/doctorDashboard/doctor_dashboard_screen.dart +++ b/lib/screens/doctor_screen/doctor_dashboard/doctor_dashboard_screen.dart @@ -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}); diff --git a/lib/screens/doctorScreens/doctorDashboard/doctor_landing_screen.dart b/lib/screens/doctor_screen/doctor_dashboard/doctor_landing_screen.dart similarity index 100% rename from lib/screens/doctorScreens/doctorDashboard/doctor_landing_screen.dart rename to lib/screens/doctor_screen/doctor_dashboard/doctor_landing_screen.dart diff --git a/lib/screens/doctorScreens/doctorDashboard/doctor_personal_profile_screen.dart b/lib/screens/doctor_screen/doctor_dashboard/doctor_personal_profile_screen.dart similarity index 100% rename from lib/screens/doctorScreens/doctorDashboard/doctor_personal_profile_screen.dart rename to lib/screens/doctor_screen/doctor_dashboard/doctor_personal_profile_screen.dart diff --git a/lib/screens/doctorScreens/doctorDashboard/doctor_services_menu_screen.dart b/lib/screens/doctor_screen/doctor_dashboard/doctor_services_menu_screen.dart similarity index 97% rename from lib/screens/doctorScreens/doctorDashboard/doctor_services_menu_screen.dart rename to lib/screens/doctor_screen/doctor_dashboard/doctor_services_menu_screen.dart index af37272..e372ca6 100644 --- a/lib/screens/doctorScreens/doctorDashboard/doctor_services_menu_screen.dart +++ b/lib/screens/doctor_screen/doctor_dashboard/doctor_services_menu_screen.dart @@ -88,11 +88,11 @@ class _DoctorServicesMenuScreen extends State { ], ), ), - const Icon( - Icons.chevron_right, - color: Colors.white, - size: 30, - ), + // const Icon( + // Icons.chevron_right, + // color: Colors.white, + // size: 30, + // ), ], ), ); diff --git a/lib/screens/doctorScreens/doctorProfileScreens/achivements_screen.dart b/lib/screens/doctor_screen/doctor_profile_screens/achivements_screen.dart similarity index 100% rename from lib/screens/doctorScreens/doctorProfileScreens/achivements_screen.dart rename to lib/screens/doctor_screen/doctor_profile_screens/achivements_screen.dart diff --git a/lib/screens/doctorScreens/doctorProfileScreens/address_screen.dart b/lib/screens/doctor_screen/doctor_profile_screens/address_screen.dart similarity index 89% rename from lib/screens/doctorScreens/doctorProfileScreens/address_screen.dart rename to lib/screens/doctor_screen/doctor_profile_screens/address_screen.dart index 2131156..e61743c 100644 --- a/lib/screens/doctorScreens/doctorProfileScreens/address_screen.dart +++ b/lib/screens/doctor_screen/doctor_profile_screens/address_screen.dart @@ -60,39 +60,19 @@ class _DoctorAddressScreenState extends State { _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 { _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 { 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 { 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; diff --git a/lib/screens/doctorScreens/doctorProfileScreens/digital_signature_screen.dart b/lib/screens/doctor_screen/doctor_profile_screens/digital_signature_screen.dart similarity index 100% rename from lib/screens/doctorScreens/doctorProfileScreens/digital_signature_screen.dart rename to lib/screens/doctor_screen/doctor_profile_screens/digital_signature_screen.dart diff --git a/lib/screens/doctorScreens/doctorProfileScreens/doctor_profile_screen.dart b/lib/screens/doctor_screen/doctor_profile_screens/doctor_profile_screen.dart similarity index 99% rename from lib/screens/doctorScreens/doctorProfileScreens/doctor_profile_screen.dart rename to lib/screens/doctor_screen/doctor_profile_screens/doctor_profile_screen.dart index d676952..299c057 100644 --- a/lib/screens/doctorScreens/doctorProfileScreens/doctor_profile_screen.dart +++ b/lib/screens/doctor_screen/doctor_profile_screens/doctor_profile_screen.dart @@ -242,7 +242,6 @@ class _ProfileUploadPageState extends State { children: [ _buildUniformField( label: 'Name', - icon: Icons.person, child: Container(), // The child parameter is not used in this implementation diff --git a/lib/screens/doctorScreens/doctorProfileScreens/experience_screen.dart b/lib/screens/doctor_screen/doctor_profile_screens/experience_screen.dart similarity index 100% rename from lib/screens/doctorScreens/doctorProfileScreens/experience_screen.dart rename to lib/screens/doctor_screen/doctor_profile_screens/experience_screen.dart diff --git a/lib/screens/doctorScreens/doctorProfileScreens/profile_description_screen.dart b/lib/screens/doctor_screen/doctor_profile_screens/profile_description_screen.dart similarity index 100% rename from lib/screens/doctorScreens/doctorProfileScreens/profile_description_screen.dart rename to lib/screens/doctor_screen/doctor_profile_screens/profile_description_screen.dart diff --git a/lib/screens/doctorScreens/doctorProfileScreens/qualifications_screen.dart b/lib/screens/doctor_screen/doctor_profile_screens/qualifications_screen.dart similarity index 100% rename from lib/screens/doctorScreens/doctorProfileScreens/qualifications_screen.dart rename to lib/screens/doctor_screen/doctor_profile_screens/qualifications_screen.dart diff --git a/lib/screens/doctorScreens/doctorProfileScreens/specialities_selection_screen.dart b/lib/screens/doctor_screen/doctor_profile_screens/specialities_selection_screen.dart similarity index 100% rename from lib/screens/doctorScreens/doctorProfileScreens/specialities_selection_screen.dart rename to lib/screens/doctor_screen/doctor_profile_screens/specialities_selection_screen.dart diff --git a/lib/screens/patientScreens/appoinmentBooking/consultation_booking_screen.dart b/lib/screens/patient_screens/appoinment_bookings/consultation_booking_screen.dart similarity index 100% rename from lib/screens/patientScreens/appoinmentBooking/consultation_booking_screen.dart rename to lib/screens/patient_screens/appoinment_bookings/consultation_booking_screen.dart diff --git a/lib/screens/patientScreens/appoinmentBooking/consultation_time_screen.dart b/lib/screens/patient_screens/appoinment_bookings/consultation_time_screen.dart similarity index 100% rename from lib/screens/patientScreens/appoinmentBooking/consultation_time_screen.dart rename to lib/screens/patient_screens/appoinment_bookings/consultation_time_screen.dart diff --git a/lib/screens/patientScreens/appoinmentBooking/consultations_center_screen.dart b/lib/screens/patient_screens/appoinment_bookings/consultations_center_screen.dart similarity index 100% rename from lib/screens/patientScreens/appoinmentBooking/consultations_center_screen.dart rename to lib/screens/patient_screens/appoinment_bookings/consultations_center_screen.dart diff --git a/lib/screens/patientScreens/appoinmentBooking/doctor_details_screen.dart b/lib/screens/patient_screens/appoinment_bookings/doctor_details_screen.dart similarity index 100% rename from lib/screens/patientScreens/appoinmentBooking/doctor_details_screen.dart rename to lib/screens/patient_screens/appoinment_bookings/doctor_details_screen.dart diff --git a/lib/screens/patientScreens/appoinmentBooking/doctors_list_screen.dart b/lib/screens/patient_screens/appoinment_bookings/doctors_list_screen.dart similarity index 100% rename from lib/screens/patientScreens/appoinmentBooking/doctors_list_screen.dart rename to lib/screens/patient_screens/appoinment_bookings/doctors_list_screen.dart diff --git a/lib/screens/patientScreens/appoinmentBooking/speciality_screen.dart b/lib/screens/patient_screens/appoinment_bookings/speciality_screen.dart similarity index 100% rename from lib/screens/patientScreens/appoinmentBooking/speciality_screen.dart rename to lib/screens/patient_screens/appoinment_bookings/speciality_screen.dart diff --git a/lib/screens/patientScreens/patientDashboard/patient_dashboard_screen.dart b/lib/screens/patient_screens/patient_dashboard/patient_dashboard_screen.dart similarity index 91% rename from lib/screens/patientScreens/patientDashboard/patient_dashboard_screen.dart rename to lib/screens/patient_screens/patient_dashboard/patient_dashboard_screen.dart index 39eff1b..9b82a9b 100644 --- a/lib/screens/patientScreens/patientDashboard/patient_dashboard_screen.dart +++ b/lib/screens/patient_screens/patient_dashboard/patient_dashboard_screen.dart @@ -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}); diff --git a/lib/screens/patientScreens/patientDashboard/patient_home_screen.dart b/lib/screens/patient_screens/patient_dashboard/patient_home_screen.dart similarity index 99% rename from lib/screens/patientScreens/patientDashboard/patient_home_screen.dart rename to lib/screens/patient_screens/patient_dashboard/patient_home_screen.dart index 6c21ef3..bc04b16 100644 --- a/lib/screens/patientScreens/patientDashboard/patient_home_screen.dart +++ b/lib/screens/patient_screens/patient_dashboard/patient_home_screen.dart @@ -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}); diff --git a/lib/screens/patientScreens/patientDashboard/patient_profile_screen.dart b/lib/screens/patient_screens/patient_dashboard/patient_profile_screen.dart similarity index 100% rename from lib/screens/patientScreens/patientDashboard/patient_profile_screen.dart rename to lib/screens/patient_screens/patient_dashboard/patient_profile_screen.dart diff --git a/lib/screens/patientScreens/patient_landing_screen.dart b/lib/screens/patient_screens/patient_landing_screen.dart similarity index 100% rename from lib/screens/patientScreens/patient_landing_screen.dart rename to lib/screens/patient_screens/patient_landing_screen.dart diff --git a/lib/screens/patientScreens/registrationScreens/family_members_edit_screen.dart b/lib/screens/patient_screens/registration_screens/family_members_edit_screen.dart similarity index 100% rename from lib/screens/patientScreens/registrationScreens/family_members_edit_screen.dart rename to lib/screens/patient_screens/registration_screens/family_members_edit_screen.dart diff --git a/lib/screens/patientScreens/registrationScreens/patient_adress_screen.dart b/lib/screens/patient_screens/registration_screens/patient_adress_screen.dart similarity index 100% rename from lib/screens/patientScreens/registrationScreens/patient_adress_screen.dart rename to lib/screens/patient_screens/registration_screens/patient_adress_screen.dart diff --git a/lib/screens/patientScreens/registrationScreens/patient_family_members_screen.dart b/lib/screens/patient_screens/registration_screens/patient_family_members_screen.dart similarity index 98% rename from lib/screens/patientScreens/registrationScreens/patient_family_members_screen.dart rename to lib/screens/patient_screens/registration_screens/patient_family_members_screen.dart index 58f9e45..8798934 100644 --- a/lib/screens/patientScreens/registrationScreens/patient_family_members_screen.dart +++ b/lib/screens/patient_screens/registration_screens/patient_family_members_screen.dart @@ -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'; diff --git a/lib/screens/patientScreens/registrationScreens/patient_registration_screen.dart b/lib/screens/patient_screens/registration_screens/patient_registration_screen.dart similarity index 100% rename from lib/screens/patientScreens/registrationScreens/patient_registration_screen.dart rename to lib/screens/patient_screens/registration_screens/patient_registration_screen.dart diff --git a/lib/services/data_service.dart b/lib/services/data_service.dart deleted file mode 100644 index b9f78bb..0000000 --- a/lib/services/data_service.dart +++ /dev/null @@ -1 +0,0 @@ -// TODO Implement this library. \ No newline at end of file