From dec44c605dfa68b6c7a6d0030ed632b5ed04f2d8 Mon Sep 17 00:00:00 2001 From: Banghua Zhao Date: Thu, 17 Oct 2024 17:01:24 +1300 Subject: [PATCH] Migrate function tools repository to data source --- data/lib/data.dart | 5 ++--- .../function_tools_data_source.dart} | 21 +++++++++++-------- data/lib/data_sources/local_data_source.dart | 3 +++ ...a_source.dart => open_ai_data_source.dart} | 4 ++-- .../repositories/chat_repository_impl.dart | 18 +++++++++------- .../chat_repository.dart | 4 +--- domain/lib/usecases/chat_usecase.dart | 14 +++++-------- lib/injection_container.dart | 19 +++++++---------- lib/presentation/bottom_navigator.dart | 1 - .../chat/viewModels/chat_view_model.dart | 19 ----------------- .../chat/views/chat_message_list.dart | 1 - lib/presentation/chat/views/chat_screen.dart | 1 - .../chat/views/chat_session_drawer.dart | 1 - .../more/login/forget_password_page.dart | 1 - lib/presentation/more/more_page.dart | 2 -- .../tools/model/DescriptionModels.dart | 1 - .../page/UDFRC_rules_of_mixture_page.dart | 2 -- .../UDFRC_rules_of_mixture_result_page.dart | 1 - .../lamina_engineering_constants_page.dart | 1 - .../tools/page/lamina_stress_strain_page.dart | 4 ---- .../page/laminate_3d_properties_page.dart | 5 ----- .../laminate_3d_properties_result_page.dart | 1 - .../page/laminate_plate_properties_page.dart | 1 - ...laminate_plate_properties_result_page.dart | 2 -- .../page/laminate_stress_strain_page.dart | 3 --- .../laminate_stress_strain_result_page.dart | 1 - lib/presentation/tools/page/tool_page.dart | 2 -- .../tools/widget/description.dart | 1 - .../tools/widget/isotropic_material_row.dart | 1 - .../isotropic_thermal_constants_row.dart | 1 - .../tools/widget/lamina_constants_row.dart | 1 - .../widget/laminate_stress_strain_row.dart | 1 - .../tools/widget/layer_thickness_row.dart | 1 - .../tools/widget/layup_sequence_row.dart | 1 - .../widget/orthotropic_properties_widget.dart | 1 - .../tools/widget/plane_stress_strain_row.dart | 1 - .../tools/widget/result_3by3_matrix.dart | 1 - .../tools/widget/result_6by6_matrix.dart | 1 - .../widget/transversely_isotropic_row.dart | 1 - .../transversely_thermal_constants_row.dart | 1 - .../tools/widget/volume_fraction_row.dart | 1 - test/feature_flag_provider_test.dart | 1 - 42 files changed, 42 insertions(+), 111 deletions(-) rename data/lib/{repositories/function_tools_repository_imp.dart => data_sources/function_tools_data_source.dart} (94%) create mode 100644 data/lib/data_sources/local_data_source.dart rename data/lib/data_sources/{chat_completion_data_source.dart => open_ai_data_source.dart} (95%) diff --git a/data/lib/data.dart b/data/lib/data.dart index 7a75702..00b096c 100644 --- a/data/lib/data.dart +++ b/data/lib/data.dart @@ -1,5 +1,4 @@ export 'utils/network_exceptions.dart'; -export 'data_sources/chat_completion_data_source.dart'; +export 'data_sources/open_ai_data_source.dart'; export 'repositories/chat_repository_impl.dart'; -export 'repositories/chat_session_repository_imp.dart'; -export "repositories/function_tools_repository_imp.dart"; \ No newline at end of file +export 'repositories/chat_session_repository_imp.dart'; \ No newline at end of file diff --git a/data/lib/repositories/function_tools_repository_imp.dart b/data/lib/data_sources/function_tools_data_source.dart similarity index 94% rename from data/lib/repositories/function_tools_repository_imp.dart rename to data/lib/data_sources/function_tools_data_source.dart index 34ec54f..089a9e9 100644 --- a/data/lib/repositories/function_tools_repository_imp.dart +++ b/data/lib/data_sources/function_tools_data_source.dart @@ -1,7 +1,10 @@ import 'package:domain/entities/function_tool.dart'; -import 'package:domain/repositories_abstract/function_tools_repository.dart'; -class FunctionToolsRepositoryImp extends FunctionToolsRepository { +abstract class FunctionToolsDataSource { + List getAllFunctionTools(); +} + +class FunctionToolsDataSourceImp implements FunctionToolsDataSource { String get commonDescription => "Display the default input parameters first. Allow the user to either proceed with these default values or modify them as needed. Based on the user’s decision to either keep or change the parameters, continue with the appropriate calculation process, ensure that all modifications are used in the calculation to reflect the user’s preferences accurately."; @@ -10,7 +13,7 @@ class FunctionToolsRepositoryImp extends FunctionToolsRepository { FunctionTool calculateLaminaEngineeringConstantsTool = FunctionTool( name: "calculate_lamina_engineering_constants", description: - "Calculates the engineering constants for a lamina. $commonDescription", + "Calculates the engineering constants for a lamina. $commonDescription", parameters: { "type": "object", "required": ["E1", "E2", "G12", "nu12", "layup_angle"], @@ -92,7 +95,7 @@ class FunctionToolsRepositoryImp extends FunctionToolsRepository { FunctionTool calculateLaminatePlatePropertiesTool = FunctionTool( name: "calculate_laminate_plate_properties", description: - "Calculates the laminate plate properties. $commonDescription", + "Calculates the laminate plate properties. $commonDescription", parameters: { "type": "object", "required": [ @@ -124,7 +127,7 @@ class FunctionToolsRepositoryImp extends FunctionToolsRepository { FunctionTool calculateLaminate3DPropertiesTool = FunctionTool( name: "calculate_laminate_3d_properties", description: - "Calculates the laminate plate properties. $commonDescription", + "Calculates the laminate plate properties. $commonDescription", parameters: { "type": "object", "required": [ @@ -163,7 +166,7 @@ class FunctionToolsRepositoryImp extends FunctionToolsRepository { FunctionTool calculateLaminarStrainTool = FunctionTool( name: "calculate_laminar_strain", description: - "Calculates the strains for a laminar/laminate. $commonDescription", + "Calculates the strains for a laminar/laminate. $commonDescription", parameters: { "type": "object", "required": [ @@ -207,7 +210,7 @@ class FunctionToolsRepositoryImp extends FunctionToolsRepository { FunctionTool calculateLaminarStressTool = FunctionTool( name: "calculate_laminar_stress", description: - "Calculates the stress for a laminar/laminate. $commonDescription", + "Calculates the stress for a laminar/laminate. $commonDescription", parameters: { "type": "object", "required": [ @@ -251,7 +254,7 @@ class FunctionToolsRepositoryImp extends FunctionToolsRepository { FunctionTool calculateUDFRCRulesOfMixtureTool = FunctionTool( name: "calculate_UDFRC_rules_of_mixture", description: - "Calculates the UDFRC (Unidirectional fibre-reinforced composites) properties by rules of mixture. $commonDescription", + "Calculates the UDFRC (Unidirectional fibre-reinforced composites) properties by rules of mixture. $commonDescription", parameters: { "type": "object", "required": [ @@ -322,4 +325,4 @@ class FunctionToolsRepositoryImp extends FunctionToolsRepository { calculateUDFRCRulesOfMixtureTool ]; } -} +} \ No newline at end of file diff --git a/data/lib/data_sources/local_data_source.dart b/data/lib/data_sources/local_data_source.dart new file mode 100644 index 0000000..bba3598 --- /dev/null +++ b/data/lib/data_sources/local_data_source.dart @@ -0,0 +1,3 @@ +class LocalDataSource { + +} \ No newline at end of file diff --git a/data/lib/data_sources/chat_completion_data_source.dart b/data/lib/data_sources/open_ai_data_source.dart similarity index 95% rename from data/lib/data_sources/chat_completion_data_source.dart rename to data/lib/data_sources/open_ai_data_source.dart index 9d01d4e..e2fcc8b 100644 --- a/data/lib/data_sources/chat_completion_data_source.dart +++ b/data/lib/data_sources/open_ai_data_source.dart @@ -6,11 +6,11 @@ import '../models/chat_chunk.dart'; import '../utils/api_constants.dart'; import '../utils/network_exceptions.dart'; -abstract class ChatCompletionsDataSource { +abstract class OpenAIDataSource { Stream sendMessages(List messages, List functionTools); } -class ChatRemoteDataSourceImpl implements ChatCompletionsDataSource { +class ChatRemoteDataSourceImpl implements OpenAIDataSource { final http.Client client; ChatRemoteDataSourceImpl({required this.client}); diff --git a/data/lib/repositories/chat_repository_impl.dart b/data/lib/repositories/chat_repository_impl.dart index 9b782fe..6204cf6 100644 --- a/data/lib/repositories/chat_repository_impl.dart +++ b/data/lib/repositories/chat_repository_impl.dart @@ -1,25 +1,27 @@ import 'dart:async'; -import 'package:domain/entities/function_tool.dart'; import 'package:domain/entities/message.dart'; import 'package:domain/repositories_abstract/chat_repository.dart'; -import '../data_sources/chat_completion_data_source.dart'; +import '../data_sources/function_tools_data_source.dart'; +import '../data_sources/open_ai_data_source.dart'; import '../models/chat_chunk.dart'; class ChatRepositoryImp implements ChatRepository { - final ChatCompletionsDataSource chatCompletionsDataSource; + final OpenAIDataSource openAIDataSource; + final FunctionToolsDataSource functionToolsDataSource; - ChatRepositoryImp({required this.chatCompletionsDataSource}); + ChatRepositoryImp( + {required this.openAIDataSource, required this.functionToolsDataSource}); @override - Stream sendMessages( - List messages, List functionTools) { + Stream sendMessages(List messages) { // Create a StreamController to accumulate and emit the content as strings final StreamController controller = StreamController(); + final functionTools = functionToolsDataSource.getAllFunctionTools(); + // Call the original sendMessages method that returns Stream - final chatChunks = - chatCompletionsDataSource.sendMessages(messages, functionTools); + final chatChunks = openAIDataSource.sendMessages(messages, functionTools); Message buffer = Message(role: "assistant"); // Listen to the incoming stream of ChatChunks diff --git a/domain/lib/repositories_abstract/chat_repository.dart b/domain/lib/repositories_abstract/chat_repository.dart index 8e24c52..1c40286 100644 --- a/domain/lib/repositories_abstract/chat_repository.dart +++ b/domain/lib/repositories_abstract/chat_repository.dart @@ -1,7 +1,5 @@ -import '../entities/function_tool.dart'; import '../entities/message.dart'; abstract class ChatRepository { - Stream sendMessages(List messages, - List functionTools); + Stream sendMessages(List messages); } diff --git a/domain/lib/usecases/chat_usecase.dart b/domain/lib/usecases/chat_usecase.dart index a04ec84..5e96231 100644 --- a/domain/lib/usecases/chat_usecase.dart +++ b/domain/lib/usecases/chat_usecase.dart @@ -1,23 +1,19 @@ -import '../entities/function_tool.dart'; import '../entities/message.dart'; import '../repositories_abstract/chat_repository.dart'; -import '../repositories_abstract/function_tools_repository.dart'; class ChatUseCase { final ChatRepository chatRepository; - final FunctionToolsRepository functionToolsRepository; - ChatUseCase({required this.chatRepository, required this.functionToolsRepository}); + ChatUseCase( + {required this.chatRepository}); final Message systemMessage = Message( role: "system", content: - "You are an expert in composite materials and structures. Please answer questions related to composites design and manufacturing."); + "You are an expert in composite materials and structures. Please answer questions related to composites design and manufacturing."); Stream sendMessages(List messages) { final chatHistory = [systemMessage] + messages; - final functionTools = functionToolsRepository.getAllFunctionTools(); - return chatRepository.sendMessages( - chatHistory, functionTools); + return chatRepository.sendMessages(chatHistory); } -} \ No newline at end of file +} diff --git a/lib/injection_container.dart b/lib/injection_container.dart index 31edcdf..5f91d63 100644 --- a/lib/injection_container.dart +++ b/lib/injection_container.dart @@ -1,13 +1,8 @@ -import 'package:data/data_sources/chat_completion_data_source.dart'; +import 'package:data/data_sources/function_tools_data_source.dart'; +import 'package:data/data_sources/open_ai_data_source.dart'; import 'package:data/repositories/chat_repository_impl.dart'; import 'package:data/repositories/chat_session_repository_imp.dart'; -import 'package:data/repositories/function_tools_repository_imp.dart'; import 'package:domain/domain.dart'; -import 'package:domain/repositories_abstract/chat_repository.dart'; -import 'package:domain/repositories_abstract/chat_session_repository.dart'; -import 'package:domain/repositories_abstract/function_tools_repository.dart'; -import 'package:domain/usecases/chat_session_usecase.dart'; -import 'package:domain/usecases/chat_usecase.dart'; import 'package:get_it/get_it.dart'; import 'package:http/http.dart' as http; import 'presentation/chat/viewModels/chat_view_model.dart'; @@ -21,22 +16,22 @@ void initInjection() { // Use Cases sl.registerLazySingleton( - () => ChatUseCase(chatRepository: sl(), functionToolsRepository: sl())); + () => ChatUseCase(chatRepository: sl())); sl.registerLazySingleton( () => ChatSessionUseCase(repository: sl())); // Repositories sl.registerLazySingleton( - () => ChatRepositoryImp(chatCompletionsDataSource: sl())); + () => ChatRepositoryImp(openAIDataSource: sl(), functionToolsDataSource: sl())); sl.registerLazySingleton( () => ChatSessionRepositoryImpl()); - sl.registerLazySingleton( - () => FunctionToolsRepositoryImp()); // Data Sources - sl.registerLazySingleton( + sl.registerLazySingleton( () => ChatRemoteDataSourceImpl(client: sl())); + sl.registerLazySingleton( + () => FunctionToolsDataSourceImp()); // External sl.registerLazySingleton(() => http.Client()); diff --git a/lib/presentation/bottom_navigator.dart b/lib/presentation/bottom_navigator.dart index f794567..7388c6b 100644 --- a/lib/presentation/bottom_navigator.dart +++ b/lib/presentation/bottom_navigator.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:swiftcomp/presentation/more/feature_flag_provider.dart'; diff --git a/lib/presentation/chat/viewModels/chat_view_model.dart b/lib/presentation/chat/viewModels/chat_view_model.dart index 88a82d3..7c85783 100644 --- a/lib/presentation/chat/viewModels/chat_view_model.dart +++ b/lib/presentation/chat/viewModels/chat_view_model.dart @@ -1,28 +1,9 @@ import 'dart:convert'; -import 'package:composite_calculator/calculators/lamina_engineering_constants_calculator.dart'; -import 'package:composite_calculator/calculators/lamina_stress_strain_calculator.dart'; -import 'package:composite_calculator/calculators/laminar_stress_strain_calculator.dart'; -import 'package:composite_calculator/calculators/laminate_3d_properties_calculator.dart'; -import 'package:composite_calculator/calculators/laminate_plate_properties_calculator.dart'; import 'package:composite_calculator/composite_calculator.dart'; -import 'package:composite_calculator/models/lamina_engineering_constants_input.dart'; -import 'package:composite_calculator/models/lamina_engineering_constants_output.dart'; -import 'package:composite_calculator/models/lamina_stress_strain_input.dart'; -import 'package:composite_calculator/models/lamina_stress_strain_output.dart'; -import 'package:composite_calculator/models/laminar_stress_strain_input.dart'; -import 'package:composite_calculator/models/laminar_stress_strain_output.dart'; -import 'package:composite_calculator/models/laminate_3d_properties_input.dart'; -import 'package:composite_calculator/models/laminate_3d_properties_output.dart'; -import 'package:composite_calculator/models/laminate_plate_properties_input.dart'; -import 'package:composite_calculator/models/laminate_plate_properties_output.dart'; import 'package:composite_calculator/models/tensor_type.dart'; import 'package:domain/domain.dart'; -import 'package:domain/entities/chat_session.dart'; -import 'package:domain/entities/message.dart'; -import 'package:domain/usecases/chat_session_usecase.dart'; -import 'package:domain/usecases/chat_usecase.dart'; import 'package:flutter/cupertino.dart'; class ChatViewModel extends ChangeNotifier { diff --git a/lib/presentation/chat/views/chat_message_list.dart b/lib/presentation/chat/views/chat_message_list.dart index e45656c..80a006e 100644 --- a/lib/presentation/chat/views/chat_message_list.dart +++ b/lib/presentation/chat/views/chat_message_list.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; diff --git a/lib/presentation/chat/views/chat_screen.dart b/lib/presentation/chat/views/chat_screen.dart index faa2473..48f0ccf 100644 --- a/lib/presentation/chat/views/chat_screen.dart +++ b/lib/presentation/chat/views/chat_screen.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; diff --git a/lib/presentation/chat/views/chat_session_drawer.dart b/lib/presentation/chat/views/chat_session_drawer.dart index 9c21dd7..724e27b 100644 --- a/lib/presentation/chat/views/chat_session_drawer.dart +++ b/lib/presentation/chat/views/chat_session_drawer.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; diff --git a/lib/presentation/more/login/forget_password_page.dart b/lib/presentation/more/login/forget_password_page.dart index 23f31f6..e8b7532 100644 --- a/lib/presentation/more/login/forget_password_page.dart +++ b/lib/presentation/more/login/forget_password_page.dart @@ -1,4 +1,3 @@ -import 'package:amplify_auth_cognito/amplify_auth_cognito.dart'; import 'package:amplify_flutter/amplify_flutter.dart'; import 'package:flutter/material.dart'; import 'package:fluttertoast/fluttertoast.dart'; diff --git a/lib/presentation/more/more_page.dart b/lib/presentation/more/more_page.dart index 917e3a9..8f4ab30 100644 --- a/lib/presentation/more/more_page.dart +++ b/lib/presentation/more/more_page.dart @@ -1,9 +1,7 @@ import 'dart:io'; -import 'package:amplify_auth_cognito/amplify_auth_cognito.dart'; import 'package:amplify_flutter/amplify_flutter.dart'; import 'package:device_info/device_info.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_progress_hud/flutter_progress_hud.dart'; import 'package:fluttertoast/fluttertoast.dart'; diff --git a/lib/presentation/tools/model/DescriptionModels.dart b/lib/presentation/tools/model/DescriptionModels.dart index f70fef7..37b48bb 100644 --- a/lib/presentation/tools/model/DescriptionModels.dart +++ b/lib/presentation/tools/model/DescriptionModels.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_math_fork/flutter_math.dart'; diff --git a/lib/presentation/tools/page/UDFRC_rules_of_mixture_page.dart b/lib/presentation/tools/page/UDFRC_rules_of_mixture_page.dart index da9d1a5..18e2db8 100644 --- a/lib/presentation/tools/page/UDFRC_rules_of_mixture_page.dart +++ b/lib/presentation/tools/page/UDFRC_rules_of_mixture_page.dart @@ -1,6 +1,4 @@ import 'package:composite_calculator/composite_calculator.dart'; -import 'package:composite_calculator/models/UDFRC_rules_of_mixture_input.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import 'package:swiftcomp/generated/l10n.dart'; diff --git a/lib/presentation/tools/page/UDFRC_rules_of_mixture_result_page.dart b/lib/presentation/tools/page/UDFRC_rules_of_mixture_result_page.dart index b283867..a304927 100644 --- a/lib/presentation/tools/page/UDFRC_rules_of_mixture_result_page.dart +++ b/lib/presentation/tools/page/UDFRC_rules_of_mixture_result_page.dart @@ -1,5 +1,4 @@ import 'package:composite_calculator/composite_calculator.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import 'package:swiftcomp/generated/l10n.dart'; diff --git a/lib/presentation/tools/page/lamina_engineering_constants_page.dart b/lib/presentation/tools/page/lamina_engineering_constants_page.dart index fa38b28..829f94d 100644 --- a/lib/presentation/tools/page/lamina_engineering_constants_page.dart +++ b/lib/presentation/tools/page/lamina_engineering_constants_page.dart @@ -1,5 +1,4 @@ import 'package:composite_calculator/composite_calculator.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import 'package:swiftcomp/generated/l10n.dart'; diff --git a/lib/presentation/tools/page/lamina_stress_strain_page.dart b/lib/presentation/tools/page/lamina_stress_strain_page.dart index 678f875..141b504 100644 --- a/lib/presentation/tools/page/lamina_stress_strain_page.dart +++ b/lib/presentation/tools/page/lamina_stress_strain_page.dart @@ -1,9 +1,5 @@ -import 'package:composite_calculator/calculators/lamina_stress_strain_calculator.dart'; import 'package:composite_calculator/composite_calculator.dart'; -import 'package:composite_calculator/models/lamina_stress_strain_input.dart'; -import 'package:composite_calculator/models/lamina_stress_strain_output.dart'; import 'package:composite_calculator/models/tensor_type.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import 'package:swiftcomp/generated/l10n.dart'; diff --git a/lib/presentation/tools/page/laminate_3d_properties_page.dart b/lib/presentation/tools/page/laminate_3d_properties_page.dart index 7234e53..7e30d26 100644 --- a/lib/presentation/tools/page/laminate_3d_properties_page.dart +++ b/lib/presentation/tools/page/laminate_3d_properties_page.dart @@ -1,11 +1,6 @@ -import 'dart:math'; - import 'package:composite_calculator/composite_calculator.dart'; -import 'package:composite_calculator/models/laminate_3d_properties_input.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; -import 'package:linalg/linalg.dart'; import 'package:swiftcomp/generated/l10n.dart'; import 'package:swiftcomp/presentation/tools/model/layer_thickness.dart'; import 'package:swiftcomp/presentation/tools/model/layup_sequence_model.dart'; diff --git a/lib/presentation/tools/page/laminate_3d_properties_result_page.dart b/lib/presentation/tools/page/laminate_3d_properties_result_page.dart index 4efb8ab..e3d4fd9 100644 --- a/lib/presentation/tools/page/laminate_3d_properties_result_page.dart +++ b/lib/presentation/tools/page/laminate_3d_properties_result_page.dart @@ -1,5 +1,4 @@ import 'package:composite_calculator/composite_calculator.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import 'package:swiftcomp/generated/l10n.dart'; diff --git a/lib/presentation/tools/page/laminate_plate_properties_page.dart b/lib/presentation/tools/page/laminate_plate_properties_page.dart index b18c496..0d17f44 100644 --- a/lib/presentation/tools/page/laminate_plate_properties_page.dart +++ b/lib/presentation/tools/page/laminate_plate_properties_page.dart @@ -1,5 +1,4 @@ import 'package:composite_calculator/composite_calculator.dart'; -import 'package:composite_calculator/models/analysis_type.dart'; import 'package:flutter/material.dart'; import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import 'package:swiftcomp/generated/l10n.dart'; diff --git a/lib/presentation/tools/page/laminate_plate_properties_result_page.dart b/lib/presentation/tools/page/laminate_plate_properties_result_page.dart index a2b6602..a6ee556 100644 --- a/lib/presentation/tools/page/laminate_plate_properties_result_page.dart +++ b/lib/presentation/tools/page/laminate_plate_properties_result_page.dart @@ -1,5 +1,3 @@ -import 'dart:math'; - import 'package:composite_calculator/composite_calculator.dart'; import 'package:composite_calculator/models/in-plane-properties.dart'; import 'package:flutter/material.dart'; diff --git a/lib/presentation/tools/page/laminate_stress_strain_page.dart b/lib/presentation/tools/page/laminate_stress_strain_page.dart index b778e10..5897935 100644 --- a/lib/presentation/tools/page/laminate_stress_strain_page.dart +++ b/lib/presentation/tools/page/laminate_stress_strain_page.dart @@ -1,9 +1,6 @@ -import 'dart:math'; - import 'package:composite_calculator/composite_calculator.dart'; import 'package:composite_calculator/models/laminar_stress_strain_input.dart'; import 'package:composite_calculator/models/tensor_type.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import 'package:linalg/linalg.dart'; diff --git a/lib/presentation/tools/page/laminate_stress_strain_result_page.dart b/lib/presentation/tools/page/laminate_stress_strain_result_page.dart index debbfde..70014be 100644 --- a/lib/presentation/tools/page/laminate_stress_strain_result_page.dart +++ b/lib/presentation/tools/page/laminate_stress_strain_result_page.dart @@ -3,7 +3,6 @@ import 'dart:math'; import 'package:composite_calculator/composite_calculator.dart'; import 'package:composite_calculator/models/tensor_type.dart'; import 'package:fl_chart/fl_chart.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import 'package:linalg/matrix.dart'; diff --git a/lib/presentation/tools/page/tool_page.dart b/lib/presentation/tools/page/tool_page.dart index 9515c9d..0be87de 100644 --- a/lib/presentation/tools/page/tool_page.dart +++ b/lib/presentation/tools/page/tool_page.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import 'package:swiftcomp/generated/l10n.dart'; @@ -6,7 +5,6 @@ import 'package:swiftcomp/presentation/tools/model/tool_model.dart'; import 'package:swiftcomp/presentation/tools/page/UDFRC_rules_of_mixture_page.dart'; import 'package:swiftcomp/presentation/tools/page/lamina_stress_strain_page.dart'; import 'package:swiftcomp/presentation/tools/model/DescriptionModels.dart'; -import 'package:swiftcomp/presentation/more/more_page.dart'; import 'lamina_engineering_constants_page.dart'; import 'laminate_3d_properties_page.dart'; diff --git a/lib/presentation/tools/widget/description.dart b/lib/presentation/tools/widget/description.dart index b824855..d77a0de 100644 --- a/lib/presentation/tools/widget/description.dart +++ b/lib/presentation/tools/widget/description.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:swiftcomp/generated/l10n.dart'; diff --git a/lib/presentation/tools/widget/isotropic_material_row.dart b/lib/presentation/tools/widget/isotropic_material_row.dart index 2cd9b6c..56a00ab 100644 --- a/lib/presentation/tools/widget/isotropic_material_row.dart +++ b/lib/presentation/tools/widget/isotropic_material_row.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:swiftcomp/presentation/tools/model/material_model.dart'; import 'package:swiftcomp/presentation/tools/model/explain.dart'; diff --git a/lib/presentation/tools/widget/isotropic_thermal_constants_row.dart b/lib/presentation/tools/widget/isotropic_thermal_constants_row.dart index 837cc40..112d894 100644 --- a/lib/presentation/tools/widget/isotropic_thermal_constants_row.dart +++ b/lib/presentation/tools/widget/isotropic_thermal_constants_row.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:swiftcomp/presentation/tools/model/explain.dart'; import 'package:swiftcomp/presentation/tools/model/validate.dart'; diff --git a/lib/presentation/tools/widget/lamina_constants_row.dart b/lib/presentation/tools/widget/lamina_constants_row.dart index a8578f0..0a1cbdf 100644 --- a/lib/presentation/tools/widget/lamina_constants_row.dart +++ b/lib/presentation/tools/widget/lamina_constants_row.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:swiftcomp/generated/l10n.dart'; import 'package:swiftcomp/presentation/tools/model/material_model.dart'; diff --git a/lib/presentation/tools/widget/laminate_stress_strain_row.dart b/lib/presentation/tools/widget/laminate_stress_strain_row.dart index 2111e0b..b398e26 100644 --- a/lib/presentation/tools/widget/laminate_stress_strain_row.dart +++ b/lib/presentation/tools/widget/laminate_stress_strain_row.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:swiftcomp/presentation/tools/model/mechanical_tensor_model.dart'; diff --git a/lib/presentation/tools/widget/layer_thickness_row.dart b/lib/presentation/tools/widget/layer_thickness_row.dart index 873d2c9..a8b6f3a 100644 --- a/lib/presentation/tools/widget/layer_thickness_row.dart +++ b/lib/presentation/tools/widget/layer_thickness_row.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:swiftcomp/presentation/tools/model/layer_thickness.dart'; diff --git a/lib/presentation/tools/widget/layup_sequence_row.dart b/lib/presentation/tools/widget/layup_sequence_row.dart index e9bccd7..848daed 100644 --- a/lib/presentation/tools/widget/layup_sequence_row.dart +++ b/lib/presentation/tools/widget/layup_sequence_row.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:swiftcomp/presentation/tools/model/layup_sequence_model.dart'; import 'package:swiftcomp/presentation/tools/model/explain.dart'; diff --git a/lib/presentation/tools/widget/orthotropic_properties_widget.dart b/lib/presentation/tools/widget/orthotropic_properties_widget.dart index b1ce4e6..bcbbbef 100644 --- a/lib/presentation/tools/widget/orthotropic_properties_widget.dart +++ b/lib/presentation/tools/widget/orthotropic_properties_widget.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:swiftcomp/presentation/tools/model/material_model.dart'; diff --git a/lib/presentation/tools/widget/plane_stress_strain_row.dart b/lib/presentation/tools/widget/plane_stress_strain_row.dart index aad9593..2eac618 100644 --- a/lib/presentation/tools/widget/plane_stress_strain_row.dart +++ b/lib/presentation/tools/widget/plane_stress_strain_row.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:swiftcomp/presentation/tools/model/mechanical_tensor_model.dart'; diff --git a/lib/presentation/tools/widget/result_3by3_matrix.dart b/lib/presentation/tools/widget/result_3by3_matrix.dart index 71127a7..7341486 100644 --- a/lib/presentation/tools/widget/result_3by3_matrix.dart +++ b/lib/presentation/tools/widget/result_3by3_matrix.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import 'package:provider/provider.dart'; diff --git a/lib/presentation/tools/widget/result_6by6_matrix.dart b/lib/presentation/tools/widget/result_6by6_matrix.dart index bbe4302..fad6c4b 100644 --- a/lib/presentation/tools/widget/result_6by6_matrix.dart +++ b/lib/presentation/tools/widget/result_6by6_matrix.dart @@ -1,5 +1,4 @@ import 'package:auto_size_text/auto_size_text.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import 'package:provider/provider.dart'; diff --git a/lib/presentation/tools/widget/transversely_isotropic_row.dart b/lib/presentation/tools/widget/transversely_isotropic_row.dart index 74bd1b0..c23b51a 100644 --- a/lib/presentation/tools/widget/transversely_isotropic_row.dart +++ b/lib/presentation/tools/widget/transversely_isotropic_row.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:swiftcomp/presentation/tools/model/material_model.dart'; import 'package:swiftcomp/presentation/tools/model/explain.dart'; diff --git a/lib/presentation/tools/widget/transversely_thermal_constants_row.dart b/lib/presentation/tools/widget/transversely_thermal_constants_row.dart index a1ea961..c555d11 100644 --- a/lib/presentation/tools/widget/transversely_thermal_constants_row.dart +++ b/lib/presentation/tools/widget/transversely_thermal_constants_row.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:swiftcomp/presentation/tools/model/explain.dart'; import 'package:swiftcomp/presentation/tools/model/validate.dart'; diff --git a/lib/presentation/tools/widget/volume_fraction_row.dart b/lib/presentation/tools/widget/volume_fraction_row.dart index b591ea8..b63c126 100644 --- a/lib/presentation/tools/widget/volume_fraction_row.dart +++ b/lib/presentation/tools/widget/volume_fraction_row.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:swiftcomp/presentation/tools/model/volume_fraction_model.dart'; import 'package:swiftcomp/presentation/tools/model/explain.dart'; diff --git a/test/feature_flag_provider_test.dart b/test/feature_flag_provider_test.dart index d3c4007..aeb30b3 100644 --- a/test/feature_flag_provider_test.dart +++ b/test/feature_flag_provider_test.dart @@ -1,6 +1,5 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:shared_preferences/shared_preferences.dart'; -import 'package:mockito/mockito.dart'; import 'package:swiftcomp/presentation/more/feature_flag_provider.dart'; void main() {