diff --git a/healthway_app/ios/Flutter/flutter_export_environment.sh b/healthway_app/ios/Flutter/flutter_export_environment.sh index 4f46fa9..770f09b 100755 --- a/healthway_app/ios/Flutter/flutter_export_environment.sh +++ b/healthway_app/ios/Flutter/flutter_export_environment.sh @@ -3,11 +3,11 @@ export "FLUTTER_ROOT=/home/kaua/flutter" export "FLUTTER_APPLICATION_PATH=/home/kaua/VSCode/Healthway/healthway_app" export "COCOAPODS_PARALLEL_CODE_SIGN=true" -export "FLUTTER_TARGET=/Users/lemuelcavalcante/Documents/engenharia2/Healthway/healthway_app/lib/main.dart" +export "FLUTTER_TARGET=lib/main.dart" export "FLUTTER_BUILD_DIR=build" export "FLUTTER_BUILD_NAME=1.0.0" export "FLUTTER_BUILD_NUMBER=1" export "DART_OBFUSCATION=false" export "TRACK_WIDGET_CREATION=true" export "TREE_SHAKE_ICONS=false" -export "PACKAGE_CONFIG=/Users/lemuelcavalcante/Documents/engenharia2/Healthway/healthway_app/.dart_tool/package_config.json" +export "PACKAGE_CONFIG=.dart_tool/package_config.json" diff --git a/healthway_app/lib/geral_screens/alimentos_screen.dart b/healthway_app/lib/geral_screens/alimentos_screen.dart index 7430517..99213a5 100644 --- a/healthway_app/lib/geral_screens/alimentos_screen.dart +++ b/healthway_app/lib/geral_screens/alimentos_screen.dart @@ -168,3 +168,7 @@ class _AlimentosScreenState extends State { ); } } + +extension on Color { + withValues({required double alpha}) {} +} diff --git a/healthway_app/lib/screens_nutricionist/nutritionist_dashboard_screen.dart b/healthway_app/lib/screens_nutricionist/nutritionist_dashboard_screen.dart index 960857a..73f3078 100644 --- a/healthway_app/lib/screens_nutricionist/nutritionist_dashboard_screen.dart +++ b/healthway_app/lib/screens_nutricionist/nutritionist_dashboard_screen.dart @@ -476,3 +476,7 @@ class NutritionistDashboardScreen extends StatelessWidget { ); } } + +extension on Color { + withValues({required double alpha}) {} +} diff --git a/healthway_app/lib/screens_nutricionist/schedule_screen.dart b/healthway_app/lib/screens_nutricionist/schedule_screen.dart index 751a963..178d56d 100644 --- a/healthway_app/lib/screens_nutricionist/schedule_screen.dart +++ b/healthway_app/lib/screens_nutricionist/schedule_screen.dart @@ -189,6 +189,10 @@ class _ScheduleScreenState extends State { } } +extension on Color { + withValues({required double alpha}) {} +} + class Appointment { final String patientName; final String type; diff --git a/healthway_app/lib/screens_patient/healthScreen.dart b/healthway_app/lib/screens_patient/healthScreen.dart index 2ba55c6..9d11335 100644 --- a/healthway_app/lib/screens_patient/healthScreen.dart +++ b/healthway_app/lib/screens_patient/healthScreen.dart @@ -217,3 +217,7 @@ class DietManagementScreen extends StatelessWidget { ); } } + +extension on Color { + withValues({required double alpha}) {} +} diff --git a/healthway_app/lib/screens_patient/notificationScreen.dart b/healthway_app/lib/screens_patient/notificationScreen.dart index 1c9d733..825a73d 100644 --- a/healthway_app/lib/screens_patient/notificationScreen.dart +++ b/healthway_app/lib/screens_patient/notificationScreen.dart @@ -87,3 +87,7 @@ class NotificationScreen extends StatelessWidget { ); } } + +extension on Color { + withValues({required double alpha}) {} +} diff --git a/healthway_app/lib/screens_patient/patient_dashboard_screen.dart b/healthway_app/lib/screens_patient/patient_dashboard_screen.dart index 2260ded..9b86df0 100644 --- a/healthway_app/lib/screens_patient/patient_dashboard_screen.dart +++ b/healthway_app/lib/screens_patient/patient_dashboard_screen.dart @@ -386,3 +386,7 @@ class PatientDashboardScreen extends StatelessWidget { return peso / (alturaCm * alturaCm); } } + +extension on Color { + withValues({required double alpha}) {} +} diff --git a/healthway_app/lib/screens_patient/patient_profile_screen.dart b/healthway_app/lib/screens_patient/patient_profile_screen.dart index ebc88e0..a8a2904 100644 --- a/healthway_app/lib/screens_patient/patient_profile_screen.dart +++ b/healthway_app/lib/screens_patient/patient_profile_screen.dart @@ -382,3 +382,7 @@ class _PatientProfileScreenState extends State { return 'Obeso'; } } + +extension on Color { + withValues({required double alpha}) {} +} diff --git a/healthway_app/lib/widgets/alimento_item.dart b/healthway_app/lib/widgets/alimento_item.dart index c1f0bc9..a2b08ce 100644 --- a/healthway_app/lib/widgets/alimento_item.dart +++ b/healthway_app/lib/widgets/alimento_item.dart @@ -99,3 +99,7 @@ class AlimentoItem extends StatelessWidget { ); } } + +extension on Color { + withValues({required double alpha}) {} +} diff --git a/healthway_app/lib/widgets/chat_input_field.dart b/healthway_app/lib/widgets/chat_input_field.dart index 28d15bd..8e806cc 100644 --- a/healthway_app/lib/widgets/chat_input_field.dart +++ b/healthway_app/lib/widgets/chat_input_field.dart @@ -91,3 +91,7 @@ class _ChatInputFieldState extends State { ); } } + +extension on Color { + withValues({required double alpha}) {} +} diff --git a/healthway_app/lib/widgets/chat_message_bubble.dart b/healthway_app/lib/widgets/chat_message_bubble.dart index d8b580e..62f9ee0 100644 --- a/healthway_app/lib/widgets/chat_message_bubble.dart +++ b/healthway_app/lib/widgets/chat_message_bubble.dart @@ -77,3 +77,7 @@ class ChatMessageBubble extends StatelessWidget { ); } } + +extension on Color { + withValues({required double alpha}) {} +} diff --git a/healthway_app/test/nutricionista_dashboard_screen_test.dart b/healthway_app/test/nutricionista_dashboard_screen_test.dart new file mode 100644 index 0000000..1ca5062 --- /dev/null +++ b/healthway_app/test/nutricionista_dashboard_screen_test.dart @@ -0,0 +1,54 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:healthway_app/screens_nutricionist/nutritionist_dashboard_screen.dart'; + +void main() { + testWidgets('NutritionistDashboardScreen displays correctly', (WidgetTester tester) async { + // Build the NutritionistDashboardScreen widget. + await tester.pumpWidget(MaterialApp(home: NutritionistDashboardScreen(userData: {},))); + + // Verify if the background color is correct. + final scaffold = tester.widget(find.byType(Scaffold)); + expect(scaffold.backgroundColor, const Color(0xFFE6F7F8)); + + // Verify if the AppBar widget is present. + expect(find.byType(AppBar), findsOneWidget); + + // Verify if the Icon widget is present. + expect(find.byType(Icon), findsOneWidget); + + // Verify if the Padding widget is present. + expect(find.byType(Padding), findsOneWidget); + + // Verify if the Form widget is present. + expect(find.byType(Form), findsOneWidget); + + // Verify if the TextFormField widget is present. + expect(find.byType(TextFormField), findsNWidgets(2)); + + // Verify if the ElevatedButton widget is present. + expect(find.byType(ElevatedButton), findsOneWidget); + + // Verify if the CircularProgressIndicator widget is present. + expect(find.byType(CircularProgressIndicator), findsNothing); + + // Add more specific tests for the widgets inside the Column as needed. + }); + + testWidgets('NutritionistDashboardScreen displays CircularProgressIndicator when loading', (WidgetTester tester) async { + // Build the NutritionistDashboardScreen widget. + await tester.pumpWidget(MaterialApp(home: NutritionistDashboardScreen(userData: {},))); + + // Verify if the CircularProgressIndicator widget is present. + expect(find.byType(CircularProgressIndicator), findsNothing); + + // Tap the ElevatedButton to simulate a loading state. + await tester.tap(find.byType(ElevatedButton)); + await tester.pump(); + + // Verify if the CircularProgressIndicator widget is present. + expect(find.byType(CircularProgressIndicator), findsOneWidget); + }); + + +} \ No newline at end of file