From 575da42ee820369c9278b9ae8332c6aba03dccbb Mon Sep 17 00:00:00 2001 From: Nils Reichardt Date: Tue, 19 Dec 2023 13:58:21 +0100 Subject: [PATCH] Extract `helper_functions.dart` into a separate `helper_functions` package (#1194) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The package `sharezone_widgets` used the `isNullOrEmpty()` / `isNotNullOrEmpty()` method from the `sharezone_common` package. However, the `sharezone_common` package has a lot of Firebase dependencies. With extracting the `helper_functions.dart` into a `helper_functions` package, I removed all Firebase dependencies from `sharezone_widgets` 👍 --- app/lib/account/change_data_bloc.dart | 2 +- .../src/bloc/enter_activation_code_bloc.dart | 2 +- .../auth/email_and_password_link_bloc.dart | 2 +- app/lib/auth/reset_pw_page.dart | 2 +- app/lib/blackboard/blackboard_card.dart | 2 +- app/lib/blackboard/blackboard_item.dart | 2 +- .../blocs/blackboard_dialog_bloc.dart | 2 +- .../bloc/calendrical_events_page_cache.dart | 2 +- app/lib/changelog/change_database_model.dart | 2 +- app/lib/comments/comment_data_models.dart | 2 +- app/lib/comments/comments_analytics.dart | 2 +- .../comments/widgets/user_comment_field.dart | 2 +- app/lib/dashboard/dashboard_page.dart | 2 +- .../widgets/blackboard_card_dashboard.dart | 2 +- app/lib/dynamic_links/einkommender_link.dart | 2 +- .../feedback/src/models/user_feedback.dart | 2 +- .../logic/select_cloud_file_action.dart | 2 +- .../group_join/models/group_join_result.dart | 2 +- .../widgets/group_join_text_field.dart | 2 +- .../course_details/course_member_options.dart | 2 +- .../write_permission_options.dart | 2 +- .../course/course_edit/course_edit_bloc.dart | 2 +- .../analytics/events/course_create_event.dart | 2 +- .../create/src/bloc/course_create_bloc.dart | 2 +- .../school_class_create_course_bloc.dart | 2 +- .../school_class/school_class_details.dart | 2 +- .../school_class_member_option.dart | 2 +- app/lib/groups/src/widgets/group_share.dart | 2 +- .../groups/src/widgets/sharecode_text.dart | 2 +- .../shared/homework_list_section.dart | 2 +- app/lib/markdown/markdown_analytics.dart | 2 +- .../navigation/drawer/tiles/drawer_tile.dart | 2 +- .../analytics/group_onboarding_analytics.dart | 2 +- .../pages/create_schoolclass.dart | 2 +- .../pages/group_onboarding_page_template.dart | 2 +- app/lib/report/page/report_page_bloc.dart | 2 +- .../src/subpages/about/widgets/team.dart | 2 +- .../subpages/my_profile/my_profile_page.dart | 2 +- .../homework_create_submission_page.dart | 2 +- app/lib/timetable/src/edit_time.dart | 2 +- app/pubspec.lock | 7 + app/pubspec.yaml | 2 + lib/abgabe/abgabe_client_lib/pubspec.lock | 7 + .../lib/src/analytics/analytics.dart | 4 +- lib/analytics/pubspec.lock | 294 +----------------- lib/analytics/pubspec.yaml | 5 - lib/app_functions/pubspec.lock | 168 +--------- .../events/authentifaction_event.dart | 2 +- .../lib/src/blocs/login_bloc.dart | 2 +- .../authentification_base/pubspec.lock | 7 + .../authentification_base/pubspec.yaml | 2 + .../lib/src/models/qr_sign_in_document.dart | 2 +- .../authentification_qrcode/pubspec.lock | 7 + lib/date/pubspec.lock | 7 + lib/design/pubspec.lock | 7 + lib/filesharing/files_usecases/pubspec.lock | 7 + .../lib/src/models/change_activity.dart | 2 +- .../lib/src/models/cloud_file.dart | 3 +- .../lib/src/models/filesharing_data.dart | 3 +- .../lib/src/models/folder.dart | 3 +- .../filesharing_logic/pubspec.lock | 7 + .../filesharing_logic/pubspec.yaml | 2 + .../lib/src/homework_dto.dart | 2 +- .../pubspec.lock | 7 + lib/group_domain_implementation/pubspec.lock | 7 + .../lib/src/models/connections_data.dart | 2 +- .../lib/src/models/course.dart | 2 +- .../lib/src/models/member.dart | 2 +- lib/group_domain_models/pubspec.lock | 7 + lib/helper_functions/.gitignore | 75 +++++ lib/helper_functions/.metadata | 10 + lib/helper_functions/analysis_options.yaml | 9 + .../lib/helper_functions.dart | 0 .../lib/src/helper_functions.dart | 32 ++ lib/helper_functions/pubspec.lock | 28 ++ lib/helper_functions/pubspec.yaml | 19 ++ lib/holidays/pubspec.lock | 148 +-------- lib/last_online_reporting/pubspec.lock | 7 + lib/sharezone_common/lib/firebase_helper.dart | 11 + ...er_functions.dart => firebase_helper.dart} | 31 +- lib/sharezone_common/pubspec.lock | 67 ++-- lib/sharezone_common/pubspec.yaml | 3 + .../column_actions_dialog.dart | 2 +- ...left_and_right_action_adaptive_dialog.dart | 2 +- .../long_press_adaptive_dialog.dart | 2 +- .../lib/src/announcement_card.dart | 2 +- .../lib/src/placeholder.dart | 2 +- lib/sharezone_widgets/lib/src/widgets.dart | 2 +- lib/sharezone_widgets/pubspec.lock | 246 +-------------- lib/sharezone_widgets/pubspec.yaml | 4 +- lib/user/lib/src/models/subscription.dart | 3 +- .../models/timetable/enabled_weekdays.dart | 2 +- lib/user/lib/src/models/timetable/period.dart | 5 +- .../lib/src/models/tips/user_tip_data.dart | 3 +- lib/user/lib/src/models/user.dart | 3 +- lib/user/pubspec.lock | 7 + lib/user/pubspec.yaml | 2 + licenses_config.yaml | 1 + 98 files changed, 417 insertions(+), 970 deletions(-) create mode 100644 lib/helper_functions/.gitignore create mode 100644 lib/helper_functions/.metadata create mode 100644 lib/helper_functions/analysis_options.yaml rename lib/{sharezone_common => helper_functions}/lib/helper_functions.dart (100%) create mode 100644 lib/helper_functions/lib/src/helper_functions.dart create mode 100644 lib/helper_functions/pubspec.lock create mode 100644 lib/helper_functions/pubspec.yaml create mode 100644 lib/sharezone_common/lib/firebase_helper.dart rename lib/sharezone_common/lib/src/{helper_functions.dart => firebase_helper.dart} (71%) diff --git a/app/lib/account/change_data_bloc.dart b/app/lib/account/change_data_bloc.dart index 42ea68402..2068cd0b1 100644 --- a/app/lib/account/change_data_bloc.dart +++ b/app/lib/account/change_data_bloc.dart @@ -14,7 +14,7 @@ import 'package:firebase_auth/firebase_auth.dart'; import 'package:rxdart/rxdart.dart'; import 'package:sharezone/util/api/user_api.dart'; import 'package:sharezone_common/api_errors.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; import 'package:sharezone_utils/internet_access.dart'; class ChangeDataBloc extends BlocBase with AuthentificationValidators { diff --git a/app/lib/activation_code/src/bloc/enter_activation_code_bloc.dart b/app/lib/activation_code/src/bloc/enter_activation_code_bloc.dart index 97d2a9993..206854a3b 100644 --- a/app/lib/activation_code/src/bloc/enter_activation_code_bloc.dart +++ b/app/lib/activation_code/src/bloc/enter_activation_code_bloc.dart @@ -15,7 +15,7 @@ import 'package:flutter/material.dart'; import 'package:key_value_store/key_value_store.dart'; import 'package:rxdart/rxdart.dart'; import 'package:sharezone/sharezone_plus/subscription_service/subscription_flag.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; import '../models/enter_activation_code_result.dart'; import 'enter_activation_code_activator.dart'; diff --git a/app/lib/auth/email_and_password_link_bloc.dart b/app/lib/auth/email_and_password_link_bloc.dart index e60213471..50f8ed4b3 100644 --- a/app/lib/auth/email_and_password_link_bloc.dart +++ b/app/lib/auth/email_and_password_link_bloc.dart @@ -17,7 +17,7 @@ import 'package:rxdart/rxdart.dart'; import 'package:sharezone/account/account_page_bloc.dart'; import 'package:sharezone/account/profile/user_edit/user_edit_bloc.dart'; import 'package:sharezone_common/api_errors.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; import 'package:sharezone_widgets/sharezone_widgets.dart'; // * Using a shortcut getter method on the class to create simpler and friendlier API for the class to provide access of a particular function on StreamController diff --git a/app/lib/auth/reset_pw_page.dart b/app/lib/auth/reset_pw_page.dart index 65782a2fa..75f34df7e 100644 --- a/app/lib/auth/reset_pw_page.dart +++ b/app/lib/auth/reset_pw_page.dart @@ -14,7 +14,7 @@ import 'package:firebase_auth/firebase_auth.dart'; import 'package:flutter/material.dart'; import 'package:rxdart/rxdart.dart'; import 'package:rxdart/subjects.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; import 'package:sharezone_widgets/sharezone_widgets.dart'; import 'email_and_password_link_page.dart'; diff --git a/app/lib/blackboard/blackboard_card.dart b/app/lib/blackboard/blackboard_card.dart index cd71a0e6b..92d3c6040 100644 --- a/app/lib/blackboard/blackboard_card.dart +++ b/app/lib/blackboard/blackboard_card.dart @@ -15,7 +15,7 @@ import 'package:sharezone/blackboard/blocs/blackboard_card_bloc.dart'; import 'package:sharezone/blackboard/details/blackboard_details.dart'; import 'package:sharezone/main/application_bloc.dart'; import 'package:sharezone/util/launch_link.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; import 'package:sharezone_widgets/sharezone_widgets.dart'; import 'blackboard_view.dart'; diff --git a/app/lib/blackboard/blackboard_item.dart b/app/lib/blackboard/blackboard_item.dart index 8c776cca2..190777bea 100644 --- a/app/lib/blackboard/blackboard_item.dart +++ b/app/lib/blackboard/blackboard_item.dart @@ -7,7 +7,7 @@ // SPDX-License-Identifier: EUPL-1.2 import 'package:cloud_firestore/cloud_firestore.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:sharezone_common/firebase_helper.dart'; class BlackboardItem { final String id; diff --git a/app/lib/blackboard/blocs/blackboard_dialog_bloc.dart b/app/lib/blackboard/blocs/blackboard_dialog_bloc.dart index 167b87c75..c2e62986d 100644 --- a/app/lib/blackboard/blocs/blackboard_dialog_bloc.dart +++ b/app/lib/blackboard/blocs/blackboard_dialog_bloc.dart @@ -17,7 +17,7 @@ import 'package:sharezone/markdown/markdown_analytics.dart'; import 'package:sharezone/util/api.dart'; import 'package:sharezone_common/api_errors.dart'; import 'package:sharezone_common/blackboard_validators.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; import 'package:sharezone_common/validators.dart'; class BlackboardDialogBloc extends BlocBase with BlackboardValidators { diff --git a/app/lib/calendrical_events/bloc/calendrical_events_page_cache.dart b/app/lib/calendrical_events/bloc/calendrical_events_page_cache.dart index 34563f976..62da9e90b 100644 --- a/app/lib/calendrical_events/bloc/calendrical_events_page_cache.dart +++ b/app/lib/calendrical_events/bloc/calendrical_events_page_cache.dart @@ -8,7 +8,7 @@ import 'package:key_value_store/key_value_store.dart'; import 'package:sharezone/calendrical_events/models/calendrical_events_layout.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; class CalendricalEventsPageCache { final KeyValueStore keyValueStore; diff --git a/app/lib/changelog/change_database_model.dart b/app/lib/changelog/change_database_model.dart index 13d9d2781..268500c7b 100644 --- a/app/lib/changelog/change_database_model.dart +++ b/app/lib/changelog/change_database_model.dart @@ -8,7 +8,7 @@ import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:sharezone/changelog/change.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:sharezone_common/firebase_helper.dart'; class ChangeDatabaseModel { final String id; diff --git a/app/lib/comments/comment_data_models.dart b/app/lib/comments/comment_data_models.dart index 76bc29b19..8f139199b 100644 --- a/app/lib/comments/comment_data_models.dart +++ b/app/lib/comments/comment_data_models.dart @@ -8,7 +8,7 @@ import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:sharezone/comments/comment.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:sharezone_common/firebase_helper.dart'; class CommentDataModel { final String? id; diff --git a/app/lib/comments/comments_analytics.dart b/app/lib/comments/comments_analytics.dart index 0b20750fe..ca9a16af2 100644 --- a/app/lib/comments/comments_analytics.dart +++ b/app/lib/comments/comments_analytics.dart @@ -7,7 +7,7 @@ // SPDX-License-Identifier: EUPL-1.2 import 'package:analytics/analytics.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; import 'comments_gateway.dart'; diff --git a/app/lib/comments/widgets/user_comment_field.dart b/app/lib/comments/widgets/user_comment_field.dart index b4f690d23..ab389bca0 100644 --- a/app/lib/comments/widgets/user_comment_field.dart +++ b/app/lib/comments/widgets/user_comment_field.dart @@ -10,7 +10,7 @@ import 'package:bloc_provider/bloc_provider.dart'; import 'package:flutter/material.dart'; import 'package:sharezone/auth/login_button.dart'; import 'package:sharezone/comments/comments_bloc.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; import 'package:sharezone_widgets/sharezone_widgets.dart'; class UserCommentField extends StatefulWidget { diff --git a/app/lib/dashboard/dashboard_page.dart b/app/lib/dashboard/dashboard_page.dart index 3374cd72f..68a0dfa85 100644 --- a/app/lib/dashboard/dashboard_page.dart +++ b/app/lib/dashboard/dashboard_page.dart @@ -49,7 +49,7 @@ import 'package:sharezone/widgets/animated_stream_list.dart'; import 'package:sharezone/homework/shared/homework_card.dart'; import 'package:sharezone/widgets/matching_type_of_user_builder.dart'; import 'package:sharezone/widgets/material/modal_bottom_sheet_big_icon_button.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; import 'package:platform_check/platform_check.dart'; import 'package:sharezone_widgets/sharezone_widgets.dart'; import 'package:user/user.dart'; diff --git a/app/lib/dashboard/widgets/blackboard_card_dashboard.dart b/app/lib/dashboard/widgets/blackboard_card_dashboard.dart index 63270d0a5..ee8dce1ed 100644 --- a/app/lib/dashboard/widgets/blackboard_card_dashboard.dart +++ b/app/lib/dashboard/widgets/blackboard_card_dashboard.dart @@ -12,7 +12,7 @@ import 'package:sharezone/blackboard/blackboard_card.dart'; import 'package:sharezone/blackboard/blackboard_view.dart'; import 'package:sharezone/blackboard/blocs/blackboard_card_bloc.dart'; import 'package:sharezone/main/application_bloc.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; import 'package:sharezone_widgets/sharezone_widgets.dart'; /// Diese BlackboardCard wird nun auf der Dashboard-Seite verwendet diff --git a/app/lib/dynamic_links/einkommender_link.dart b/app/lib/dynamic_links/einkommender_link.dart index bce18e947..93619f53b 100644 --- a/app/lib/dynamic_links/einkommender_link.dart +++ b/app/lib/dynamic_links/einkommender_link.dart @@ -7,7 +7,7 @@ // SPDX-License-Identifier: EUPL-1.2 import 'package:dynamic_links/dynamic_links.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; enum EinkommensZeitpunkt { appstart, laufzeit, unbekannt } diff --git a/app/lib/feedback/src/models/user_feedback.dart b/app/lib/feedback/src/models/user_feedback.dart index dda1c36d4..543234443 100644 --- a/app/lib/feedback/src/models/user_feedback.dart +++ b/app/lib/feedback/src/models/user_feedback.dart @@ -7,7 +7,7 @@ // SPDX-License-Identifier: EUPL-1.2 import 'package:cloud_firestore/cloud_firestore.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; class UserFeedback { final double? rating; diff --git a/app/lib/filesharing/logic/select_cloud_file_action.dart b/app/lib/filesharing/logic/select_cloud_file_action.dart index 7badc4e8d..996e9bd1f 100644 --- a/app/lib/filesharing/logic/select_cloud_file_action.dart +++ b/app/lib/filesharing/logic/select_cloud_file_action.dart @@ -17,7 +17,7 @@ import 'package:sharezone/filesharing/widgets/download_unknown_file_type_dialog_ import 'package:sharezone/filesharing/widgets/move_file_page.dart'; import 'package:sharezone/report/page/report_page.dart'; import 'package:sharezone/report/report_item.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; import 'package:platform_check/platform_check.dart'; import 'package:sharezone_widgets/sharezone_widgets.dart'; diff --git a/app/lib/groups/group_join/models/group_join_result.dart b/app/lib/groups/group_join/models/group_join_result.dart index 042fe5c13..91364b893 100644 --- a/app/lib/groups/group_join/models/group_join_result.dart +++ b/app/lib/groups/group_join/models/group_join_result.dart @@ -9,7 +9,7 @@ import 'package:group_domain_models/group_domain_models.dart'; import 'package:sharezone/groups/group_join/models/group_info_with_selection_state.dart'; import 'package:sharezone/groups/group_join/models/group_join_exception.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:sharezone_common/firebase_helper.dart'; abstract class GroupJoinResult {} diff --git a/app/lib/groups/group_join/widgets/group_join_text_field.dart b/app/lib/groups/group_join/widgets/group_join_text_field.dart index bfa573adf..b286e3fa4 100644 --- a/app/lib/groups/group_join/widgets/group_join_text_field.dart +++ b/app/lib/groups/group_join/widgets/group_join_text_field.dart @@ -13,7 +13,7 @@ import 'package:group_domain_models/group_domain_models.dart'; import 'package:qr_code_scanner/qr_code_scanner.dart'; import 'package:sharezone/main/application_bloc.dart'; import 'package:sharezone/groups/group_join/bloc/group_join_bloc.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; import 'package:platform_check/platform_check.dart'; import 'package:sharezone_widgets/sharezone_widgets.dart'; diff --git a/app/lib/groups/src/pages/course/course_details/course_member_options.dart b/app/lib/groups/src/pages/course/course_details/course_member_options.dart index a89fdacb0..ec898cf34 100644 --- a/app/lib/groups/src/pages/course/course_details/course_member_options.dart +++ b/app/lib/groups/src/pages/course/course_details/course_member_options.dart @@ -16,7 +16,7 @@ import 'package:group_domain_models/group_domain_models.dart'; import 'package:sharezone/groups/src/pages/course/course_details/course_details_bloc.dart'; import 'package:sharezone/groups/src/widgets/member_list.dart'; import 'package:sharezone/main/application_bloc.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; Future showCourseMemberOptionsSheet({ required BuildContext context, diff --git a/app/lib/groups/src/pages/course/course_details/write_permission_options.dart b/app/lib/groups/src/pages/course/course_details/write_permission_options.dart index b57578c0e..498d3788b 100644 --- a/app/lib/groups/src/pages/course/course_details/write_permission_options.dart +++ b/app/lib/groups/src/pages/course/course_details/write_permission_options.dart @@ -8,7 +8,7 @@ import 'package:flutter/material.dart'; import 'package:group_domain_models/group_domain_models.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; import 'package:sharezone_widgets/sharezone_widgets.dart'; import 'course_settings.dart'; diff --git a/app/lib/groups/src/pages/course/course_edit/course_edit_bloc.dart b/app/lib/groups/src/pages/course/course_edit/course_edit_bloc.dart index 419dec282..581c1c81c 100644 --- a/app/lib/groups/src/pages/course/course_edit/course_edit_bloc.dart +++ b/app/lib/groups/src/pages/course/course_edit/course_edit_bloc.dart @@ -14,7 +14,7 @@ import 'package:rxdart/rxdart.dart'; import 'package:sharezone/util/api/course_gateway.dart'; import 'package:sharezone_common/api_errors.dart'; import 'package:sharezone_common/course_validators.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; class CourseEditPageBloc extends BlocBase with CourseValidators { final _subjectSubject = BehaviorSubject(); diff --git a/app/lib/groups/src/pages/course/create/src/analytics/events/course_create_event.dart b/app/lib/groups/src/pages/course/create/src/analytics/events/course_create_event.dart index bdac32c74..52c754aea 100644 --- a/app/lib/groups/src/pages/course/create/src/analytics/events/course_create_event.dart +++ b/app/lib/groups/src/pages/course/create/src/analytics/events/course_create_event.dart @@ -7,7 +7,7 @@ // SPDX-License-Identifier: EUPL-1.2 import 'package:analytics/analytics.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; const groupPage = "group-page"; const schoolClassPage = "school-class-page"; diff --git a/app/lib/groups/src/pages/course/create/src/bloc/course_create_bloc.dart b/app/lib/groups/src/pages/course/create/src/bloc/course_create_bloc.dart index 2b0b0df7c..bbd884b75 100644 --- a/app/lib/groups/src/pages/course/create/src/bloc/course_create_bloc.dart +++ b/app/lib/groups/src/pages/course/create/src/bloc/course_create_bloc.dart @@ -15,7 +15,7 @@ import 'package:sharezone/groups/src/pages/course/create/src/models/course_templ import 'package:sharezone/util/string_utils.dart'; import 'package:sharezone_common/api_errors.dart'; import 'package:sharezone_common/course_validators.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; import 'package:sharezone_common/validators.dart'; import '../gateway/course_create_gateway.dart'; diff --git a/app/lib/groups/src/pages/school_class/create_course/school_class_create_course_bloc.dart b/app/lib/groups/src/pages/school_class/create_course/school_class_create_course_bloc.dart index 89286aecf..280ffb248 100644 --- a/app/lib/groups/src/pages/school_class/create_course/school_class_create_course_bloc.dart +++ b/app/lib/groups/src/pages/school_class/create_course/school_class_create_course_bloc.dart @@ -18,7 +18,7 @@ import 'package:sharezone/util/api.dart'; import 'package:sharezone/util/string_utils.dart'; import 'package:sharezone_common/api_errors.dart'; import 'package:sharezone_common/course_validators.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; import 'package:sharezone_common/validators.dart'; class SchoolClassCourseCreateBloc extends BlocBase with CourseValidators { diff --git a/app/lib/groups/src/pages/school_class/school_class_details.dart b/app/lib/groups/src/pages/school_class/school_class_details.dart index 295185e1f..77f126116 100644 --- a/app/lib/groups/src/pages/school_class/school_class_details.dart +++ b/app/lib/groups/src/pages/school_class/school_class_details.dart @@ -25,7 +25,7 @@ import 'package:sharezone/groups/src/widgets/sharecode_text.dart'; import 'package:sharezone/report/report_icon.dart'; import 'package:sharezone/report/report_item.dart'; import 'package:sharezone/widgets/avatar_card.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; import 'package:sharezone_widgets/sharezone_widgets.dart'; import 'school_class_details/school_class_course_list.dart'; diff --git a/app/lib/groups/src/pages/school_class/school_class_details/school_class_member_option.dart b/app/lib/groups/src/pages/school_class/school_class_details/school_class_member_option.dart index e38098d18..2b3ef105d 100644 --- a/app/lib/groups/src/pages/school_class/school_class_details/school_class_member_option.dart +++ b/app/lib/groups/src/pages/school_class/school_class_details/school_class_member_option.dart @@ -17,7 +17,7 @@ import 'package:sharezone/groups/group_permission.dart'; import 'package:sharezone/groups/src/pages/school_class/my_school_class_bloc.dart'; import 'package:sharezone/groups/src/widgets/member_list.dart'; import 'package:sharezone/main/application_bloc.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; Future showSchoolClassMemberOptionsSheet({ required BuildContext context, diff --git a/app/lib/groups/src/widgets/group_share.dart b/app/lib/groups/src/widgets/group_share.dart index 1ad7cdacf..2ac24bf88 100644 --- a/app/lib/groups/src/widgets/group_share.dart +++ b/app/lib/groups/src/widgets/group_share.dart @@ -13,7 +13,7 @@ import 'package:group_domain_models/group_domain_models.dart'; import 'package:share/share.dart'; import 'package:sharezone/onboarding/group_onboarding/logic/group_onboarding_bloc.dart'; import 'package:sharezone/onboarding/group_onboarding/logic/signed_up_bloc.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; import 'package:platform_check/platform_check.dart'; import 'package:sharezone_widgets/sharezone_widgets.dart'; diff --git a/app/lib/groups/src/widgets/sharecode_text.dart b/app/lib/groups/src/widgets/sharecode_text.dart index 1984038db..9f8878d9e 100644 --- a/app/lib/groups/src/widgets/sharecode_text.dart +++ b/app/lib/groups/src/widgets/sharecode_text.dart @@ -8,7 +8,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; import 'package:platform_check/platform_check.dart'; import 'package:sharezone_widgets/sharezone_widgets.dart'; diff --git a/app/lib/homework/shared/homework_list_section.dart b/app/lib/homework/shared/homework_list_section.dart index b76d83a28..508a19645 100644 --- a/app/lib/homework/shared/homework_list_section.dart +++ b/app/lib/homework/shared/homework_list_section.dart @@ -8,7 +8,7 @@ import 'package:flutter/material.dart'; import 'package:sharezone/homework/shared/animated_staggered_scroll_view.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; /// A List of homeworks with a leading title. /// diff --git a/app/lib/markdown/markdown_analytics.dart b/app/lib/markdown/markdown_analytics.dart index 26f7cc109..c1f3eefe4 100644 --- a/app/lib/markdown/markdown_analytics.dart +++ b/app/lib/markdown/markdown_analytics.dart @@ -8,7 +8,7 @@ import 'package:analytics/analytics.dart'; import 'package:bloc_base/bloc_base.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; class MarkdownAnalytics extends BlocBase { final Analytics _analytics; diff --git a/app/lib/navigation/drawer/tiles/drawer_tile.dart b/app/lib/navigation/drawer/tiles/drawer_tile.dart index 0ce41a2fc..3760d1f39 100644 --- a/app/lib/navigation/drawer/tiles/drawer_tile.dart +++ b/app/lib/navigation/drawer/tiles/drawer_tile.dart @@ -11,7 +11,7 @@ import 'package:build_context/build_context.dart'; import 'package:flutter/material.dart'; import 'package:sharezone/navigation/logic/navigation_bloc.dart'; import 'package:sharezone/navigation/models/navigation_item.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; import 'package:sharezone_widgets/sharezone_widgets.dart'; import '../drawer_controller.dart'; diff --git a/app/lib/onboarding/group_onboarding/analytics/group_onboarding_analytics.dart b/app/lib/onboarding/group_onboarding/analytics/group_onboarding_analytics.dart index 234646097..36b297ac9 100644 --- a/app/lib/onboarding/group_onboarding/analytics/group_onboarding_analytics.dart +++ b/app/lib/onboarding/group_onboarding/analytics/group_onboarding_analytics.dart @@ -7,7 +7,7 @@ // SPDX-License-Identifier: EUPL-1.2 import 'package:analytics/analytics.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; class GroupOnboardingAnalytics { final Analytics _analytics; diff --git a/app/lib/onboarding/group_onboarding/pages/create_schoolclass.dart b/app/lib/onboarding/group_onboarding/pages/create_schoolclass.dart index 47006190e..afaa507b1 100644 --- a/app/lib/onboarding/group_onboarding/pages/create_schoolclass.dart +++ b/app/lib/onboarding/group_onboarding/pages/create_schoolclass.dart @@ -19,7 +19,7 @@ import 'package:sharezone/onboarding/group_onboarding/logic/group_onboarding_blo import 'package:sharezone/onboarding/group_onboarding/pages/create_courses.dart'; import 'package:sharezone/onboarding/group_onboarding/pages/group_onboarding_page_template.dart'; import 'package:sharezone/onboarding/sign_up/sign_up_page.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; import 'package:sharezone_widgets/sharezone_widgets.dart'; import 'package:user/user.dart'; diff --git a/app/lib/onboarding/group_onboarding/pages/group_onboarding_page_template.dart b/app/lib/onboarding/group_onboarding/pages/group_onboarding_page_template.dart index 93c81c99e..8c3a5f05d 100644 --- a/app/lib/onboarding/group_onboarding/pages/group_onboarding_page_template.dart +++ b/app/lib/onboarding/group_onboarding/pages/group_onboarding_page_template.dart @@ -11,7 +11,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_staggered_animations/flutter_staggered_animations.dart'; import 'package:sharezone/onboarding/group_onboarding/logic/group_onboarding_bloc.dart'; import 'package:sharezone/onboarding/group_onboarding/widgets/title.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; import 'package:sharezone_widgets/sharezone_widgets.dart'; class GroupOnboardingPageTemplate extends StatelessWidget { diff --git a/app/lib/report/page/report_page_bloc.dart b/app/lib/report/page/report_page_bloc.dart index f0900b670..0d96dafb0 100644 --- a/app/lib/report/page/report_page_bloc.dart +++ b/app/lib/report/page/report_page_bloc.dart @@ -11,7 +11,7 @@ import 'package:rxdart/rxdart.dart'; import 'package:sharezone/report/report_factory.dart'; import 'package:sharezone/report/report_item.dart' as ui; import 'package:sharezone_common/api_errors.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; import '../report.dart'; import '../report_gateway.dart'; diff --git a/app/lib/settings/src/subpages/about/widgets/team.dart b/app/lib/settings/src/subpages/about/widgets/team.dart index 768de1abe..541e319b4 100644 --- a/app/lib/settings/src/subpages/about/widgets/team.dart +++ b/app/lib/settings/src/subpages/about/widgets/team.dart @@ -7,7 +7,7 @@ // SPDX-License-Identifier: EUPL-1.2 import 'package:flutter/material.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; import 'package:sharezone_widgets/sharezone_widgets.dart'; import 'about_section.dart'; import 'social_media_button.dart'; diff --git a/app/lib/settings/src/subpages/my_profile/my_profile_page.dart b/app/lib/settings/src/subpages/my_profile/my_profile_page.dart index b1fd53322..0e7be27db 100644 --- a/app/lib/settings/src/subpages/my_profile/my_profile_page.dart +++ b/app/lib/settings/src/subpages/my_profile/my_profile_page.dart @@ -29,7 +29,7 @@ import 'package:sharezone/settings/src/subpages/my_profile/change_state.dart'; import 'package:sharezone/settings/src/subpages/my_profile/my_profile_bloc.dart'; import 'package:sharezone/widgets/material/list_tile_with_description.dart'; import 'package:sharezone_common/api_errors.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; import 'package:sharezone_widgets/sharezone_widgets.dart'; import 'package:streaming_shared_preferences/streaming_shared_preferences.dart'; import 'package:url_launcher_extended/url_launcher_extended.dart'; diff --git a/app/lib/submissions/homework_create_submission_page.dart b/app/lib/submissions/homework_create_submission_page.dart index 57372731e..6553509d0 100644 --- a/app/lib/submissions/homework_create_submission_page.dart +++ b/app/lib/submissions/homework_create_submission_page.dart @@ -14,7 +14,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_staggered_animations/flutter_staggered_animations.dart'; import 'package:sharezone/filesharing/dialog/attach_file.dart'; import 'package:sharezone/filesharing/widgets/cloud_file_icon.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; import 'package:platform_check/platform_check.dart'; import 'package:sharezone_widgets/sharezone_widgets.dart'; diff --git a/app/lib/timetable/src/edit_time.dart b/app/lib/timetable/src/edit_time.dart index 51ffd713b..85b2c2658 100644 --- a/app/lib/timetable/src/edit_time.dart +++ b/app/lib/timetable/src/edit_time.dart @@ -11,7 +11,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart' hide TimePickerEntryMode; import 'package:interval_time_picker/interval_time_picker.dart'; import 'package:sharezone/settings/src/subpages/timetable/time_picker_settings_cache.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; import 'package:platform_check/platform_check.dart'; import 'package:sharezone_widgets/sharezone_widgets.dart'; import 'package:time/time.dart'; diff --git a/app/pubspec.lock b/app/pubspec.lock index e5584e83f..8ff4443e1 100644 --- a/app/pubspec.lock +++ b/app/pubspec.lock @@ -1155,6 +1155,13 @@ packages: relative: true source: path version: "0.0.0" + helper_functions: + dependency: "direct main" + description: + path: "../lib/helper_functions" + relative: true + source: path + version: "0.0.1" holidays: dependency: "direct main" description: diff --git a/app/pubspec.yaml b/app/pubspec.yaml index c7f089ed5..5ae0590d9 100644 --- a/app/pubspec.yaml +++ b/app/pubspec.yaml @@ -115,6 +115,8 @@ dependencies: path: ../lib/hausaufgabenheft_logik holidays: path: ../lib/holidays + helper_functions: + path: ../lib/helper_functions http: ^1.1.2 # Used so that we can select a minute interval (only either XX:00 or XX:30) # for the homework reminder time picker. diff --git a/lib/abgabe/abgabe_client_lib/pubspec.lock b/lib/abgabe/abgabe_client_lib/pubspec.lock index 59df27c40..f7bc696a7 100644 --- a/lib/abgabe/abgabe_client_lib/pubspec.lock +++ b/lib/abgabe/abgabe_client_lib/pubspec.lock @@ -636,6 +636,13 @@ packages: relative: true source: path version: "0.0.0" + helper_functions: + dependency: transitive + description: + path: "../../helper_functions" + relative: true + source: path + version: "0.0.1" html: dependency: transitive description: diff --git a/lib/analytics/lib/src/analytics/analytics.dart b/lib/analytics/lib/src/analytics/analytics.dart index 091e603df..d973f4e90 100644 --- a/lib/analytics/lib/src/analytics/analytics.dart +++ b/lib/analytics/lib/src/analytics/analytics.dart @@ -6,8 +6,6 @@ // // SPDX-License-Identifier: EUPL-1.2 -import 'package:sharezone_common/helper_functions.dart'; - class AnalyticsEvent { final String name; final Map? data; @@ -42,7 +40,7 @@ class Analytics { const Analytics(this._backend); void log(AnalyticsEvent event) { - if (!isEmptyOrNull(event.name)) { + if (event.name.isNotEmpty) { _backend.log(event.name, event.data ?? {}); } } diff --git a/lib/analytics/pubspec.lock b/lib/analytics/pubspec.lock index 0e1b97e04..98130fed6 100644 --- a/lib/analytics/pubspec.lock +++ b/lib/analytics/pubspec.lock @@ -9,21 +9,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.5" - app_functions: - dependency: transitive - description: - path: "../app_functions" - relative: true - source: path - version: "0.0.1" - args: - dependency: transitive - description: - name: args - sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 - url: "https://pub.dev" - source: hosted - version: "2.4.2" async: dependency: transitive description: @@ -40,13 +25,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.1" - build_context: - dependency: transitive - description: - path: "../build_context" - relative: true - source: path - version: "0.0.1" characters: dependency: transitive description: @@ -63,54 +41,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.1" - cloud_firestore: - dependency: transitive - description: - name: cloud_firestore - sha256: "21cffe06a212015950010ecb9adbf1eb9acaf294f2bd159bde7980aee37c997b" - url: "https://pub.dev" - source: hosted - version: "4.9.0" - cloud_firestore_platform_interface: - dependency: transitive - description: - name: cloud_firestore_platform_interface - sha256: "5749b81aea93afdce220e02d34369162010d210011054ac494b2c38c4e9ebeb7" - url: "https://pub.dev" - source: hosted - version: "5.16.0" - cloud_firestore_web: - dependency: transitive - description: - name: cloud_firestore_web - sha256: fef99ad0599e983092adb1bb01f14a596dba601a7a8efaaffd7b2721d64e2c51 - url: "https://pub.dev" - source: hosted - version: "3.7.0" - cloud_functions: - dependency: transitive - description: - name: cloud_functions - sha256: "6c5ce6c78bcf92b422b58e76dc33cd46b16cf421fc4d439fc77b7d44a74dc80d" - url: "https://pub.dev" - source: hosted - version: "4.4.0" - cloud_functions_platform_interface: - dependency: transitive - description: - name: cloud_functions_platform_interface - sha256: "2d6bf40c9b9db65f89e97f0e74833794191df4398f7e92a6b1dd3201ec70cfb7" - url: "https://pub.dev" - source: hosted - version: "5.5.0" - cloud_functions_web: - dependency: transitive - description: - name: cloud_functions_web - sha256: "3937c217f90a51e251c37fc15a4c1be563b50d1f4268284f3ebf83ed70ba1ff8" - url: "https://pub.dev" - source: hosted - version: "4.6.0" collection: dependency: transitive description: @@ -126,22 +56,6 @@ packages: relative: true source: path version: "0.0.1" - device_info_plus: - dependency: transitive - description: - name: device_info_plus - sha256: "86add5ef97215562d2e090535b0a16f197902b10c369c558a100e74ea06e8659" - url: "https://pub.dev" - source: hosted - version: "9.0.3" - device_info_plus_platform_interface: - dependency: transitive - description: - name: device_info_plus_platform_interface - sha256: d3b01d5868b50ae571cd1dc6e502fc94d956b665756180f7b16ead09e836fd64 - url: "https://pub.dev" - source: hosted - version: "7.0.0" fake_async: dependency: transitive description: @@ -150,22 +64,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.1" - ffi: - dependency: transitive - description: - name: ffi - sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878" - url: "https://pub.dev" - source: hosted - version: "2.1.0" - file: - dependency: transitive - description: - name: file - sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" - url: "https://pub.dev" - source: hosted - version: "6.1.4" firebase_analytics: dependency: "direct main" description: @@ -190,30 +88,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.5.4+5" - firebase_auth: - dependency: "direct main" - description: - name: firebase_auth - sha256: "02d9cdf1305f0c22cde492802598a13a1975ec8aa05bf608be799f939352cbe8" - url: "https://pub.dev" - source: hosted - version: "4.8.0" - firebase_auth_platform_interface: - dependency: transitive - description: - name: firebase_auth_platform_interface - sha256: "19f8d0762544b72471b85bb56469448c3dc9f98b8b8574f744873ec18e04e18c" - url: "https://pub.dev" - source: hosted - version: "6.17.0" - firebase_auth_web: - dependency: transitive - description: - name: firebase_auth_web - sha256: ae01b306ae03856c1f0682796ea87bacaab72da44e4b728271c806db99620712 - url: "https://pub.dev" - source: hosted - version: "5.7.0" firebase_core: dependency: transitive description: @@ -254,14 +128,6 @@ packages: url: "https://pub.dev" source: hosted version: "3.6.5" - flare_flutter: - dependency: transitive - description: - name: flare_flutter - sha256: "99d63c60f00fac81249ce6410ee015d7b125c63d8278a30da81edf3317a1f6a0" - url: "https://pub.dev" - source: hosted - version: "3.0.2" flutter: dependency: "direct main" description: flutter @@ -275,22 +141,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.2" - flutter_staggered_animations: - dependency: transitive - description: - name: flutter_staggered_animations - sha256: "81d3c816c9bb0dca9e8a5d5454610e21ffb068aedb2bde49d2f8d04f75538351" - url: "https://pub.dev" - source: hosted - version: "1.1.1" - flutter_svg: - dependency: transitive - description: - name: flutter_svg - sha256: d39e7f95621fc84376bc0f7d504f05c3a41488c562f4a8ad410569127507402c - url: "https://pub.dev" - source: hosted - version: "2.0.9" flutter_test: dependency: "direct dev" description: flutter @@ -301,22 +151,6 @@ packages: description: flutter source: sdk version: "0.0.0" - http_parser: - dependency: transitive - description: - name: http_parser - sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" - url: "https://pub.dev" - source: hosted - version: "4.0.2" - intl: - dependency: transitive - description: - name: intl - sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d" - url: "https://pub.dev" - source: hosted - version: "0.18.1" js: dependency: transitive description: @@ -365,29 +199,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.8.3" - path_parsing: - dependency: transitive - description: - name: path_parsing - sha256: e3e67b1629e6f7e8100b367d3db6ba6af4b1f0bb80f64db18ef1fbabd2fa9ccf - url: "https://pub.dev" - source: hosted - version: "1.0.1" - petitparser: - dependency: transitive - description: - name: petitparser - sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27 - url: "https://pub.dev" - source: hosted - version: "6.0.2" - platform_check: - dependency: transitive - description: - path: "../platform_check" - relative: true - source: path - version: "0.0.1" plugin_platform_interface: dependency: transitive description: @@ -396,29 +207,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.5" - quiver: - dependency: transitive - description: - name: quiver - sha256: b1c1ac5ce6688d77f65f3375a9abb9319b3cb32486bdc7a1e0fdf004d7ba4e47 - url: "https://pub.dev" - source: hosted - version: "3.2.1" - rxdart: - dependency: transitive - description: - name: rxdart - sha256: "0c7c0cedd93788d996e33041ffecda924cc54389199cde4e6a34b440f50044cb" - url: "https://pub.dev" - source: hosted - version: "0.27.7" - sharezone_common: - dependency: "direct main" - description: - path: "../sharezone_common" - relative: true - source: path - version: "0.0.1" sharezone_lints: dependency: "direct dev" description: @@ -426,28 +214,6 @@ packages: relative: true source: path version: "1.0.0" - sharezone_utils: - dependency: "direct main" - description: - path: "../sharezone_utils" - relative: true - source: path - version: "0.0.1" - sharezone_widgets: - dependency: transitive - description: - path: "../sharezone_widgets" - relative: true - source: path - version: "0.0.1" - shimmer: - dependency: transitive - description: - name: shimmer - sha256: "1f1009b5845a1f88f1c5630212279540486f97409e9fc3f63883e71070d107bf" - url: "https://pub.dev" - source: hosted - version: "2.0.0" sky_engine: dependency: transitive description: flutter @@ -501,38 +267,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.6.1" - typed_data: - dependency: transitive - description: - name: typed_data - sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c - url: "https://pub.dev" - source: hosted - version: "1.3.2" - vector_graphics: - dependency: transitive - description: - name: vector_graphics - sha256: "0f0c746dd2d6254a0057218ff980fc7f5670fd0fcf5e4db38a490d31eed4ad43" - url: "https://pub.dev" - source: hosted - version: "1.1.9+1" - vector_graphics_codec: - dependency: transitive - description: - name: vector_graphics_codec - sha256: "0edf6d630d1bfd5589114138ed8fada3234deacc37966bec033d3047c29248b7" - url: "https://pub.dev" - source: hosted - version: "1.1.9+1" - vector_graphics_compiler: - dependency: transitive - description: - name: vector_graphics_compiler - sha256: d24333727332d9bd20990f1483af4e09abdb9b1fc7c3db940b56ab5c42790c26 - url: "https://pub.dev" - source: hosted - version: "1.1.9+1" vector_math: dependency: transitive description: @@ -549,30 +283,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.3.0" - win32: - dependency: transitive - description: - name: win32 - sha256: "5a751eddf9db89b3e5f9d50c20ab8612296e4e8db69009788d6c8b060a84191c" - url: "https://pub.dev" - source: hosted - version: "4.1.4" - win32_registry: - dependency: transitive - description: - name: win32_registry - sha256: "1c52f994bdccb77103a6231ad4ea331a244dbcef5d1f37d8462f713143b0bfae" - url: "https://pub.dev" - source: hosted - version: "1.1.0" - xml: - dependency: transitive - description: - name: xml - sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226 - url: "https://pub.dev" - source: hosted - version: "6.5.0" sdks: - dart: ">=3.2.3 <4.0.0" - flutter: ">=3.7.0-0" + dart: ">=3.2.0-194.0.dev <4.0.0" + flutter: ">=3.3.0" diff --git a/lib/analytics/pubspec.yaml b/lib/analytics/pubspec.yaml index ed9c63760..68e276701 100644 --- a/lib/analytics/pubspec.yaml +++ b/lib/analytics/pubspec.yaml @@ -19,12 +19,7 @@ dependencies: sdk: flutter crash_analytics: path: ../crash_analytics - sharezone_common: - path: ../sharezone_common - sharezone_utils: - path: ../sharezone_utils firebase_analytics: ^10.4.5 - firebase_auth: ^4.7.3 dev_dependencies: flutter_test: diff --git a/lib/app_functions/pubspec.lock b/lib/app_functions/pubspec.lock index db9eacf9e..22aa7625b 100644 --- a/lib/app_functions/pubspec.lock +++ b/lib/app_functions/pubspec.lock @@ -1,14 +1,6 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: - _flutterfire_internals: - dependency: transitive - description: - name: _flutterfire_internals - sha256: "1a5e13736d59235ce0139621b4bbe29bc89839e202409081bc667eb3cd20674c" - url: "https://pub.dev" - source: hosted - version: "1.3.5" args: dependency: transitive description: @@ -56,30 +48,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.1" - cloud_firestore: - dependency: transitive - description: - name: cloud_firestore - sha256: "0ff0baec167e308df192398dbd81ec13c1799635885c6aa6ed9ab8b5ed61f52c" - url: "https://pub.dev" - source: hosted - version: "4.9.1" - cloud_firestore_platform_interface: - dependency: transitive - description: - name: cloud_firestore_platform_interface - sha256: "5749b81aea93afdce220e02d34369162010d210011054ac494b2c38c4e9ebeb7" - url: "https://pub.dev" - source: hosted - version: "5.16.0" - cloud_firestore_web: - dependency: transitive - description: - name: cloud_firestore_web - sha256: fef99ad0599e983092adb1bb01f14a596dba601a7a8efaaffd7b2721d64e2c51 - url: "https://pub.dev" - source: hosted - version: "3.7.0" cloud_functions: dependency: "direct main" description: @@ -112,29 +80,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.18.0" - crash_analytics: - dependency: transitive - description: - path: "../crash_analytics" - relative: true - source: path - version: "0.0.1" - device_info_plus: - dependency: transitive - description: - name: device_info_plus - sha256: "0042cb3b2a76413ea5f8a2b40cec2a33e01d0c937e91f0f7c211fde4f7739ba6" - url: "https://pub.dev" - source: hosted - version: "9.1.1" - device_info_plus_platform_interface: - dependency: transitive - description: - name: device_info_plus_platform_interface - sha256: d3b01d5868b50ae571cd1dc6e502fc94d956b665756180f7b16ead09e836fd64 - url: "https://pub.dev" - source: hosted - version: "7.0.0" fake_async: dependency: transitive description: @@ -143,46 +88,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.1" - ffi: - dependency: transitive - description: - name: ffi - sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878" - url: "https://pub.dev" - source: hosted - version: "2.1.0" - file: - dependency: transitive - description: - name: file - sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" - url: "https://pub.dev" - source: hosted - version: "7.0.0" - firebase_auth: - dependency: transitive - description: - name: firebase_auth - sha256: "6d9be853426ab686d68076b8007ac29b2c31e7d549444a45b5c3fe1abc249fb0" - url: "https://pub.dev" - source: hosted - version: "4.9.0" - firebase_auth_platform_interface: - dependency: transitive - description: - name: firebase_auth_platform_interface - sha256: "2946cfdc17f925fa9771dd0ba3ce9dd2d019100a8685d0557c161f7786ea9b14" - url: "https://pub.dev" - source: hosted - version: "6.18.0" - firebase_auth_web: - dependency: transitive - description: - name: firebase_auth_web - sha256: d8972d754702a3f4881184706b8056e2837d0dae91613a43b988c960b8e0d988 - url: "https://pub.dev" - source: hosted - version: "5.8.0" firebase_core: dependency: transitive description: @@ -207,22 +112,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.7.0" - firebase_crashlytics: - dependency: transitive - description: - name: firebase_crashlytics - sha256: fd9e1a1cb7cce3f9dd2358d8363d235f25f056981e23a333db1e57eca693913f - url: "https://pub.dev" - source: hosted - version: "3.3.5" - firebase_crashlytics_platform_interface: - dependency: transitive - description: - name: firebase_crashlytics_platform_interface - sha256: "0d19ef23cf7a917a357d2eb1807338ec536ec3232e729ebd769f5bb2aba9e085" - url: "https://pub.dev" - source: hosted - version: "3.6.5" flare_flutter: dependency: transitive description: @@ -270,14 +159,13 @@ packages: description: flutter source: sdk version: "0.0.0" - http_parser: + helper_functions: dependency: transitive description: - name: http_parser - sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" - url: "https://pub.dev" - source: hosted - version: "4.0.2" + path: "../helper_functions" + relative: true + source: path + version: "0.0.1" intl: dependency: transitive description: @@ -365,14 +253,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.5" - quiver: - dependency: transitive - description: - name: quiver - sha256: b1c1ac5ce6688d77f65f3375a9abb9319b3cb32486bdc7a1e0fdf004d7ba4e47 - url: "https://pub.dev" - source: hosted - version: "3.2.1" rxdart: dependency: "direct main" description: @@ -381,13 +261,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.27.7" - sharezone_common: - dependency: transitive - description: - path: "../sharezone_common" - relative: true - source: path - version: "0.0.1" sharezone_lints: dependency: "direct dev" description: @@ -395,13 +268,6 @@ packages: relative: true source: path version: "1.0.0" - sharezone_utils: - dependency: transitive - description: - path: "../sharezone_utils" - relative: true - source: path - version: "0.0.1" sharezone_widgets: dependency: "direct main" description: @@ -470,14 +336,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.6.1" - typed_data: - dependency: transitive - description: - name: typed_data - sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c - url: "https://pub.dev" - source: hosted - version: "1.3.2" vector_graphics: dependency: transitive description: @@ -518,22 +376,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.3.0" - win32: - dependency: transitive - description: - name: win32 - sha256: b0f37db61ba2f2e9b7a78a1caece0052564d1bc70668156cf3a29d676fe4e574 - url: "https://pub.dev" - source: hosted - version: "5.1.1" - win32_registry: - dependency: transitive - description: - name: win32_registry - sha256: "41fd8a189940d8696b1b810efb9abcf60827b6cbfab90b0c43e8439e3a39d85a" - url: "https://pub.dev" - source: hosted - version: "1.1.2" xml: dependency: transitive description: diff --git a/lib/authentification/authentification_base/lib/src/analytics/events/authentifaction_event.dart b/lib/authentification/authentification_base/lib/src/analytics/events/authentifaction_event.dart index 45c142f12..c84a867ef 100644 --- a/lib/authentification/authentification_base/lib/src/analytics/events/authentifaction_event.dart +++ b/lib/authentification/authentification_base/lib/src/analytics/events/authentifaction_event.dart @@ -7,7 +7,7 @@ // SPDX-License-Identifier: EUPL-1.2 import 'package:analytics/analytics.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; class AuthentifactionEvent extends AnalyticsEvent { AuthentifactionEvent({ diff --git a/lib/authentification/authentification_base/lib/src/blocs/login_bloc.dart b/lib/authentification/authentification_base/lib/src/blocs/login_bloc.dart index 285c5d785..f2c5581cc 100644 --- a/lib/authentification/authentification_base/lib/src/blocs/login_bloc.dart +++ b/lib/authentification/authentification_base/lib/src/blocs/login_bloc.dart @@ -13,9 +13,9 @@ import 'package:authentification_base/authentification_google.dart'; import 'package:authentification_base/src/apple/apple_sign_in_logic.dart'; import 'package:bloc_base/bloc_base.dart'; import 'package:firebase_auth/firebase_auth.dart'; +import 'package:helper_functions/helper_functions.dart'; import 'package:rxdart/rxdart.dart'; import 'package:sharezone_common/api_errors.dart'; -import 'package:sharezone_common/helper_functions.dart'; import 'authentification_validators.dart'; diff --git a/lib/authentification/authentification_base/pubspec.lock b/lib/authentification/authentification_base/pubspec.lock index 3a706c9da..4ec110d7b 100644 --- a/lib/authentification/authentification_base/pubspec.lock +++ b/lib/authentification/authentification_base/pubspec.lock @@ -418,6 +418,13 @@ packages: url: "https://pub.dev" source: hosted version: "0.12.2+1" + helper_functions: + dependency: "direct main" + description: + path: "../../helper_functions" + relative: true + source: path + version: "0.0.1" html_unescape: dependency: transitive description: diff --git a/lib/authentification/authentification_base/pubspec.yaml b/lib/authentification/authentification_base/pubspec.yaml index b1927a24e..85e03ef8f 100644 --- a/lib/authentification/authentification_base/pubspec.yaml +++ b/lib/authentification/authentification_base/pubspec.yaml @@ -23,6 +23,8 @@ dependencies: path: ../../bloc_base platform_check: path: ../../platform_check + helper_functions: + path: ../../helper_functions sharezone_common: path: ../../sharezone_common streaming_shared_preferences: ^2.0.0 diff --git a/lib/authentification/authentification_qrcode/lib/src/models/qr_sign_in_document.dart b/lib/authentification/authentification_qrcode/lib/src/models/qr_sign_in_document.dart index 33b584a62..e57f75ee1 100644 --- a/lib/authentification/authentification_qrcode/lib/src/models/qr_sign_in_document.dart +++ b/lib/authentification/authentification_qrcode/lib/src/models/qr_sign_in_document.dart @@ -7,7 +7,7 @@ // SPDX-License-Identifier: EUPL-1.2 import 'package:authentification_qrcode/authentification_qrcode.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:sharezone_common/firebase_helper.dart'; class QrSignInDocument { final String? qrId; diff --git a/lib/authentification/authentification_qrcode/pubspec.lock b/lib/authentification/authentification_qrcode/pubspec.lock index f493fd3cf..40560c4df 100644 --- a/lib/authentification/authentification_qrcode/pubspec.lock +++ b/lib/authentification/authentification_qrcode/pubspec.lock @@ -457,6 +457,13 @@ packages: url: "https://pub.dev" source: hosted version: "0.12.2+1" + helper_functions: + dependency: transitive + description: + path: "../../helper_functions" + relative: true + source: path + version: "0.0.1" html_unescape: dependency: transitive description: diff --git a/lib/date/pubspec.lock b/lib/date/pubspec.lock index 5d8660455..74c173463 100644 --- a/lib/date/pubspec.lock +++ b/lib/date/pubspec.lock @@ -277,6 +277,13 @@ packages: description: flutter source: sdk version: "0.0.0" + helper_functions: + dependency: transitive + description: + path: "../helper_functions" + relative: true + source: path + version: "0.0.1" http_parser: dependency: transitive description: diff --git a/lib/design/pubspec.lock b/lib/design/pubspec.lock index d793eb62e..747a6ce3b 100644 --- a/lib/design/pubspec.lock +++ b/lib/design/pubspec.lock @@ -285,6 +285,13 @@ packages: description: flutter source: sdk version: "0.0.0" + helper_functions: + dependency: transitive + description: + path: "../helper_functions" + relative: true + source: path + version: "0.0.1" http_parser: dependency: transitive description: diff --git a/lib/filesharing/files_usecases/pubspec.lock b/lib/filesharing/files_usecases/pubspec.lock index 9b7b8c127..b9e73bb54 100644 --- a/lib/filesharing/files_usecases/pubspec.lock +++ b/lib/filesharing/files_usecases/pubspec.lock @@ -442,6 +442,13 @@ packages: description: flutter source: sdk version: "0.0.0" + helper_functions: + dependency: transitive + description: + path: "../../helper_functions" + relative: true + source: path + version: "0.0.1" html: dependency: transitive description: diff --git a/lib/filesharing/filesharing_logic/lib/src/models/change_activity.dart b/lib/filesharing/filesharing_logic/lib/src/models/change_activity.dart index e1c2e0c50..8c3e9e9c9 100644 --- a/lib/filesharing/filesharing_logic/lib/src/models/change_activity.dart +++ b/lib/filesharing/filesharing_logic/lib/src/models/change_activity.dart @@ -6,7 +6,7 @@ // // SPDX-License-Identifier: EUPL-1.2 -import 'package:sharezone_common/helper_functions.dart'; +import 'package:sharezone_common/firebase_helper.dart'; class ChangeActivity { final String? authorID; diff --git a/lib/filesharing/filesharing_logic/lib/src/models/cloud_file.dart b/lib/filesharing/filesharing_logic/lib/src/models/cloud_file.dart index c520d84d1..9afd8e4a1 100644 --- a/lib/filesharing/filesharing_logic/lib/src/models/cloud_file.dart +++ b/lib/filesharing/filesharing_logic/lib/src/models/cloud_file.dart @@ -8,7 +8,8 @@ import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:files_basics/files_models.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:sharezone_common/firebase_helper.dart'; + import 'change_activity.dart'; import 'folder_path.dart'; import 'reference_data.dart'; diff --git a/lib/filesharing/filesharing_logic/lib/src/models/filesharing_data.dart b/lib/filesharing/filesharing_logic/lib/src/models/filesharing_data.dart index 541c68a3e..699210c60 100644 --- a/lib/filesharing/filesharing_logic/lib/src/models/filesharing_data.dart +++ b/lib/filesharing/filesharing_logic/lib/src/models/filesharing_data.dart @@ -8,7 +8,8 @@ import 'dart:developer'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:sharezone_common/firebase_helper.dart'; + import 'filesharing_type.dart'; import 'folder.dart'; import 'folder_path.dart'; diff --git a/lib/filesharing/filesharing_logic/lib/src/models/folder.dart b/lib/filesharing/filesharing_logic/lib/src/models/folder.dart index 3c6574090..3ea129b68 100644 --- a/lib/filesharing/filesharing_logic/lib/src/models/folder.dart +++ b/lib/filesharing/filesharing_logic/lib/src/models/folder.dart @@ -10,7 +10,8 @@ import 'dart:developer'; import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:filesharing_logic/filesharing_logic_models.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; +import 'package:sharezone_common/firebase_helper.dart'; import 'package:sharezone_utils/random_string.dart'; class Folder { diff --git a/lib/filesharing/filesharing_logic/pubspec.lock b/lib/filesharing/filesharing_logic/pubspec.lock index 399444197..6ce02c6a0 100644 --- a/lib/filesharing/filesharing_logic/pubspec.lock +++ b/lib/filesharing/filesharing_logic/pubspec.lock @@ -442,6 +442,13 @@ packages: description: flutter source: sdk version: "0.0.0" + helper_functions: + dependency: "direct main" + description: + path: "../../helper_functions" + relative: true + source: path + version: "0.0.1" html: dependency: transitive description: diff --git a/lib/filesharing/filesharing_logic/pubspec.yaml b/lib/filesharing/filesharing_logic/pubspec.yaml index caa62fcce..99515bc71 100644 --- a/lib/filesharing/filesharing_logic/pubspec.yaml +++ b/lib/filesharing/filesharing_logic/pubspec.yaml @@ -31,6 +31,8 @@ dependencies: mime: ^1.0.0 path: ^1.8.3 permission_handler: ^10.2.0 + helper_functions: + path: ../../helper_functions dev_dependencies: flutter_test: diff --git a/lib/firebase_hausaufgabenheft_logik/lib/src/homework_dto.dart b/lib/firebase_hausaufgabenheft_logik/lib/src/homework_dto.dart index d253b5589..cbe067f94 100644 --- a/lib/firebase_hausaufgabenheft_logik/lib/src/homework_dto.dart +++ b/lib/firebase_hausaufgabenheft_logik/lib/src/homework_dto.dart @@ -8,7 +8,7 @@ import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:collection/collection.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:sharezone_common/firebase_helper.dart'; class HomeworkDto { final String id; diff --git a/lib/firebase_hausaufgabenheft_logik/pubspec.lock b/lib/firebase_hausaufgabenheft_logik/pubspec.lock index e7d717725..15079a9ad 100644 --- a/lib/firebase_hausaufgabenheft_logik/pubspec.lock +++ b/lib/firebase_hausaufgabenheft_logik/pubspec.lock @@ -346,6 +346,13 @@ packages: relative: true source: path version: "0.0.0" + helper_functions: + dependency: transitive + description: + path: "../helper_functions" + relative: true + source: path + version: "0.0.1" http: dependency: transitive description: diff --git a/lib/group_domain_implementation/pubspec.lock b/lib/group_domain_implementation/pubspec.lock index cbe5b11ad..ec2222f2e 100644 --- a/lib/group_domain_implementation/pubspec.lock +++ b/lib/group_domain_implementation/pubspec.lock @@ -345,6 +345,13 @@ packages: relative: true source: path version: "0.0.1" + helper_functions: + dependency: transitive + description: + path: "../helper_functions" + relative: true + source: path + version: "0.0.1" http: dependency: transitive description: diff --git a/lib/group_domain_models/lib/src/models/connections_data.dart b/lib/group_domain_models/lib/src/models/connections_data.dart index 531b81b79..b759798dd 100644 --- a/lib/group_domain_models/lib/src/models/connections_data.dart +++ b/lib/group_domain_models/lib/src/models/connections_data.dart @@ -7,7 +7,7 @@ // SPDX-License-Identifier: EUPL-1.2 import 'package:group_domain_models/group_domain_models.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:sharezone_common/firebase_helper.dart'; import 'package:sharezone_common/references.dart'; class ConnectionsData { diff --git a/lib/group_domain_models/lib/src/models/course.dart b/lib/group_domain_models/lib/src/models/course.dart index 2ecfdd2af..0c25dcc4d 100644 --- a/lib/group_domain_models/lib/src/models/course.dart +++ b/lib/group_domain_models/lib/src/models/course.dart @@ -9,7 +9,7 @@ import 'package:common_domain_models/common_domain_models.dart'; import 'package:design/design.dart'; import 'package:flutter/foundation.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:sharezone_common/firebase_helper.dart'; import 'group_info.dart'; import 'group_type.dart'; diff --git a/lib/group_domain_models/lib/src/models/member.dart b/lib/group_domain_models/lib/src/models/member.dart index 080fd70bc..06a89e4d8 100644 --- a/lib/group_domain_models/lib/src/models/member.dart +++ b/lib/group_domain_models/lib/src/models/member.dart @@ -8,7 +8,7 @@ import 'package:common_domain_models/common_domain_models.dart'; import 'package:flutter/foundation.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:sharezone_common/firebase_helper.dart'; import 'package:user/user.dart'; import 'member_role.dart'; diff --git a/lib/group_domain_models/pubspec.lock b/lib/group_domain_models/pubspec.lock index 1d0b6fc24..adf830fdb 100644 --- a/lib/group_domain_models/pubspec.lock +++ b/lib/group_domain_models/pubspec.lock @@ -338,6 +338,13 @@ packages: description: flutter source: sdk version: "0.0.0" + helper_functions: + dependency: transitive + description: + path: "../helper_functions" + relative: true + source: path + version: "0.0.1" http: dependency: transitive description: diff --git a/lib/helper_functions/.gitignore b/lib/helper_functions/.gitignore new file mode 100644 index 000000000..bb431f0d5 --- /dev/null +++ b/lib/helper_functions/.gitignore @@ -0,0 +1,75 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +build/ + +# Android related +**/android/**/gradle-wrapper.jar +**/android/.gradle +**/android/captures/ +**/android/gradlew +**/android/gradlew.bat +**/android/local.properties +**/android/**/GeneratedPluginRegistrant.java + +# iOS/XCode related +**/ios/**/*.mode1v3 +**/ios/**/*.mode2v3 +**/ios/**/*.moved-aside +**/ios/**/*.pbxuser +**/ios/**/*.perspectivev3 +**/ios/**/*sync/ +**/ios/**/.sconsign.dblite +**/ios/**/.tags* +**/ios/**/.vagrant/ +**/ios/**/DerivedData/ +**/ios/**/Icon? +**/ios/**/Pods/ +**/ios/**/.symlinks/ +**/ios/**/profile +**/ios/**/xcuserdata +**/ios/.generated/ +**/ios/Flutter/App.framework +**/ios/Flutter/Flutter.framework +**/ios/Flutter/Flutter.podspec +**/ios/Flutter/Generated.xcconfig +**/ios/Flutter/app.flx +**/ios/Flutter/app.zip +**/ios/Flutter/flutter_assets/ +**/ios/Flutter/flutter_export_environment.sh +**/ios/ServiceDefinitions.json +**/ios/Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!**/ios/**/default.mode1v3 +!**/ios/**/default.mode2v3 +!**/ios/**/default.pbxuser +!**/ios/**/default.perspectivev3 +!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages diff --git a/lib/helper_functions/.metadata b/lib/helper_functions/.metadata new file mode 100644 index 000000000..bae65c434 --- /dev/null +++ b/lib/helper_functions/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: 18cd7a3601bcffb36fdf2f679f763b5e827c2e8e + channel: beta + +project_type: package diff --git a/lib/helper_functions/analysis_options.yaml b/lib/helper_functions/analysis_options.yaml new file mode 100644 index 000000000..1e445c14e --- /dev/null +++ b/lib/helper_functions/analysis_options.yaml @@ -0,0 +1,9 @@ +# Copyright (c) 2023 Sharezone UG (haftungsbeschränkt) +# Licensed under the EUPL-1.2-or-later. +# +# You may obtain a copy of the Licence at: +# https://joinup.ec.europa.eu/software/page/eupl +# +# SPDX-License-Identifier: EUPL-1.2 + +include: package:sharezone_lints/analysis_options.yaml diff --git a/lib/sharezone_common/lib/helper_functions.dart b/lib/helper_functions/lib/helper_functions.dart similarity index 100% rename from lib/sharezone_common/lib/helper_functions.dart rename to lib/helper_functions/lib/helper_functions.dart diff --git a/lib/helper_functions/lib/src/helper_functions.dart b/lib/helper_functions/lib/src/helper_functions.dart new file mode 100644 index 000000000..d58003cf5 --- /dev/null +++ b/lib/helper_functions/lib/src/helper_functions.dart @@ -0,0 +1,32 @@ +// Copyright (c) 2022 Sharezone UG (haftungsbeschränkt) +// Licensed under the EUPL-1.2-or-later. +// +// You may obtain a copy of the Licence at: +// https://joinup.ec.europa.eu/software/page/eupl +// +// SPDX-License-Identifier: EUPL-1.2 + +bool isNotEmptyOrNull(String? value) => !isEmptyOrNull(value); + +bool isEmptyOrNull(String? value) { + return value == null || value.isEmpty; +} + +extension EnumByNameWithDefault on Iterable { + T tryByName(String? name, {T? defaultValue}) { + for (T value in this) { + if (value.name == name) return value; + } + + if (defaultValue != null) return defaultValue; + throw ArgumentError.value(name, "name", "No enum value with that name"); + } + + T? byNameOrNull(String? name) { + for (T value in this) { + if (value.name == name) return value; + } + + return null; + } +} diff --git a/lib/helper_functions/pubspec.lock b/lib/helper_functions/pubspec.lock new file mode 100644 index 000000000..c2319c3ea --- /dev/null +++ b/lib/helper_functions/pubspec.lock @@ -0,0 +1,28 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + flutter_lints: + dependency: transitive + description: + name: flutter_lints + sha256: "2118df84ef0c3ca93f96123a616ae8540879991b8b57af2f81b76a7ada49b2a4" + url: "https://pub.dev" + source: hosted + version: "2.0.2" + lints: + dependency: transitive + description: + name: lints + sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + sharezone_lints: + dependency: "direct dev" + description: + path: "../sharezone_lints" + relative: true + source: path + version: "1.0.0" +sdks: + dart: ">=3.2.3 <4.0.0" diff --git a/lib/helper_functions/pubspec.yaml b/lib/helper_functions/pubspec.yaml new file mode 100644 index 000000000..0cbd4b8e2 --- /dev/null +++ b/lib/helper_functions/pubspec.yaml @@ -0,0 +1,19 @@ +# Copyright (c) 2022 Sharezone UG (haftungsbeschränkt) +# Licensed under the EUPL-1.2-or-later. +# +# You may obtain a copy of the Licence at: +# https://joinup.ec.europa.eu/software/page/eupl +# +# SPDX-License-Identifier: EUPL-1.2 + +name: helper_functions +description: A package containing helper functions. +version: 0.0.1 +publish_to: none + +environment: + sdk: '>=3.2.3 <4.0.0' + +dev_dependencies: + sharezone_lints: + path: ../sharezone_lints diff --git a/lib/holidays/pubspec.lock b/lib/holidays/pubspec.lock index ac75e4a83..a2950de70 100644 --- a/lib/holidays/pubspec.lock +++ b/lib/holidays/pubspec.lock @@ -9,14 +9,6 @@ packages: url: "https://pub.dev" source: hosted version: "61.0.0" - _flutterfire_internals: - dependency: transitive - description: - name: _flutterfire_internals - sha256: "1a5e13736d59235ce0139621b4bbe29bc89839e202409081bc667eb3cd20674c" - url: "https://pub.dev" - source: hosted - version: "1.3.5" analyzer: dependency: transitive description: @@ -159,30 +151,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.1" - cloud_firestore: - dependency: transitive - description: - name: cloud_firestore - sha256: "0ff0baec167e308df192398dbd81ec13c1799635885c6aa6ed9ab8b5ed61f52c" - url: "https://pub.dev" - source: hosted - version: "4.9.1" - cloud_firestore_platform_interface: - dependency: transitive - description: - name: cloud_firestore_platform_interface - sha256: "5749b81aea93afdce220e02d34369162010d210011054ac494b2c38c4e9ebeb7" - url: "https://pub.dev" - source: hosted - version: "5.16.0" - cloud_firestore_web: - dependency: transitive - description: - name: cloud_firestore_web - sha256: fef99ad0599e983092adb1bb01f14a596dba601a7a8efaaffd7b2721d64e2c51 - url: "https://pub.dev" - source: hosted - version: "3.7.0" cloud_functions: dependency: "direct main" description: @@ -231,13 +199,6 @@ packages: url: "https://pub.dev" source: hosted version: "3.1.1" - crash_analytics: - dependency: transitive - description: - path: "../crash_analytics" - relative: true - source: path - version: "0.0.1" crypto: dependency: transitive description: @@ -254,22 +215,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.3.2" - device_info_plus: - dependency: transitive - description: - name: device_info_plus - sha256: "0042cb3b2a76413ea5f8a2b40cec2a33e01d0c937e91f0f7c211fde4f7739ba6" - url: "https://pub.dev" - source: hosted - version: "9.1.1" - device_info_plus_platform_interface: - dependency: transitive - description: - name: device_info_plus_platform_interface - sha256: d3b01d5868b50ae571cd1dc6e502fc94d956b665756180f7b16ead09e836fd64 - url: "https://pub.dev" - source: hosted - version: "7.0.0" fake_async: dependency: transitive description: @@ -278,14 +223,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.1" - ffi: - dependency: transitive - description: - name: ffi - sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878" - url: "https://pub.dev" - source: hosted - version: "2.1.0" file: dependency: transitive description: @@ -294,30 +231,6 @@ packages: url: "https://pub.dev" source: hosted version: "7.0.0" - firebase_auth: - dependency: transitive - description: - name: firebase_auth - sha256: "6d9be853426ab686d68076b8007ac29b2c31e7d549444a45b5c3fe1abc249fb0" - url: "https://pub.dev" - source: hosted - version: "4.9.0" - firebase_auth_platform_interface: - dependency: transitive - description: - name: firebase_auth_platform_interface - sha256: "2946cfdc17f925fa9771dd0ba3ce9dd2d019100a8685d0557c161f7786ea9b14" - url: "https://pub.dev" - source: hosted - version: "6.18.0" - firebase_auth_web: - dependency: transitive - description: - name: firebase_auth_web - sha256: d8972d754702a3f4881184706b8056e2837d0dae91613a43b988c960b8e0d988 - url: "https://pub.dev" - source: hosted - version: "5.8.0" firebase_core: dependency: transitive description: @@ -342,22 +255,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.7.0" - firebase_crashlytics: - dependency: transitive - description: - name: firebase_crashlytics - sha256: fd9e1a1cb7cce3f9dd2358d8363d235f25f056981e23a333db1e57eca693913f - url: "https://pub.dev" - source: hosted - version: "3.3.5" - firebase_crashlytics_platform_interface: - dependency: transitive - description: - name: firebase_crashlytics_platform_interface - sha256: "0d19ef23cf7a917a357d2eb1807338ec536ec3232e729ebd769f5bb2aba9e085" - url: "https://pub.dev" - source: hosted - version: "3.6.5" fixnum: dependency: transitive description: @@ -437,6 +334,13 @@ packages: url: "https://pub.dev" source: hosted version: "2.3.1" + helper_functions: + dependency: transitive + description: + path: "../helper_functions" + relative: true + source: path + version: "0.0.1" http_multi_server: dependency: transitive description: @@ -619,14 +523,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.3" - quiver: - dependency: transitive - description: - name: quiver - sha256: b1c1ac5ce6688d77f65f3375a9abb9319b3cb32486bdc7a1e0fdf004d7ba4e47 - url: "https://pub.dev" - source: hosted - version: "3.2.1" rxdart: dependency: transitive description: @@ -635,13 +531,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.27.7" - sharezone_common: - dependency: transitive - description: - path: "../sharezone_common" - relative: true - source: path - version: "0.0.1" sharezone_lints: dependency: "direct dev" description: @@ -649,13 +538,6 @@ packages: relative: true source: path version: "1.0.0" - sharezone_utils: - dependency: transitive - description: - path: "../sharezone_utils" - relative: true - source: path - version: "0.0.1" sharezone_widgets: dependency: transitive description: @@ -828,22 +710,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.4.0" - win32: - dependency: transitive - description: - name: win32 - sha256: b0f37db61ba2f2e9b7a78a1caece0052564d1bc70668156cf3a29d676fe4e574 - url: "https://pub.dev" - source: hosted - version: "5.1.1" - win32_registry: - dependency: transitive - description: - name: win32_registry - sha256: "41fd8a189940d8696b1b810efb9abcf60827b6cbfab90b0c43e8439e3a39d85a" - url: "https://pub.dev" - source: hosted - version: "1.1.2" xml: dependency: transitive description: diff --git a/lib/last_online_reporting/pubspec.lock b/lib/last_online_reporting/pubspec.lock index 16572aeb7..53fa1cfff 100644 --- a/lib/last_online_reporting/pubspec.lock +++ b/lib/last_online_reporting/pubspec.lock @@ -316,6 +316,13 @@ packages: description: flutter source: sdk version: "0.0.0" + helper_functions: + dependency: transitive + description: + path: "../helper_functions" + relative: true + source: path + version: "0.0.1" http: dependency: transitive description: diff --git a/lib/sharezone_common/lib/firebase_helper.dart b/lib/sharezone_common/lib/firebase_helper.dart new file mode 100644 index 000000000..c59c6fcc6 --- /dev/null +++ b/lib/sharezone_common/lib/firebase_helper.dart @@ -0,0 +1,11 @@ +// Copyright (c) 2022 Sharezone UG (haftungsbeschränkt) +// Licensed under the EUPL-1.2-or-later. +// +// You may obtain a copy of the Licence at: +// https://joinup.ec.europa.eu/software/page/eupl +// +// SPDX-License-Identifier: EUPL-1.2 + +library firebase_helper; + +export 'src/firebase_helper.dart'; diff --git a/lib/sharezone_common/lib/src/helper_functions.dart b/lib/sharezone_common/lib/src/firebase_helper.dart similarity index 71% rename from lib/sharezone_common/lib/src/helper_functions.dart rename to lib/sharezone_common/lib/src/firebase_helper.dart index 53f761c34..3a0c9ced2 100644 --- a/lib/sharezone_common/lib/src/helper_functions.dart +++ b/lib/sharezone_common/lib/src/firebase_helper.dart @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Sharezone UG (haftungsbeschränkt) +// Copyright (c) 2023 Sharezone UG (haftungsbeschränkt) // Licensed under the EUPL-1.2-or-later. // // You may obtain a copy of the Licence at: @@ -8,8 +8,6 @@ import 'package:cloud_firestore/cloud_firestore.dart'; -/// Convert Enum to String - typedef ObjectMapBuilder = T Function(String key, dynamic decodedMapValue); typedef ObjectListBuilder = T Function(dynamic decodedMapValue); @@ -40,14 +38,6 @@ List decodeList(dynamic data, ObjectListBuilder builder) { return originaldata.map((dynamic value) => builder(value)).toList(); } -bool isNotEmptyOrNull(String? value) => !isEmptyOrNull(value); - -bool isEmptyOrNull(String? value) { - return value == null || value.isEmpty; -} - -dynamic emptyFirestoreValue() => FieldValue.delete(); - DateTime dateTimeFromTimestamp(Timestamp? timestamp) => (timestamp ?? Timestamp.now()).toDate(); DateTime? dateTimeFromTimestampOrNull(Timestamp? timestamp) { @@ -59,22 +49,3 @@ Timestamp? timestampFromDateTime(DateTime? dateTime) { if (dateTime == null) return null; return Timestamp.fromDate(dateTime); } - -extension EnumByNameWithDefault on Iterable { - T tryByName(String? name, {T? defaultValue}) { - for (T value in this) { - if (value.name == name) return value; - } - - if (defaultValue != null) return defaultValue; - throw ArgumentError.value(name, "name", "No enum value with that name"); - } - - T? byNameOrNull(String? name) { - for (T value in this) { - if (value.name == name) return value; - } - - return null; - } -} diff --git a/lib/sharezone_common/pubspec.lock b/lib/sharezone_common/pubspec.lock index 83cf9a1e8..87dc98dcd 100644 --- a/lib/sharezone_common/pubspec.lock +++ b/lib/sharezone_common/pubspec.lock @@ -5,10 +5,10 @@ packages: dependency: transitive description: name: _flutterfire_internals - sha256: "1a5e13736d59235ce0139621b4bbe29bc89839e202409081bc667eb3cd20674c" + sha256: f5628cd9c92ed11083f425fd1f8f1bc60ecdda458c81d73b143aeda036c35fe7 url: "https://pub.dev" source: hosted - version: "1.3.5" + version: "1.3.16" app_functions: dependency: "direct main" description: @@ -67,50 +67,50 @@ packages: dependency: "direct main" description: name: cloud_firestore - sha256: "21cffe06a212015950010ecb9adbf1eb9acaf294f2bd159bde7980aee37c997b" + sha256: cb978c7512624144f24f3d06e4312b2f4ac00b016f2fed62dc8f6d56b8585d78 url: "https://pub.dev" source: hosted - version: "4.9.0" + version: "4.13.6" cloud_firestore_platform_interface: dependency: transitive description: name: cloud_firestore_platform_interface - sha256: "5749b81aea93afdce220e02d34369162010d210011054ac494b2c38c4e9ebeb7" + sha256: fa177fa85f7665c76e1ebec252a5b280b4b47612b4d70fe286944814fff1d4f2 url: "https://pub.dev" source: hosted - version: "5.16.0" + version: "6.0.10" cloud_firestore_web: dependency: transitive description: name: cloud_firestore_web - sha256: fef99ad0599e983092adb1bb01f14a596dba601a7a8efaaffd7b2721d64e2c51 + sha256: d0ebbf0927e627c0d7d2f3177d3b6f0050e5d811c08c2b646b0c746a2b502cb7 url: "https://pub.dev" source: hosted - version: "3.7.0" + version: "3.8.10" cloud_functions: dependency: transitive description: name: cloud_functions - sha256: "6c5ce6c78bcf92b422b58e76dc33cd46b16cf421fc4d439fc77b7d44a74dc80d" + sha256: de4a402a1dfad27b81c5b13ee3df7693c49139625a6f19854376d617b2f1cd2f url: "https://pub.dev" source: hosted - version: "4.4.0" + version: "4.5.8" cloud_functions_platform_interface: dependency: transitive description: name: cloud_functions_platform_interface - sha256: "2d6bf40c9b9db65f89e97f0e74833794191df4398f7e92a6b1dd3201ec70cfb7" + sha256: "8e291d2677010fd85021698a3906ef090fd2f53528e2bc1bf45fbe5dbbddf037" url: "https://pub.dev" source: hosted - version: "5.5.0" + version: "5.5.11" cloud_functions_web: dependency: transitive description: name: cloud_functions_web - sha256: "3937c217f90a51e251c37fc15a4c1be563b50d1f4268284f3ebf83ed70ba1ff8" + sha256: "1d3799204b8b367952bb7ca292bdcec1ed07129b04a8be9f2c298aa77e6f1aa0" url: "https://pub.dev" source: hosted - version: "4.6.0" + version: "4.6.11" collection: dependency: transitive description: @@ -170,66 +170,66 @@ packages: dependency: "direct main" description: name: firebase_auth - sha256: "02d9cdf1305f0c22cde492802598a13a1975ec8aa05bf608be799f939352cbe8" + sha256: "88f88d541a2c1903c023355e13d077835573a200bbf57e12a6a2c24bf99665a1" url: "https://pub.dev" source: hosted - version: "4.8.0" + version: "4.15.3" firebase_auth_platform_interface: dependency: transitive description: name: firebase_auth_platform_interface - sha256: "19f8d0762544b72471b85bb56469448c3dc9f98b8b8574f744873ec18e04e18c" + sha256: "3c9cfaccb7549492edf5b0c67c6dd1c6727c7830891aa6727f2fb225f0226626" url: "https://pub.dev" source: hosted - version: "6.17.0" + version: "7.0.9" firebase_auth_web: dependency: transitive description: name: firebase_auth_web - sha256: ae01b306ae03856c1f0682796ea87bacaab72da44e4b728271c806db99620712 + sha256: c09515414c07c11bb133aec4baae9a74c6ff1f62bf05ace54564db82b8c87852 url: "https://pub.dev" source: hosted - version: "5.7.0" + version: "5.8.12" firebase_core: dependency: transitive description: name: firebase_core - sha256: c78132175edda4bc532a71e01a32964e4b4fcf53de7853a422d96dac3725f389 + sha256: "96607c0e829a581c2a483c658f04e8b159964c3bae2730f73297070bc85d40bb" url: "https://pub.dev" source: hosted - version: "2.15.1" + version: "2.24.2" firebase_core_platform_interface: dependency: transitive description: name: firebase_core_platform_interface - sha256: b63e3be6c96ef5c33bdec1aab23c91eb00696f6452f0519401d640938c94cba2 + sha256: c437ae5d17e6b5cc7981cf6fd458a5db4d12979905f9aafd1fea930428a9fe63 url: "https://pub.dev" source: hosted - version: "4.8.0" + version: "5.0.0" firebase_core_web: dependency: transitive description: name: firebase_core_web - sha256: "4cf4d2161530332ddc3c562f19823fb897ff37a9a774090d28df99f47370e973" + sha256: d585bdf3c656c3f7821ba1bd44da5f13365d22fcecaf5eb75c4295246aaa83c0 url: "https://pub.dev" source: hosted - version: "2.7.0" + version: "2.10.0" firebase_crashlytics: dependency: transitive description: name: firebase_crashlytics - sha256: fd9e1a1cb7cce3f9dd2358d8363d235f25f056981e23a333db1e57eca693913f + sha256: "5ccdf05de039f9544d0ba41c5ae2052ca2425985d32229911b09f69981164518" url: "https://pub.dev" source: hosted - version: "3.3.5" + version: "3.4.8" firebase_crashlytics_platform_interface: dependency: transitive description: name: firebase_crashlytics_platform_interface - sha256: "0d19ef23cf7a917a357d2eb1807338ec536ec3232e729ebd769f5bb2aba9e085" + sha256: "359197344def001589c84f8d1d57c05f6e2e773f559205610ce58c25e2045a57" url: "https://pub.dev" source: hosted - version: "3.6.5" + version: "3.6.16" flare_flutter: dependency: transitive description: @@ -277,6 +277,13 @@ packages: description: flutter source: sdk version: "0.0.0" + helper_functions: + dependency: "direct main" + description: + path: "../helper_functions" + relative: true + source: path + version: "0.0.1" http_parser: dependency: transitive description: diff --git a/lib/sharezone_common/pubspec.yaml b/lib/sharezone_common/pubspec.yaml index 7184134ce..f3ced0c18 100644 --- a/lib/sharezone_common/pubspec.yaml +++ b/lib/sharezone_common/pubspec.yaml @@ -25,6 +25,9 @@ dependencies: path: ../sharezone_utils cloud_firestore: ^4.8.5 firebase_auth: ^4.7.3 + helper_functions: + path: ../helper_functions + intl: ^0.18.1 quiver: any diff --git a/lib/sharezone_widgets/lib/src/adaptive_dialog/column_actions_dialog/column_actions_dialog.dart b/lib/sharezone_widgets/lib/src/adaptive_dialog/column_actions_dialog/column_actions_dialog.dart index 3f316c092..b0824831d 100644 --- a/lib/sharezone_widgets/lib/src/adaptive_dialog/column_actions_dialog/column_actions_dialog.dart +++ b/lib/sharezone_widgets/lib/src/adaptive_dialog/column_actions_dialog/column_actions_dialog.dart @@ -8,7 +8,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; import 'package:platform_check/platform_check.dart'; import 'package:sharezone_widgets/src/dialog_wrapper.dart'; diff --git a/lib/sharezone_widgets/lib/src/adaptive_dialog/left_and_right_action_dialog/left_and_right_action_adaptive_dialog.dart b/lib/sharezone_widgets/lib/src/adaptive_dialog/left_and_right_action_dialog/left_and_right_action_adaptive_dialog.dart index dcbd50a2a..bce4ac988 100644 --- a/lib/sharezone_widgets/lib/src/adaptive_dialog/left_and_right_action_dialog/left_and_right_action_adaptive_dialog.dart +++ b/lib/sharezone_widgets/lib/src/adaptive_dialog/left_and_right_action_dialog/left_and_right_action_adaptive_dialog.dart @@ -8,7 +8,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; import 'package:platform_check/platform_check.dart'; import 'package:sharezone_widgets/sharezone_widgets.dart'; diff --git a/lib/sharezone_widgets/lib/src/adaptive_dialog/long_press_dialog/long_press_adaptive_dialog.dart b/lib/sharezone_widgets/lib/src/adaptive_dialog/long_press_dialog/long_press_adaptive_dialog.dart index 56a2191aa..5a62d6f40 100644 --- a/lib/sharezone_widgets/lib/src/adaptive_dialog/long_press_dialog/long_press_adaptive_dialog.dart +++ b/lib/sharezone_widgets/lib/src/adaptive_dialog/long_press_dialog/long_press_adaptive_dialog.dart @@ -8,7 +8,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; import 'package:platform_check/platform_check.dart'; import 'package:sharezone_widgets/sharezone_widgets.dart'; diff --git a/lib/sharezone_widgets/lib/src/announcement_card.dart b/lib/sharezone_widgets/lib/src/announcement_card.dart index 0b1e4a154..631f013e3 100644 --- a/lib/sharezone_widgets/lib/src/announcement_card.dart +++ b/lib/sharezone_widgets/lib/src/announcement_card.dart @@ -7,7 +7,7 @@ // SPDX-License-Identifier: EUPL-1.2 import 'package:flutter/material.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; import 'package:sharezone_widgets/sharezone_widgets.dart'; import 'package:build_context/build_context.dart'; diff --git a/lib/sharezone_widgets/lib/src/placeholder.dart b/lib/sharezone_widgets/lib/src/placeholder.dart index 2e5f48d04..1c2e239ea 100644 --- a/lib/sharezone_widgets/lib/src/placeholder.dart +++ b/lib/sharezone_widgets/lib/src/placeholder.dart @@ -9,7 +9,7 @@ import 'package:flare_flutter/flare_actor.dart'; import 'package:flutter/material.dart'; import 'package:flutter_staggered_animations/flutter_staggered_animations.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; import 'package:sharezone_widgets/sharezone_widgets.dart'; /// This is the Model of the EmptyList diff --git a/lib/sharezone_widgets/lib/src/widgets.dart b/lib/sharezone_widgets/lib/src/widgets.dart index 64311113a..e45160b85 100644 --- a/lib/sharezone_widgets/lib/src/widgets.dart +++ b/lib/sharezone_widgets/lib/src/widgets.dart @@ -11,7 +11,7 @@ import 'dart:developer'; import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; import 'package:sharezone_widgets/sharezone_widgets.dart'; export 'prefilled_text_field.dart'; diff --git a/lib/sharezone_widgets/pubspec.lock b/lib/sharezone_widgets/pubspec.lock index 82917634f..b21b4abf7 100644 --- a/lib/sharezone_widgets/pubspec.lock +++ b/lib/sharezone_widgets/pubspec.lock @@ -1,21 +1,6 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: - _flutterfire_internals: - dependency: transitive - description: - name: _flutterfire_internals - sha256: "1a5e13736d59235ce0139621b4bbe29bc89839e202409081bc667eb3cd20674c" - url: "https://pub.dev" - source: hosted - version: "1.3.5" - app_functions: - dependency: transitive - description: - path: "../app_functions" - relative: true - source: path - version: "0.0.1" args: dependency: transitive description: @@ -63,54 +48,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.1" - cloud_firestore: - dependency: transitive - description: - name: cloud_firestore - sha256: "21cffe06a212015950010ecb9adbf1eb9acaf294f2bd159bde7980aee37c997b" - url: "https://pub.dev" - source: hosted - version: "4.9.0" - cloud_firestore_platform_interface: - dependency: transitive - description: - name: cloud_firestore_platform_interface - sha256: "5749b81aea93afdce220e02d34369162010d210011054ac494b2c38c4e9ebeb7" - url: "https://pub.dev" - source: hosted - version: "5.16.0" - cloud_firestore_web: - dependency: transitive - description: - name: cloud_firestore_web - sha256: fef99ad0599e983092adb1bb01f14a596dba601a7a8efaaffd7b2721d64e2c51 - url: "https://pub.dev" - source: hosted - version: "3.7.0" - cloud_functions: - dependency: transitive - description: - name: cloud_functions - sha256: "6c5ce6c78bcf92b422b58e76dc33cd46b16cf421fc4d439fc77b7d44a74dc80d" - url: "https://pub.dev" - source: hosted - version: "4.4.0" - cloud_functions_platform_interface: - dependency: transitive - description: - name: cloud_functions_platform_interface - sha256: "2d6bf40c9b9db65f89e97f0e74833794191df4398f7e92a6b1dd3201ec70cfb7" - url: "https://pub.dev" - source: hosted - version: "5.5.0" - cloud_functions_web: - dependency: transitive - description: - name: cloud_functions_web - sha256: "3937c217f90a51e251c37fc15a4c1be563b50d1f4268284f3ebf83ed70ba1ff8" - url: "https://pub.dev" - source: hosted - version: "4.6.0" collection: dependency: transitive description: @@ -119,29 +56,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.18.0" - crash_analytics: - dependency: transitive - description: - path: "../crash_analytics" - relative: true - source: path - version: "0.0.1" - device_info_plus: - dependency: transitive - description: - name: device_info_plus - sha256: "86add5ef97215562d2e090535b0a16f197902b10c369c558a100e74ea06e8659" - url: "https://pub.dev" - source: hosted - version: "9.0.3" - device_info_plus_platform_interface: - dependency: transitive - description: - name: device_info_plus_platform_interface - sha256: d3b01d5868b50ae571cd1dc6e502fc94d956b665756180f7b16ead09e836fd64 - url: "https://pub.dev" - source: hosted - version: "7.0.0" fake_async: dependency: transitive description: @@ -150,86 +64,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.1" - ffi: - dependency: transitive - description: - name: ffi - sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878" - url: "https://pub.dev" - source: hosted - version: "2.1.0" - file: - dependency: transitive - description: - name: file - sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" - url: "https://pub.dev" - source: hosted - version: "6.1.4" - firebase_auth: - dependency: transitive - description: - name: firebase_auth - sha256: "02d9cdf1305f0c22cde492802598a13a1975ec8aa05bf608be799f939352cbe8" - url: "https://pub.dev" - source: hosted - version: "4.8.0" - firebase_auth_platform_interface: - dependency: transitive - description: - name: firebase_auth_platform_interface - sha256: "19f8d0762544b72471b85bb56469448c3dc9f98b8b8574f744873ec18e04e18c" - url: "https://pub.dev" - source: hosted - version: "6.17.0" - firebase_auth_web: - dependency: transitive - description: - name: firebase_auth_web - sha256: ae01b306ae03856c1f0682796ea87bacaab72da44e4b728271c806db99620712 - url: "https://pub.dev" - source: hosted - version: "5.7.0" - firebase_core: - dependency: transitive - description: - name: firebase_core - sha256: c78132175edda4bc532a71e01a32964e4b4fcf53de7853a422d96dac3725f389 - url: "https://pub.dev" - source: hosted - version: "2.15.1" - firebase_core_platform_interface: - dependency: transitive - description: - name: firebase_core_platform_interface - sha256: b63e3be6c96ef5c33bdec1aab23c91eb00696f6452f0519401d640938c94cba2 - url: "https://pub.dev" - source: hosted - version: "4.8.0" - firebase_core_web: - dependency: transitive - description: - name: firebase_core_web - sha256: "4cf4d2161530332ddc3c562f19823fb897ff37a9a774090d28df99f47370e973" - url: "https://pub.dev" - source: hosted - version: "2.7.0" - firebase_crashlytics: - dependency: transitive - description: - name: firebase_crashlytics - sha256: fd9e1a1cb7cce3f9dd2358d8363d235f25f056981e23a333db1e57eca693913f - url: "https://pub.dev" - source: hosted - version: "3.3.5" - firebase_crashlytics_platform_interface: - dependency: transitive - description: - name: firebase_crashlytics_platform_interface - sha256: "0d19ef23cf7a917a357d2eb1807338ec536ec3232e729ebd769f5bb2aba9e085" - url: "https://pub.dev" - source: hosted - version: "3.6.5" flare_flutter: dependency: "direct main" description: @@ -272,11 +106,6 @@ packages: description: flutter source: sdk version: "0.0.0" - flutter_web_plugins: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" golden_toolkit: dependency: "direct dev" description: @@ -285,14 +114,13 @@ packages: url: "https://pub.dev" source: hosted version: "0.15.0" - http_parser: - dependency: transitive + helper_functions: + dependency: "direct main" description: - name: http_parser - sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" - url: "https://pub.dev" - source: hosted - version: "4.0.2" + path: "../helper_functions" + relative: true + source: path + version: "0.0.1" intl: dependency: "direct main" description: @@ -301,14 +129,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.18.1" - js: - dependency: transitive - description: - name: js - sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 - url: "https://pub.dev" - source: hosted - version: "0.6.7" lints: dependency: transitive description: @@ -372,22 +192,6 @@ packages: relative: true source: path version: "0.0.1" - plugin_platform_interface: - dependency: transitive - description: - name: plugin_platform_interface - sha256: "43798d895c929056255600343db8f049921cbec94d31ec87f1dc5c16c01935dd" - url: "https://pub.dev" - source: hosted - version: "2.1.5" - quiver: - dependency: transitive - description: - name: quiver - sha256: b1c1ac5ce6688d77f65f3375a9abb9319b3cb32486bdc7a1e0fdf004d7ba4e47 - url: "https://pub.dev" - source: hosted - version: "3.2.1" rxdart: dependency: "direct main" description: @@ -396,13 +200,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.27.7" - sharezone_common: - dependency: "direct main" - description: - path: "../sharezone_common" - relative: true - source: path - version: "0.0.1" sharezone_lints: dependency: "direct dev" description: @@ -410,13 +207,6 @@ packages: relative: true source: path version: "1.0.0" - sharezone_utils: - dependency: transitive - description: - path: "../sharezone_utils" - relative: true - source: path - version: "0.0.1" shimmer: dependency: "direct main" description: @@ -478,14 +268,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.6.1" - typed_data: - dependency: transitive - description: - name: typed_data - sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c - url: "https://pub.dev" - source: hosted - version: "1.3.2" vector_graphics: dependency: transitive description: @@ -526,22 +308,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.3.0" - win32: - dependency: transitive - description: - name: win32 - sha256: "5a751eddf9db89b3e5f9d50c20ab8612296e4e8db69009788d6c8b060a84191c" - url: "https://pub.dev" - source: hosted - version: "4.1.4" - win32_registry: - dependency: transitive - description: - name: win32_registry - sha256: "1c52f994bdccb77103a6231ad4ea331a244dbcef5d1f37d8462f713143b0bfae" - url: "https://pub.dev" - source: hosted - version: "1.1.0" xml: dependency: transitive description: diff --git a/lib/sharezone_widgets/pubspec.yaml b/lib/sharezone_widgets/pubspec.yaml index 1566edd62..554673a67 100644 --- a/lib/sharezone_widgets/pubspec.yaml +++ b/lib/sharezone_widgets/pubspec.yaml @@ -15,8 +15,8 @@ environment: sdk: '>=3.1.0 <4.0.0' dependencies: - sharezone_common: - path: ../sharezone_common + helper_functions: + path: ../helper_functions build_context: path: ../build_context flutter_svg: ^2.0.2 diff --git a/lib/user/lib/src/models/subscription.dart b/lib/user/lib/src/models/subscription.dart index acb9bf0dc..0d18eb4dc 100644 --- a/lib/user/lib/src/models/subscription.dart +++ b/lib/user/lib/src/models/subscription.dart @@ -6,7 +6,8 @@ // // SPDX-License-Identifier: EUPL-1.2 -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; +import 'package:sharezone_common/firebase_helper.dart'; enum SubscriptionTier { teacherPlus, diff --git a/lib/user/lib/src/models/timetable/enabled_weekdays.dart b/lib/user/lib/src/models/timetable/enabled_weekdays.dart index 5e76b9abe..e735cbb2c 100644 --- a/lib/user/lib/src/models/timetable/enabled_weekdays.dart +++ b/lib/user/lib/src/models/timetable/enabled_weekdays.dart @@ -7,7 +7,7 @@ // SPDX-License-Identifier: EUPL-1.2 import 'package:date/weekday.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:sharezone_common/firebase_helper.dart'; const weekDayDefaults = { WeekDay.monday: true, diff --git a/lib/user/lib/src/models/timetable/period.dart b/lib/user/lib/src/models/timetable/period.dart index 5ea0cbd00..7c3249d04 100644 --- a/lib/user/lib/src/models/timetable/period.dart +++ b/lib/user/lib/src/models/timetable/period.dart @@ -7,7 +7,7 @@ // SPDX-License-Identifier: EUPL-1.2 import 'package:collection/collection.dart' show IterableNullableExtension; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:sharezone_common/firebase_helper.dart'; import 'package:time/time.dart'; const Periods standardPeriods = Periods({ @@ -138,8 +138,7 @@ class Periods { } Map toJson() { - return _data.map((key, value) => - MapEntry(key.toString(), value?.toJson() ?? emptyFirestoreValue())); + return _data.map((key, value) => MapEntry(key.toString(), value?.toJson())); } Period? getPeriod(int number) { diff --git a/lib/user/lib/src/models/tips/user_tip_data.dart b/lib/user/lib/src/models/tips/user_tip_data.dart index 11422d050..7f78b0424 100644 --- a/lib/user/lib/src/models/tips/user_tip_data.dart +++ b/lib/user/lib/src/models/tips/user_tip_data.dart @@ -6,7 +6,8 @@ // // SPDX-License-Identifier: EUPL-1.2 -import 'package:sharezone_common/helper_functions.dart'; +import 'package:sharezone_common/firebase_helper.dart'; + import 'user_tip_key.dart'; class UserTipData { diff --git a/lib/user/lib/src/models/user.dart b/lib/user/lib/src/models/user.dart index 922c75b20..e83f9917d 100644 --- a/lib/user/lib/src/models/user.dart +++ b/lib/user/lib/src/models/user.dart @@ -7,7 +7,8 @@ // SPDX-License-Identifier: EUPL-1.2 import 'package:characters/characters.dart'; -import 'package:sharezone_common/helper_functions.dart'; +import 'package:helper_functions/helper_functions.dart'; +import 'package:sharezone_common/firebase_helper.dart'; import 'package:user/src/models/subscription.dart'; import 'features.dart'; diff --git a/lib/user/pubspec.lock b/lib/user/pubspec.lock index dba3b7a29..270990db3 100644 --- a/lib/user/pubspec.lock +++ b/lib/user/pubspec.lock @@ -284,6 +284,13 @@ packages: description: flutter source: sdk version: "0.0.0" + helper_functions: + dependency: "direct main" + description: + path: "../helper_functions" + relative: true + source: path + version: "0.0.1" http_parser: dependency: transitive description: diff --git a/lib/user/pubspec.yaml b/lib/user/pubspec.yaml index c10b8c473..12db77198 100644 --- a/lib/user/pubspec.yaml +++ b/lib/user/pubspec.yaml @@ -25,6 +25,8 @@ dependencies: path: ../time characters: ^1.0.0 collection: ^1.15.0-nullsafety.4 + helper_functions: + path: ../helper_functions dev_dependencies: flutter_test: diff --git a/licenses_config.yaml b/licenses_config.yaml index 66e0a5f9a..58ba5d577 100644 --- a/licenses_config.yaml +++ b/licenses_config.yaml @@ -67,6 +67,7 @@ packageLicenseOverride: group_domain_models: EUPL-1.2-or-later hausaufgabenheft_logik: EUPL-1.2-or-later holidays: EUPL-1.2-or-later + helper_functions: EUPL-1.2-or-later key_value_store: EUPL-1.2-or-later last_online_reporting: EUPL-1.2-or-later notifications: EUPL-1.2-or-later