diff --git a/.fvm/fvm_config.json b/.fvm/fvm_config.json index 1357e1ef2..aa5a2afd6 100644 --- a/.fvm/fvm_config.json +++ b/.fvm/fvm_config.json @@ -1,4 +1,4 @@ { - "flutterSdkVersion": "2.5.2", + "flutterSdkVersion": "2.10.5", "flavors": {} } \ No newline at end of file diff --git a/app/android/app/build.gradle b/app/android/app/build.gradle index abf4c8c3c..051fd018f 100644 --- a/app/android/app/build.gradle +++ b/app/android/app/build.gradle @@ -31,7 +31,7 @@ if (flutterVersionName == null) { } android { - compileSdkVersion 29 + compileSdkVersion 31 lintOptions { disable 'InvalidPackage' diff --git a/app/android/build.gradle b/app/android/build.gradle index e90edc285..e78817fd1 100644 --- a/app/android/build.gradle +++ b/app/android/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = '1.6.10' + ext.kotlin_version = '1.6.21' repositories { google() diff --git a/app/ios/Podfile.lock b/app/ios/Podfile.lock index 395f8d496..5b698a6f6 100644 --- a/app/ios/Podfile.lock +++ b/app/ios/Podfile.lock @@ -567,7 +567,7 @@ SPEC CHECKSUMS: GTMAppAuth: ad5c2b70b9a8689e1a04033c9369c4915bfcbe89 GTMSessionFetcher: 43748f93435c2aa068b1cbe39655aaf600652e91 image_picker: 9aa50e1d8cdacdbed739e925b7eea16d014367e6 - integration_test: 7db6d89f336f671dcbc7563ee27a5b08f6f8aee1 + integration_test: a1e7d09bd98eca2fc37aefd79d4f41ad37bdbbe5 jitsi_meet_wrapper: f78c5a212de5dfbadcd81ce559217f3661a26ce7 JitsiMeetSDK: edcac8e2b92ee0c7f3e75bd0aefefbe9faccfc93 libwebp: 98a37e597e40bfdb4c911fc98f2c53d0b12d05fc diff --git a/app/ios/Runner.xcodeproj/project.pbxproj b/app/ios/Runner.xcodeproj/project.pbxproj index 3625af679..51c71d6a7 100644 --- a/app/ios/Runner.xcodeproj/project.pbxproj +++ b/app/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 50; objects = { /* Begin PBXBuildFile section */ @@ -186,7 +186,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1020; + LastUpgradeCheck = 1300; ORGANIZATIONNAME = ""; TargetAttributes = { 97C146ED1CF9000F007C117D = { diff --git a/app/lib/activation_code/activation_code_page.dart b/app/lib/activation_code/activation_code_page.dart index d99ac896f..8294e4200 100644 --- a/app/lib/activation_code/activation_code_page.dart +++ b/app/lib/activation_code/activation_code_page.dart @@ -8,7 +8,6 @@ import 'package:bloc_provider/bloc_provider.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; import 'package:sharezone/activation_code/src/bloc/enter_activation_code_bloc_factory.dart'; import 'package:sharezone/groups/src/widgets/contact_support.dart'; import 'package:sharezone_widgets/theme.dart'; @@ -36,17 +35,14 @@ class _EnterActivationCodePage extends StatelessWidget { @override Widget build(BuildContext context) { - return Theme( - data: Theme.of(context).copyWith(primaryColorBrightness: Brightness.dark), - child: Scaffold( - appBar: const _EnterActivationCodeAppBar(), - body: SafeArea( - child: SingleChildScrollView( - child: _EnterActivationCodeDescription(), - ), + return Scaffold( + appBar: const _EnterActivationCodeAppBar(), + body: SafeArea( + child: SingleChildScrollView( + child: _EnterActivationCodeDescription(), ), - bottomNavigationBar: ContactSupport(), ), + bottomNavigationBar: ContactSupport(), ); } } diff --git a/app/lib/auth/email_and_password_link_page.dart b/app/lib/auth/email_and_password_link_page.dart index 5d5d13f52..cebc18ebd 100644 --- a/app/lib/auth/email_and_password_link_page.dart +++ b/app/lib/auth/email_and_password_link_page.dart @@ -9,7 +9,6 @@ import 'package:authentification_base/authentification.dart'; import 'package:bloc_provider/bloc_provider.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; import 'package:sharezone/account/account_page_bloc.dart'; import 'package:sharezone/account/register_account_section.dart'; import 'package:sharezone/blocs/application_bloc.dart'; diff --git a/app/lib/auth/login_page.dart b/app/lib/auth/login_page.dart index e8184217b..591b157cb 100644 --- a/app/lib/auth/login_page.dart +++ b/app/lib/auth/login_page.dart @@ -12,7 +12,6 @@ import 'package:authentification_base/authentification_analytics.dart'; import 'package:bloc_provider/bloc_provider.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; import 'package:sharezone/download_app_tip/widgets/download_app_tip_card.dart'; import 'package:sharezone/groups/src/widgets/contact_support.dart'; import 'package:sharezone/onboarding/sign_up/sign_up_page.dart'; diff --git a/app/lib/dashboard/dashboard_page.dart b/app/lib/dashboard/dashboard_page.dart index 60d99c88e..169c8eb32 100644 --- a/app/lib/dashboard/dashboard_page.dart +++ b/app/lib/dashboard/dashboard_page.dart @@ -49,7 +49,6 @@ import 'package:sharezone/widgets/homework/homework_card.dart'; import 'package:sharezone/widgets/machting_type_of_user_stream_builder.dart'; import 'package:sharezone/widgets/material/modal_bottom_sheet_big_icon_button.dart'; import 'package:sharezone_common/helper_functions.dart'; -import 'package:sharezone_utils/dimensions.dart'; import 'package:sharezone_utils/platform.dart'; import 'package:sharezone_widgets/announcement_card.dart'; import 'package:sharezone_widgets/snackbars.dart'; @@ -87,26 +86,21 @@ class _DashboardPageState extends State { @override Widget build(BuildContext context) { - return Theme( - data: Dimensions.fromMediaQuery(context).isDesktopModus - ? Theme.of(context) - : Theme.of(context).copyWith(primaryColorBrightness: Brightness.dark), - child: SharezoneCustomScaffold( - appBarConfiguration: SliverAppBarConfiguration( - title: _AppBarTitle(), - backgroundColor: - isDarkThemeEnabled(context) ? ElevationColors.dp8 : blueColor, - expandedHeight: 210, - elevation: 1, - pinned: true, - actions: const [_ProfileAvatar()], - flexibleSpace: _AppBarBottom(), - drawerIconColor: Colors.white, - ), - navigationItem: NavigationItem.overview, - body: DashboardPageBody(), - floatingActionButton: _DashboardPageFAB(), + return SharezoneCustomScaffold( + appBarConfiguration: SliverAppBarConfiguration( + title: _AppBarTitle(), + backgroundColor: + isDarkThemeEnabled(context) ? ElevationColors.dp8 : blueColor, + expandedHeight: 210, + elevation: 1, + pinned: true, + actions: const [_ProfileAvatar()], + flexibleSpace: _AppBarBottom(), + drawerIconColor: Colors.white, ), + navigationItem: NavigationItem.overview, + body: DashboardPageBody(), + floatingActionButton: _DashboardPageFAB(), ); } } diff --git a/app/lib/dashboard/models/homework_view.dart b/app/lib/dashboard/models/homework_view.dart index db94e3f2c..91476879b 100644 --- a/app/lib/dashboard/models/homework_view.dart +++ b/app/lib/dashboard/models/homework_view.dart @@ -6,13 +6,10 @@ // // SPDX-License-Identifier: EUPL-1.2 -import 'dart:ui'; - import 'package:firebase_hausaufgabenheft_logik/firebase_hausaufgabenheft_logik.dart'; import 'package:flutter/material.dart'; import 'package:group_domain_models/group_domain_models.dart'; import 'package:intl/intl.dart'; -import 'package:meta/meta.dart'; import 'package:sharezone/util/api/courseGateway.dart'; class HomeworkView { diff --git a/app/lib/donate/bloc/donation_bloc.dart b/app/lib/donate/bloc/donation_bloc.dart index df2521617..a9428a5da 100644 --- a/app/lib/donate/bloc/donation_bloc.dart +++ b/app/lib/donate/bloc/donation_bloc.dart @@ -14,7 +14,6 @@ import 'package:meta/meta.dart'; import 'package:optional/optional.dart'; import 'package:purchases_flutter/errors.dart'; import 'package:sharezone/donate/analytics/donation_analytics.dart'; -import 'package:sharezone/donate/donation_service/donation_item.dart'; import 'package:sharezone/donate/donation_service/donation_service.dart'; import 'package:sharezone/donate/page/donation_item_view.dart'; import 'package:sharezone_utils/platform.dart'; diff --git a/app/lib/filesharing/file_page.dart b/app/lib/filesharing/file_page.dart index e5a45f918..d58d597b2 100644 --- a/app/lib/filesharing/file_page.dart +++ b/app/lib/filesharing/file_page.dart @@ -9,7 +9,6 @@ import 'package:files_basics/files_models.dart'; import 'package:files_basics/local_file.dart'; import 'package:files_usecases/file_viewer.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:sharezone/filesharing/bloc/file_page_bloc.dart'; import 'package:sharezone_widgets/widgets.dart'; @@ -124,7 +123,7 @@ class __LoadingPageState extends State<_LoadingPage> { @override Widget build(BuildContext context) { return Theme( - data: Theme.of(context).copyWith(primaryColorBrightness: Brightness.dark), + data: Theme.of(context).copyWith(brightness: Brightness.dark), child: Scaffold( appBar: FilePageAppBar(name: widget.name, nameStream: widget.nameStream), diff --git a/app/lib/filesharing/widgets/sheet.dart b/app/lib/filesharing/widgets/sheet.dart index cb90f642b..ac9baff03 100644 --- a/app/lib/filesharing/widgets/sheet.dart +++ b/app/lib/filesharing/widgets/sheet.dart @@ -6,8 +6,6 @@ // // SPDX-License-Identifier: EUPL-1.2 -import 'dart:ui'; - import 'package:bloc_provider/bloc_provider.dart'; import 'package:files_basics/files_models.dart'; import 'package:filesharing_logic/filesharing_logic_models.dart'; diff --git a/app/lib/groups/group_join/group_join_page.dart b/app/lib/groups/group_join/group_join_page.dart index 9aa40b9c0..006e0eb8a 100644 --- a/app/lib/groups/group_join/group_join_page.dart +++ b/app/lib/groups/group_join/group_join_page.dart @@ -9,7 +9,6 @@ import 'package:bloc_provider/bloc_provider.dart'; import 'package:crash_analytics/crash_analytics.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; import 'package:sharezone/blocs/application_bloc.dart'; import 'package:sharezone/groups/src/widgets/contact_support.dart'; import 'package:sharezone/pages/settings/support_page.dart'; @@ -42,13 +41,10 @@ class _GroupJoinPage extends StatelessWidget { @override Widget build(BuildContext context) { - return Theme( - data: Theme.of(context).copyWith(primaryColorBrightness: Brightness.dark), - child: Scaffold( - appBar: const GroupJoinAppBar(), - body: SafeArea(child: SingleChildScrollView(child: GroupJoinHelp())), - bottomNavigationBar: ContactSupport(), - ), + return Scaffold( + appBar: const GroupJoinAppBar(), + body: SafeArea(child: SingleChildScrollView(child: GroupJoinHelp())), + bottomNavigationBar: ContactSupport(), ); } } diff --git a/app/lib/groups/src/pages/course/create/course_create_page.dart b/app/lib/groups/src/pages/course/create/course_create_page.dart index 1cd67e8ad..aa89d58d2 100644 --- a/app/lib/groups/src/pages/course/create/course_create_page.dart +++ b/app/lib/groups/src/pages/course/create/course_create_page.dart @@ -7,7 +7,6 @@ // SPDX-License-Identifier: EUPL-1.2 import 'package:bloc_provider/bloc_provider.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:group_domain_models/group_domain_models.dart'; import 'package:sharezone/groups/src/pages/course/create/src/bloc/course_create_bloc.dart'; diff --git a/app/lib/groups/src/pages/course/group_help.dart b/app/lib/groups/src/pages/course/group_help.dart index 6cae1329a..f1308bf69 100644 --- a/app/lib/groups/src/pages/course/group_help.dart +++ b/app/lib/groups/src/pages/course/group_help.dart @@ -35,19 +35,14 @@ class CourseHelpInnerPage extends StatelessWidget { @override Widget build(BuildContext context) { return SafeArea( - child: Theme( - data: Theme.of(context).copyWith( - colorScheme: - ColorScheme.fromSwatch().copyWith(secondary: Colors.black)), - child: Column( - children: [ - _WhatIsAPublicKey(), - _HowToJoinAGroup(), - _WhyHasEveryMemberOfAGroupADifferentSharecode(), - _WhatIsTheDifferenceBetweenAGroupACourseAndASchoolClass(), - _GroupRolesExplained(), - ], - ), + child: Column( + children: [ + _WhatIsAPublicKey(), + _HowToJoinAGroup(), + _WhyHasEveryMemberOfAGroupADifferentSharecode(), + _WhatIsTheDifferenceBetweenAGroupACourseAndASchoolClass(), + _GroupRolesExplained(), + ], ), ); } diff --git a/app/lib/groups/src/pages/course/group_page.dart b/app/lib/groups/src/pages/course/group_page.dart index c729f5acf..34aea111e 100644 --- a/app/lib/groups/src/pages/course/group_page.dart +++ b/app/lib/groups/src/pages/course/group_page.dart @@ -7,10 +7,7 @@ // SPDX-License-Identifier: EUPL-1.2 import 'package:bloc_provider/bloc_provider.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/rendering.dart'; -import 'package:flutter/scheduler.dart'; import 'package:flutter_staggered_animations/flutter_staggered_animations.dart'; import 'package:group_domain_models/group_domain_models.dart'; import 'package:sharezone/blocs/application_bloc.dart'; diff --git a/app/lib/groups/src/pages/school_class/create_course/school_class_create_course.dart b/app/lib/groups/src/pages/school_class/create_course/school_class_create_course.dart index f08f16f53..39a3679a2 100644 --- a/app/lib/groups/src/pages/school_class/create_course/school_class_create_course.dart +++ b/app/lib/groups/src/pages/school_class/create_course/school_class_create_course.dart @@ -7,7 +7,6 @@ // SPDX-License-Identifier: EUPL-1.2 import 'package:bloc_provider/bloc_provider.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:group_domain_models/group_domain_models.dart'; import 'package:sharezone/blocs/application_bloc.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 95a2ee37e..c2ae9cf98 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 @@ -8,7 +8,6 @@ import 'package:app_functions/app_functions.dart'; import 'package:bloc_provider/bloc_provider.dart'; -import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:group_domain_models/group_domain_models.dart'; import 'package:sharezone/additional/course_permission.dart'; diff --git a/app/lib/groups/src/widgets/meeting/group_meeting_button.dart b/app/lib/groups/src/widgets/meeting/group_meeting_button.dart index 37f0fce70..4f7582c5b 100644 --- a/app/lib/groups/src/widgets/meeting/group_meeting_button.dart +++ b/app/lib/groups/src/widgets/meeting/group_meeting_button.dart @@ -9,7 +9,6 @@ import 'package:bloc_provider/bloc_provider.dart'; import 'package:common_domain_models/common_domain_models.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:group_domain_models/group_domain_models.dart'; import 'package:sharezone/crash_analytics/crash_analytics_bloc.dart'; diff --git a/app/lib/groups/src/widgets/sharecode_text.dart b/app/lib/groups/src/widgets/sharecode_text.dart index 324f20cbb..efd80144c 100644 --- a/app/lib/groups/src/widgets/sharecode_text.dart +++ b/app/lib/groups/src/widgets/sharecode_text.dart @@ -6,7 +6,6 @@ // // SPDX-License-Identifier: EUPL-1.2 -import 'package:characters/characters.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:sharezone_utils/platform.dart'; diff --git a/app/lib/homework/shared/homework_list_section.dart b/app/lib/homework/shared/homework_list_section.dart index 240b5d871..017530d52 100644 --- a/app/lib/homework/shared/homework_list_section.dart +++ b/app/lib/homework/shared/homework_list_section.dart @@ -28,7 +28,7 @@ class HomeworkListSection extends StatelessWidget { @override Widget build(BuildContext context) { - final curve = Curves.easeOutSine; + const curve = Curves.easeOutSine; return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ diff --git a/app/lib/homework/student/student_homework_page.dart b/app/lib/homework/student/student_homework_page.dart index 0de985e3c..39d4af4e2 100644 --- a/app/lib/homework/student/student_homework_page.dart +++ b/app/lib/homework/student/student_homework_page.dart @@ -10,9 +10,6 @@ import 'package:bloc_provider/bloc_provider.dart'; import 'package:flutter/material.dart'; import 'package:hausaufgabenheft_logik/hausaufgabenheft_logik.dart'; import 'package:provider/provider.dart'; -import 'package:sharezone/homework/shared/animated_tab_visibility.dart'; -import 'package:sharezone/homework/shared/bottom_of_scrollview_visibility.dart'; -import 'package:sharezone/homework/shared/homework_fab.dart'; import 'package:sharezone/homework/shared/shared.dart'; import 'package:sharezone/homework/student/src/homework_bottom_action_bar.dart'; import 'package:sharezone/navigation/logic/navigation_bloc.dart'; diff --git a/app/lib/homework/teacher/src/teacher_open_homework_list.dart b/app/lib/homework/teacher/src/teacher_open_homework_list.dart index a99027b0c..d870cdd27 100644 --- a/app/lib/homework/teacher/src/teacher_open_homework_list.dart +++ b/app/lib/homework/teacher/src/teacher_open_homework_list.dart @@ -8,7 +8,6 @@ import 'package:flutter/material.dart'; import 'package:hausaufgabenheft_logik/hausaufgabenheft_logik_lehrer.dart'; -import 'package:sharezone/homework/shared/glowing_overscroll_color_changer.dart'; import 'package:sharezone/homework/shared/shared.dart'; import 'teacher_homework_tile.dart'; diff --git a/app/lib/homework/teacher/teacher_homework_page.dart b/app/lib/homework/teacher/teacher_homework_page.dart index 47560a537..4f4a1f6ea 100644 --- a/app/lib/homework/teacher/teacher_homework_page.dart +++ b/app/lib/homework/teacher/teacher_homework_page.dart @@ -10,10 +10,6 @@ import 'package:bloc_provider/bloc_provider.dart'; import 'package:flutter/material.dart'; import 'package:hausaufgabenheft_logik/hausaufgabenheft_logik_lehrer.dart'; import 'package:provider/provider.dart'; -import 'package:sharezone/homework/shared/animated_tab_visibility.dart'; -import 'package:sharezone/homework/shared/bottom_of_scrollview_visibility.dart'; -import 'package:sharezone/homework/shared/homework_fab.dart'; -import 'package:sharezone/homework/shared/placeholder_templates.dart'; import 'package:sharezone/homework/shared/shared.dart'; import 'package:sharezone/navigation/logic/navigation_bloc.dart'; import 'package:sharezone/navigation/models/navigation_item.dart'; diff --git a/app/lib/main/auth_app.dart b/app/lib/main/auth_app.dart index 92bc7d3c9..a188a191c 100644 --- a/app/lib/main/auth_app.dart +++ b/app/lib/main/auth_app.dart @@ -9,7 +9,6 @@ import 'package:analytics/analytics.dart'; import 'package:bloc_provider/bloc_provider.dart'; import 'package:bloc_provider/multi_bloc_provider.dart'; -import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:sharezone/auth/login_page.dart'; import 'package:sharezone/auth/sign_in_with_qr_code_page.dart'; diff --git a/app/lib/main/run_app.dart b/app/lib/main/run_app.dart index 0938ec289..038c1deeb 100644 --- a/app/lib/main/run_app.dart +++ b/app/lib/main/run_app.dart @@ -13,10 +13,7 @@ import 'package:app_functions/app_functions.dart'; import 'package:authentification_base/authentification.dart'; import 'package:cloud_functions/cloud_functions.dart'; import 'package:firebase_core/firebase_core.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/rendering.dart'; import 'package:overlay_support/overlay_support.dart'; import 'package:rxdart/subjects.dart'; import 'package:sharezone/blocs/bloc_dependencies.dart'; diff --git a/app/lib/main/sharezone.dart b/app/lib/main/sharezone.dart index 975344901..2566d102e 100644 --- a/app/lib/main/sharezone.dart +++ b/app/lib/main/sharezone.dart @@ -11,7 +11,6 @@ import 'package:authentification_base/authentification.dart'; import 'package:authentification_base/authentification_base.dart'; import 'package:bloc_provider/bloc_provider.dart'; import 'package:flutter/material.dart'; -import 'package:meta/meta.dart'; import 'package:provider/provider.dart'; import 'package:sharezone/account/theme/theme_settings.dart'; import 'package:sharezone/blocs/bloc_dependencies.dart'; diff --git a/app/lib/navigation/drawer/drawer.dart b/app/lib/navigation/drawer/drawer.dart index a70a7ced8..ec04a9d2e 100644 --- a/app/lib/navigation/drawer/drawer.dart +++ b/app/lib/navigation/drawer/drawer.dart @@ -8,7 +8,6 @@ import 'package:authentification_base/authentification.dart'; import 'package:bloc_provider/bloc_provider.dart'; -import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:sharezone/blocs/application_bloc.dart'; import 'package:sharezone/navigation/analytics/navigation_analytics.dart'; diff --git a/app/lib/navigation/navigation_controller.dart b/app/lib/navigation/navigation_controller.dart index 4915265aa..8bef373a0 100644 --- a/app/lib/navigation/navigation_controller.dart +++ b/app/lib/navigation/navigation_controller.dart @@ -7,7 +7,6 @@ // SPDX-License-Identifier: EUPL-1.2 import 'package:bloc_provider/bloc_provider.dart'; -import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:sharezone/navigation/logic/navigation_bloc.dart'; import 'package:sharezone/notifications/firebase_messaging_callback_configurator.dart'; diff --git a/app/lib/navigation/scaffold/portable/bottom_navigation_bar/bottom_navigation_bar.dart b/app/lib/navigation/scaffold/portable/bottom_navigation_bar/bottom_navigation_bar.dart index 58855b85b..d656c3bc9 100644 --- a/app/lib/navigation/scaffold/portable/bottom_navigation_bar/bottom_navigation_bar.dart +++ b/app/lib/navigation/scaffold/portable/bottom_navigation_bar/bottom_navigation_bar.dart @@ -9,7 +9,6 @@ import 'package:auto_size_text/auto_size_text.dart'; import 'package:bloc_provider/bloc_provider.dart'; import 'package:build_context/build_context.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:sharezone/navigation/analytics/navigation_analytics.dart'; import 'package:sharezone/navigation/logic/navigation_bloc.dart'; diff --git a/app/lib/navigation/scaffold/portable/bottom_navigation_bar/extendable_bottom_navigation_bar.dart b/app/lib/navigation/scaffold/portable/bottom_navigation_bar/extendable_bottom_navigation_bar.dart index 07f8d2994..f56d0dcb9 100644 --- a/app/lib/navigation/scaffold/portable/bottom_navigation_bar/extendable_bottom_navigation_bar.dart +++ b/app/lib/navigation/scaffold/portable/bottom_navigation_bar/extendable_bottom_navigation_bar.dart @@ -11,7 +11,6 @@ import 'package:auto_size_text/auto_size_text.dart'; import 'package:bloc_provider/bloc_provider.dart'; import 'package:build_context/build_context.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/scheduler.dart'; import 'package:sharezone/navigation/analytics/navigation_analytics.dart'; import 'package:sharezone/navigation/logic/navigation_bloc.dart'; import 'package:sharezone/navigation/models/navigation_item.dart'; diff --git a/app/lib/notifications/action_requests/show_notification_dialog.dart b/app/lib/notifications/action_requests/show_notification_dialog.dart index b87c8ad2a..fe80454b5 100644 --- a/app/lib/notifications/action_requests/show_notification_dialog.dart +++ b/app/lib/notifications/action_requests/show_notification_dialog.dart @@ -9,7 +9,6 @@ import 'dart:async'; import 'package:flutter/material.dart'; -import 'package:meta/meta.dart'; import 'package:notifications/notifications.dart'; import 'package:sharezone_widgets/adaptive_dialog.dart'; import 'package:url_launcher_extended/url_launcher_extended.dart'; diff --git a/app/lib/pages/blackboard/blackboard_dialog.dart b/app/lib/pages/blackboard/blackboard_dialog.dart index 302be3445..4ccf8ce9b 100644 --- a/app/lib/pages/blackboard/blackboard_dialog.dart +++ b/app/lib/pages/blackboard/blackboard_dialog.dart @@ -63,16 +63,13 @@ class _BlackboardDialogState extends State { @override Widget build(BuildContext context) { - return Theme( - data: Theme.of(context).copyWith(primaryColorBrightness: Brightness.dark), - child: BlocProvider( + return BlocProvider( + bloc: bloc, + child: _BlackboardDialog( + oldBlackboardItem: widget.blackboardItem, + course: widget.course, + popTwice: widget.popTwice, bloc: bloc, - child: _BlackboardDialog( - oldBlackboardItem: widget.blackboardItem, - course: widget.course, - popTwice: widget.popTwice, - bloc: bloc, - ), ), ); } diff --git a/app/lib/pages/blackboard/details/blackboard_details.dart b/app/lib/pages/blackboard/details/blackboard_details.dart index e157d1dc6..79e8014fd 100644 --- a/app/lib/pages/blackboard/details/blackboard_details.dart +++ b/app/lib/pages/blackboard/details/blackboard_details.dart @@ -163,30 +163,27 @@ class _PageWithPicture extends StatelessWidget { @override Widget build(BuildContext context) { - return Theme( - data: Theme.of(context).copyWith(primaryColorBrightness: Brightness.dark), - child: CustomScrollView( - slivers: [ - SliverAppBar( - expandedHeight: _getAppBarHeight(context) - _kFabHalfSize, - leading: CloseIconButton(color: getAppBarIconColor(view.hasPhoto)), - elevation: 1, - pinned: true, - actions: _actions(view), - flexibleSpace: FlexibleSpaceBar( - background: Hero( - tag: view.id, - child: Image.asset( - view.pictureURL, - fit: BoxFit.cover, - height: _appBarHeight, - ), + return CustomScrollView( + slivers: [ + SliverAppBar( + expandedHeight: _getAppBarHeight(context) - _kFabHalfSize, + leading: CloseIconButton(color: getAppBarIconColor(view.hasPhoto)), + elevation: 1, + pinned: true, + actions: _actions(view), + flexibleSpace: FlexibleSpaceBar( + background: Hero( + tag: view.id, + child: Image.asset( + view.pictureURL, + fit: BoxFit.cover, + height: _appBarHeight, ), ), ), - SliverToBoxAdapter(child: _Body(view)), - ], - ), + ), + SliverToBoxAdapter(child: _Body(view)), + ], ); } } diff --git a/app/lib/pages/homework/homework_details/homework_details.dart b/app/lib/pages/homework/homework_details/homework_details.dart index 082003666..6ec5cb0d5 100644 --- a/app/lib/pages/homework/homework_details/homework_details.dart +++ b/app/lib/pages/homework/homework_details/homework_details.dart @@ -163,7 +163,7 @@ class HomeworkTitleAppBar extends StatelessWidget { @override Widget build(BuildContext context) { return Theme( - data: Theme.of(context).copyWith(primaryColorBrightness: Brightness.dark), + data: Theme.of(context).copyWith(brightness: Brightness.dark), child: SliverAppBar( leading: CloseIconButton(color: Colors.white), backgroundColor: isDarkThemeEnabled(context) diff --git a/app/lib/pages/homework/homework_dialog.dart b/app/lib/pages/homework/homework_dialog.dart index 24f144292..797bd27fe 100644 --- a/app/lib/pages/homework/homework_dialog.dart +++ b/app/lib/pages/homework/homework_dialog.dart @@ -59,14 +59,11 @@ class _HomeworkDialogState extends State { @override Widget build(BuildContext context) { - return Theme( - data: Theme.of(context).copyWith(primaryColorBrightness: Brightness.dark), - child: BlocProvider( + return BlocProvider( + bloc: bloc, + child: __HomeworkDialog( + homework: widget.homework, bloc: bloc, - child: __HomeworkDialog( - homework: widget.homework, - bloc: bloc, - ), ), ); } diff --git a/app/lib/timetable/src/edit_date.dart b/app/lib/timetable/src/edit_date.dart index 06af504eb..caae89f41 100644 --- a/app/lib/timetable/src/edit_date.dart +++ b/app/lib/timetable/src/edit_date.dart @@ -7,7 +7,6 @@ // SPDX-License-Identifier: EUPL-1.2 import 'package:date/date.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class EditDateField extends StatelessWidget { diff --git a/app/lib/timetable/src/edit_time.dart b/app/lib/timetable/src/edit_time.dart index a50f92040..89d2bbe07 100644 --- a/app/lib/timetable/src/edit_time.dart +++ b/app/lib/timetable/src/edit_time.dart @@ -38,38 +38,49 @@ class EditTimeField extends StatelessWidget { top: 6, bottom: 6, ), - child: ValueListenableBuilder( - valueListenable: isSelected, - builder: (context, value, _) { - return InkWell( - child: InputDecorator( - isEmpty: time == null, - isFocused: value, - decoration: InputDecoration( - labelText: label, - icon: const Icon(Icons.access_time), - border: const OutlineInputBorder(), - ), - child: Align( - alignment: Alignment.centerLeft, - child: SizedBox( - height: 18, - child: time == null - ? Container() - : Text(time.toTimeOfDay().format(context), - style: TextStyle(fontSize: 16.0)), + child: Theme( + data: Theme.of(context).copyWith( + colorScheme: ColorScheme.fromSeed( + primary: Theme.of(context).primaryColor, + seedColor: Theme.of(context).primaryColor, + brightness: isDarkThemeEnabled(context) + ? Brightness.dark + : Brightness.light, + ), + ), + child: ValueListenableBuilder( + valueListenable: isSelected, + builder: (context, value, _) { + return InkWell( + child: InputDecorator( + isEmpty: time == null, + isFocused: value, + decoration: InputDecoration( + labelText: label, + icon: const Icon(Icons.access_time), + border: const OutlineInputBorder(), + ), + child: Align( + alignment: Alignment.centerLeft, + child: SizedBox( + height: 18, + child: time == null + ? Container() + : Text(time.toTimeOfDay().format(context), + style: TextStyle(fontSize: 16.0)), + ), ), ), - ), - onTap: () { - isSelected.value = true; - selectTime(context, initialTime: time).then((newTime) { - if (newTime != null) onChanged(newTime); - isSelected.value = false; - }); - }, - ); - }, + onTap: () { + isSelected.value = true; + selectTime(context, initialTime: time).then((newTime) { + if (newTime != null) onChanged(newTime); + isSelected.value = false; + }); + }, + ); + }, + ), ), ); } diff --git a/app/lib/timetable/src/widgets/timetable_day_view.dart b/app/lib/timetable/src/widgets/timetable_day_view.dart index 80f8afa20..78b127e7f 100644 --- a/app/lib/timetable/src/widgets/timetable_day_view.dart +++ b/app/lib/timetable/src/widgets/timetable_day_view.dart @@ -11,7 +11,6 @@ import 'package:date/date.dart'; import 'package:date/weektype.dart'; import 'package:flutter/material.dart'; import 'package:group_domain_models/group_domain_models.dart'; -import 'package:meta/meta.dart'; import 'package:sharezone/additional/course_permission.dart'; import 'package:sharezone/blocs/application_bloc.dart'; import 'package:sharezone/calendrical_events/models/calendrical_event.dart'; diff --git a/app/lib/timetable/src/widgets/timetable_time_view.dart b/app/lib/timetable/src/widgets/timetable_time_view.dart index 98c276d3c..664ae3ce2 100644 --- a/app/lib/timetable/src/widgets/timetable_time_view.dart +++ b/app/lib/timetable/src/widgets/timetable_time_view.dart @@ -7,7 +7,6 @@ // SPDX-License-Identifier: EUPL-1.2 import 'package:flutter/material.dart'; -import 'package:meta/meta.dart'; import 'package:sharezone/settings/periods_edit_page.dart'; import 'package:sharezone/timetable/src/logic/timetable_period_dimensions.dart'; import 'package:sharezone_widgets/theme.dart'; diff --git a/app/lib/timetable/timetable_add/timetable_add_page.dart b/app/lib/timetable/timetable_add/timetable_add_page.dart index 997c325a3..29a85d4e5 100644 --- a/app/lib/timetable/timetable_add/timetable_add_page.dart +++ b/app/lib/timetable/timetable_add/timetable_add_page.dart @@ -9,7 +9,6 @@ import 'package:bloc_provider/bloc_provider.dart'; import 'package:date/weekday.dart'; import 'package:date/weektype.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:group_domain_models/group_domain_models.dart'; diff --git a/app/lib/timetable/timetable_add_event/timetable_add_event_page.dart b/app/lib/timetable/timetable_add_event/timetable_add_event_page.dart index 7d34ebf82..92cd0d0b6 100644 --- a/app/lib/timetable/timetable_add_event/timetable_add_event_page.dart +++ b/app/lib/timetable/timetable_add_event/timetable_add_event_page.dart @@ -8,7 +8,6 @@ import 'package:bloc_provider/bloc_provider.dart'; import 'package:date/date.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:group_domain_models/group_domain_models.dart'; import 'package:sharezone/additional/course_permission.dart'; diff --git a/app/lib/timetable/timetable_edit/event/timetable_event_edit_page.dart b/app/lib/timetable/timetable_edit/event/timetable_event_edit_page.dart index f43d1b6bb..d94047133 100644 --- a/app/lib/timetable/timetable_edit/event/timetable_event_edit_page.dart +++ b/app/lib/timetable/timetable_edit/event/timetable_event_edit_page.dart @@ -8,7 +8,6 @@ import 'package:bloc_provider/bloc_provider.dart'; import 'package:date/date.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:group_domain_models/group_domain_models.dart'; import 'package:sharezone/blocs/application_bloc.dart'; diff --git a/app/lib/timetable/timetable_edit/lesson/timetable_lesson_edit_page.dart b/app/lib/timetable/timetable_edit/lesson/timetable_lesson_edit_page.dart index b9965650c..2cc135656 100644 --- a/app/lib/timetable/timetable_edit/lesson/timetable_lesson_edit_page.dart +++ b/app/lib/timetable/timetable_edit/lesson/timetable_lesson_edit_page.dart @@ -9,7 +9,6 @@ import 'package:bloc_provider/bloc_provider.dart'; import 'package:date/weekday.dart'; import 'package:date/weektype.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:group_domain_models/group_domain_models.dart'; import 'package:sharezone/blocs/application_bloc.dart'; diff --git a/app/lib/util/api/user_api.dart b/app/lib/util/api/user_api.dart index 6b3555d55..c5c96c0f1 100644 --- a/app/lib/util/api/user_api.dart +++ b/app/lib/util/api/user_api.dart @@ -14,7 +14,6 @@ import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:firebase_auth/firebase_auth.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/material.dart'; -import 'package:meta/meta.dart'; import 'package:rxdart/subjects.dart'; import 'package:sharezone/util/API.dart'; import 'package:sharezone_common/api_errors.dart'; diff --git a/app/lib/widgets/apple_sign_in_button.dart b/app/lib/widgets/apple_sign_in_button.dart index e973a3af4..6d84d2078 100644 --- a/app/lib/widgets/apple_sign_in_button.dart +++ b/app/lib/widgets/apple_sign_in_button.dart @@ -8,7 +8,6 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/widgets.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; /// Style according to @@ -76,7 +75,8 @@ class SignInWithAppleButton extends StatelessWidget { ), ), Padding( - padding: EdgeInsets.only(left: iconAlignment == IconAlignment.left ? 16 : 0), + padding: EdgeInsets.only( + left: iconAlignment == IconAlignment.left ? 16 : 0), child: Text( text, style: TextStyle( diff --git a/app/lib/widgets/blackboard/blackboard_view.dart b/app/lib/widgets/blackboard/blackboard_view.dart index 58f6a6dba..a8482dabe 100644 --- a/app/lib/widgets/blackboard/blackboard_view.dart +++ b/app/lib/widgets/blackboard/blackboard_view.dart @@ -6,9 +6,6 @@ // // SPDX-License-Identifier: EUPL-1.2 -import 'dart:ui'; - -import 'package:characters/characters.dart'; import 'package:flutter/material.dart'; import 'package:group_domain_models/group_domain_models.dart'; import 'package:intl/intl.dart'; diff --git a/app/lib/widgets/homework/delete_homework.dart b/app/lib/widgets/homework/delete_homework.dart index e94f58905..7216f60fa 100644 --- a/app/lib/widgets/homework/delete_homework.dart +++ b/app/lib/widgets/homework/delete_homework.dart @@ -8,7 +8,6 @@ import 'package:bloc_provider/bloc_provider.dart'; import 'package:firebase_hausaufgabenheft_logik/firebase_hausaufgabenheft_logik.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:sharezone/blocs/application_bloc.dart'; import 'package:sharezone/filesharing/file_sharing_api.dart'; diff --git a/app/lib/widgets/homework/homework_card.dart b/app/lib/widgets/homework/homework_card.dart index fcc5ae389..b74d6fda3 100644 --- a/app/lib/widgets/homework/homework_card.dart +++ b/app/lib/widgets/homework/homework_card.dart @@ -10,7 +10,6 @@ import 'package:analytics/analytics.dart'; import 'package:bloc_provider/bloc_provider.dart'; import 'package:common_domain_models/common_domain_models.dart'; import 'package:firebase_hausaufgabenheft_logik/firebase_hausaufgabenheft_logik.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:group_domain_models/group_domain_models.dart'; import 'package:intl/intl.dart'; diff --git a/app/pubspec.lock b/app/pubspec.lock index fcc73308a..4b1aa3cfc 100644 --- a/app/pubspec.lock +++ b/app/pubspec.lock @@ -91,7 +91,7 @@ packages: name: archive url: "https://pub.dartlang.org" source: hosted - version: "3.1.2" + version: "3.1.6" args: dependency: transitive description: @@ -112,7 +112,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.8.1" + version: "2.8.2" authentification_base: dependency: "direct main" description: @@ -245,7 +245,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" charcode: dependency: transitive description: @@ -1094,7 +1094,14 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" meta: dependency: "direct main" description: @@ -1353,7 +1360,7 @@ packages: name: platform url: "https://pub.dartlang.org" source: hosted - version: "3.0.0" + version: "3.1.0" plugin_platform_interface: dependency: transitive description: @@ -1381,7 +1388,7 @@ packages: name: process url: "https://pub.dartlang.org" source: hosted - version: "4.2.3" + version: "4.2.4" provider: dependency: "direct main" description: @@ -1700,10 +1707,10 @@ packages: streaming_shared_preferences: dependency: "direct main" description: - path: "../lib/streaming_shared_preferences" - relative: true - source: path - version: "1.0.1" + name: streaming_shared_preferences + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" string_scanner: dependency: transitive description: @@ -1745,21 +1752,21 @@ packages: name: test url: "https://pub.dartlang.org" source: hosted - version: "1.17.10" + version: "1.19.5" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.2" + version: "0.4.8" test_core: dependency: transitive description: name: test_core url: "https://pub.dartlang.org" source: hosted - version: "0.4.0" + version: "0.4.9" time: dependency: "direct main" description: @@ -1878,7 +1885,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" video_player: dependency: "direct main" description: @@ -1908,7 +1915,7 @@ packages: name: vm_service url: "https://pub.dartlang.org" source: hosted - version: "7.1.1" + version: "7.5.0" wakelock: dependency: transitive description: diff --git a/app/pubspec.yaml b/app/pubspec.yaml index a4be671bf..5f06a90d7 100644 --- a/app/pubspec.yaml +++ b/app/pubspec.yaml @@ -126,8 +126,7 @@ dependencies: git: url: https://github.com/AndroidNils/sliding_up_panel ref: animation-listener - streaming_shared_preferences: - path: ../lib/streaming_shared_preferences + streaming_shared_preferences: ^2.0.0 string_similarity: ^2.0.0 time: path: ../lib/time diff --git a/app/test/account/account_page_test.dart b/app/test/account/account_page_test.dart index 2c033f830..0bf451eb1 100644 --- a/app/test/account/account_page_test.dart +++ b/app/test/account/account_page_test.dart @@ -8,12 +8,10 @@ import 'package:app_functions/src/app_functions_result.dart'; import 'package:authentification_base/authentification.dart'; -import 'package:authentification_base/src/models/auth_user.dart'; import 'package:bloc_provider/bloc_provider.dart'; import 'package:bloc_provider/multi_bloc_provider.dart'; import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:firebase_auth/firebase_auth.dart'; -import 'package:firebase_auth_platform_interface/firebase_auth_platform_interface.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; diff --git a/app/test/groups/share_buttons/link_sharing_button_test.dart b/app/test/groups/share_buttons/link_sharing_button_test.dart index c5d54d232..221d0939f 100644 --- a/app/test/groups/share_buttons/link_sharing_button_test.dart +++ b/app/test/groups/share_buttons/link_sharing_button_test.dart @@ -8,7 +8,6 @@ import 'package:design/design.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/src/widgets/basic.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:group_domain_models/group_domain_models.dart'; import 'package:sharezone/groups/src/widgets/group_share.dart'; diff --git a/app/test/homework/teacher/teacher_homework_page_widget_test.dart b/app/test/homework/teacher/teacher_homework_page_widget_test.dart index f96335d8f..4e94a43c1 100644 --- a/app/test/homework/teacher/teacher_homework_page_widget_test.dart +++ b/app/test/homework/teacher/teacher_homework_page_widget_test.dart @@ -11,7 +11,6 @@ import 'dart:collection'; import 'package:analytics/analytics.dart'; import 'package:analytics/null_analytics_backend.dart'; -import 'package:analytics/src/analytics/analytics.dart'; import 'package:bloc_provider/bloc_provider.dart'; import 'package:bloc_provider/multi_bloc_provider.dart'; import 'package:common_domain_models/common_domain_models.dart'; @@ -22,7 +21,6 @@ import 'package:hausaufgabenheft_logik/color.dart'; import 'package:hausaufgabenheft_logik/hausaufgabenheft_logik_lehrer.dart'; import 'package:provider/provider.dart'; import 'package:random_string/random_string.dart'; -import 'package:sharezone/homework/shared/animated_tab_visibility.dart'; import 'package:sharezone/homework/shared/shared.dart'; import 'package:sharezone/homework/teacher/src/teacher_archived_homework_list.dart'; import 'package:sharezone/homework/teacher/src/teacher_homework_bottom_action_bar.dart'; diff --git a/app/test/timetable/timetable_bloc_test.dart b/app/test/timetable/timetable_bloc_test.dart index 7ab310e2f..3fd253f8a 100644 --- a/app/test/timetable/timetable_bloc_test.dart +++ b/app/test/timetable/timetable_bloc_test.dart @@ -14,7 +14,6 @@ import 'package:date/weekday.dart'; import 'package:date/weektype.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:group_domain_models/group_domain_models.dart'; -import 'package:group_domain_models/src/models/school_class.dart'; import 'package:sharezone/calendrical_events/models/calendrical_event.dart'; import 'package:sharezone/calendrical_events/models/calendrical_event_types.dart'; import 'package:sharezone/timetable/src/bloc/timetable_bloc.dart'; diff --git a/lib/abgabe/abgabe_client_lib/pubspec.lock b/lib/abgabe/abgabe_client_lib/pubspec.lock index 54103a70f..05009c54a 100644 --- a/lib/abgabe/abgabe_client_lib/pubspec.lock +++ b/lib/abgabe/abgabe_client_lib/pubspec.lock @@ -63,7 +63,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.8.1" + version: "2.8.2" bloc: dependency: transitive description: @@ -119,7 +119,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" charcode: dependency: transitive description: @@ -624,7 +624,14 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" meta: dependency: "direct main" description: @@ -1007,21 +1014,21 @@ packages: name: test url: "https://pub.dartlang.org" source: hosted - version: "1.17.10" + version: "1.19.5" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.2" + version: "0.4.8" test_core: dependency: transitive description: name: test_core url: "https://pub.dartlang.org" source: hosted - version: "0.4.0" + version: "0.4.9" time: dependency: transitive description: @@ -1098,7 +1105,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" video_player: dependency: transitive description: diff --git a/lib/analytics/pubspec.lock b/lib/analytics/pubspec.lock index 8832086a1..20d09e360 100644 --- a/lib/analytics/pubspec.lock +++ b/lib/analytics/pubspec.lock @@ -14,7 +14,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.8.1" + version: "2.8.2" boolean_selector: dependency: transitive description: @@ -28,7 +28,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" charcode: dependency: transitive description: @@ -239,7 +239,14 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" meta: dependency: transitive description: @@ -342,7 +349,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.2" + version: "0.4.8" typed_data: dependency: transitive description: @@ -356,7 +363,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" sdks: - dart: ">=2.12.0 <3.0.0" + dart: ">=2.14.0 <3.0.0" flutter: ">=1.12.13+hotfix.5" diff --git a/lib/app_functions/pubspec.lock b/lib/app_functions/pubspec.lock index 98e59d8f9..28380a37b 100644 --- a/lib/app_functions/pubspec.lock +++ b/lib/app_functions/pubspec.lock @@ -7,7 +7,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.8.1" + version: "2.8.2" boolean_selector: dependency: transitive description: @@ -21,7 +21,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" charcode: dependency: transitive description: @@ -127,7 +127,14 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" meta: dependency: transitive description: @@ -202,7 +209,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.2" + version: "0.4.8" typed_data: dependency: transitive description: @@ -216,7 +223,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" sdks: - dart: ">=2.12.0 <3.0.0" + dart: ">=2.14.0 <3.0.0" flutter: ">=1.12.13+hotfix.5" diff --git a/lib/authentification/authentification_base/pubspec.lock b/lib/authentification/authentification_base/pubspec.lock index 474796c9a..dbacad1ad 100644 --- a/lib/authentification/authentification_base/pubspec.lock +++ b/lib/authentification/authentification_base/pubspec.lock @@ -21,7 +21,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.8.1" + version: "2.8.2" bloc_base: dependency: "direct main" description: @@ -42,7 +42,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" charcode: dependency: transitive description: @@ -63,42 +63,42 @@ packages: name: cloud_firestore url: "https://pub.dartlang.org" source: hosted - version: "2.4.0" + version: "3.1.13" cloud_firestore_platform_interface: dependency: transitive description: name: cloud_firestore_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "5.3.0" + version: "5.5.4" cloud_firestore_web: dependency: transitive description: name: cloud_firestore_web url: "https://pub.dartlang.org" source: hosted - version: "2.3.0" + version: "2.6.13" cloud_functions: dependency: transitive description: name: cloud_functions url: "https://pub.dartlang.org" source: hosted - version: "3.0.0" + version: "3.2.13" cloud_functions_platform_interface: dependency: transitive description: name: cloud_functions_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "5.0.8" + version: "5.1.4" cloud_functions_web: dependency: transitive description: name: cloud_functions_web url: "https://pub.dartlang.org" source: hosted - version: "4.0.10" + version: "4.2.12" collection: dependency: transitive description: @@ -133,7 +133,7 @@ packages: name: device_info url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.0.3" device_info_platform_interface: dependency: transitive description: @@ -168,7 +168,7 @@ packages: name: firebase url: "https://pub.dartlang.org" source: hosted - version: "9.0.1" + version: "9.0.2" firebase_analytics: dependency: transitive description: @@ -196,77 +196,77 @@ packages: name: firebase_auth url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "3.3.15" firebase_auth_oauth: dependency: "direct main" description: name: firebase_auth_oauth url: "https://pub.dartlang.org" source: hosted - version: "1.0.2" + version: "1.2.0" firebase_auth_oauth_platform_interface: dependency: transitive description: name: firebase_auth_oauth_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "1.0.2" firebase_auth_oauth_web: dependency: transitive description: name: firebase_auth_oauth_web url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "1.1.0" firebase_auth_platform_interface: dependency: transitive description: name: firebase_auth_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "5.0.0" + version: "6.2.4" firebase_auth_web: dependency: transitive description: name: firebase_auth_web url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "3.3.13" firebase_core: dependency: transitive description: name: firebase_core url: "https://pub.dartlang.org" source: hosted - version: "1.9.0" + version: "1.15.0" firebase_core_platform_interface: dependency: transitive description: name: firebase_core_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "4.0.1" + version: "4.2.5" firebase_core_web: dependency: transitive description: name: firebase_core_web url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.6.2" firebase_crashlytics: dependency: transitive description: name: firebase_crashlytics url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.6.3" firebase_crashlytics_platform_interface: dependency: transitive description: name: firebase_crashlytics_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "3.1.0" + version: "3.2.4" flutter: dependency: "direct main" description: flutter @@ -288,7 +288,14 @@ packages: name: google_sign_in url: "https://pub.dartlang.org" source: hosted - version: "5.0.5" + version: "5.3.0" + google_sign_in_android: + dependency: transitive + description: + name: google_sign_in_android + url: "https://pub.dartlang.org" + source: hosted + version: "5.2.5" google_sign_in_dartio: dependency: "direct main" description: @@ -298,20 +305,27 @@ packages: url: "https://github.com/GroovinChip/firebase_dart_sdk.git" source: git version: "0.0.9" + google_sign_in_ios: + dependency: transitive + description: + name: google_sign_in_ios + url: "https://pub.dartlang.org" + source: hosted + version: "5.2.5" google_sign_in_platform_interface: dependency: transitive description: name: google_sign_in_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.1.2" google_sign_in_web: dependency: transitive description: name: google_sign_in_web url: "https://pub.dartlang.org" source: hosted - version: "0.10.0" + version: "0.10.1" html_unescape: dependency: transitive description: @@ -325,7 +339,7 @@ packages: name: http url: "https://pub.dartlang.org" source: hosted - version: "0.13.3" + version: "0.13.4" http_parser: dependency: transitive description: @@ -353,7 +367,14 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" meta: dependency: "direct main" description: @@ -374,84 +395,91 @@ packages: name: path_provider_linux url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.1.5" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.0.3" path_provider_windows: dependency: transitive description: name: path_provider_windows url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" - pedantic: - dependency: transitive - description: - name: pedantic - url: "https://pub.dartlang.org" - source: hosted - version: "1.11.1" + version: "2.0.5" platform: dependency: transitive description: name: platform url: "https://pub.dartlang.org" source: hosted - version: "3.0.0" + version: "3.1.0" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.1.2" process: dependency: transitive description: name: process url: "https://pub.dartlang.org" source: hosted - version: "4.2.1" + version: "4.2.4" quiver: dependency: transitive description: name: quiver url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "3.0.1+1" rxdart: dependency: "direct main" description: name: rxdart url: "https://pub.dartlang.org" source: hosted - version: "0.27.1" + version: "0.27.3" shared_preferences: dependency: transitive description: name: shared_preferences url: "https://pub.dartlang.org" source: hosted - version: "2.0.6" + version: "2.0.13" + shared_preferences_android: + dependency: transitive + description: + name: shared_preferences_android + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.11" + shared_preferences_ios: + dependency: transitive + description: + name: shared_preferences_ios + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" shared_preferences_linux: dependency: transitive description: name: shared_preferences_linux url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.1.0" shared_preferences_macos: dependency: transitive description: name: shared_preferences_macos url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.0.3" shared_preferences_platform_interface: dependency: transitive description: @@ -465,14 +493,14 @@ packages: name: shared_preferences_web url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.0.3" shared_preferences_windows: dependency: transitive description: name: shared_preferences_windows url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.1.0" sharezone_common: dependency: "direct main" description: @@ -537,10 +565,10 @@ packages: streaming_shared_preferences: dependency: "direct main" description: - path: "../../streaming_shared_preferences" - relative: true - source: path - version: "1.0.1" + name: streaming_shared_preferences + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" string_scanner: dependency: transitive description: @@ -561,7 +589,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.2" + version: "0.4.8" time: dependency: transitive description: @@ -582,42 +610,56 @@ packages: name: url_launcher url: "https://pub.dartlang.org" source: hosted - version: "6.0.9" + version: "6.1.0" + url_launcher_android: + dependency: transitive + description: + name: url_launcher_android + url: "https://pub.dartlang.org" + source: hosted + version: "6.0.15" + url_launcher_ios: + dependency: transitive + description: + name: url_launcher_ios + url: "https://pub.dartlang.org" + source: hosted + version: "6.0.15" url_launcher_linux: dependency: transitive description: name: url_launcher_linux url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "3.0.0" url_launcher_macos: dependency: transitive description: name: url_launcher_macos url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.0.3" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.4" + version: "2.0.5" url_launcher_web: dependency: transitive description: name: url_launcher_web url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.0.9" url_launcher_windows: dependency: transitive description: name: url_launcher_windows url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "3.0.0" user: dependency: "direct main" description: @@ -631,21 +673,21 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" win32: dependency: transitive description: name: win32 url: "https://pub.dartlang.org" source: hosted - version: "2.2.5" + version: "2.5.1" xdg_directories: dependency: transitive description: name: xdg_directories url: "https://pub.dartlang.org" source: hosted - version: "0.2.0" + version: "0.2.0+1" sdks: - dart: ">=2.13.0 <3.0.0" - flutter: ">=2.0.0" + dart: ">=2.16.0 <3.0.0" + flutter: ">=2.10.0" diff --git a/lib/authentification/authentification_base/pubspec.yaml b/lib/authentification/authentification_base/pubspec.yaml index fa37acbf8..83fc7d676 100644 --- a/lib/authentification/authentification_base/pubspec.yaml +++ b/lib/authentification/authentification_base/pubspec.yaml @@ -25,8 +25,7 @@ dependencies: path: ../../sharezone_common sharezone_utils: path: ../../sharezone_utils - streaming_shared_preferences: - path: ../../streaming_shared_preferences + streaming_shared_preferences: ^2.0.0 user: path: ../../user google_sign_in_dartio: diff --git a/lib/authentification/authentification_qrcode/lib/src/blocs/qr_sign_in_web_bloc.dart b/lib/authentification/authentification_qrcode/lib/src/blocs/qr_sign_in_web_bloc.dart index c8b1996bd..c4dc3da16 100644 --- a/lib/authentification/authentification_qrcode/lib/src/blocs/qr_sign_in_web_bloc.dart +++ b/lib/authentification/authentification_qrcode/lib/src/blocs/qr_sign_in_web_bloc.dart @@ -17,7 +17,6 @@ import 'package:bloc_base/bloc_base.dart'; import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:crash_analytics/crash_analytics.dart'; import 'package:flutter/foundation.dart'; -import 'package:meta/meta.dart'; import 'package:rxdart/subjects.dart'; import 'package:sharezone_utils/platform.dart'; import 'package:util/encryption.dart'; diff --git a/lib/authentification/authentification_qrcode/pubspec.lock b/lib/authentification/authentification_qrcode/pubspec.lock index 0f989e6c2..fb638e7d3 100644 --- a/lib/authentification/authentification_qrcode/pubspec.lock +++ b/lib/authentification/authentification_qrcode/pubspec.lock @@ -35,7 +35,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.8.1" + version: "2.8.2" authentification_base: dependency: "direct main" description: @@ -63,7 +63,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" charcode: dependency: transitive description: @@ -402,7 +402,14 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" meta: dependency: transitive description: @@ -600,10 +607,10 @@ packages: streaming_shared_preferences: dependency: transitive description: - path: "../../streaming_shared_preferences" - relative: true - source: path - version: "1.0.1" + name: streaming_shared_preferences + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" string_scanner: dependency: transitive description: @@ -624,7 +631,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.2" + version: "0.4.8" time: dependency: transitive description: @@ -701,7 +708,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" win32: dependency: transitive description: @@ -717,5 +724,5 @@ packages: source: hosted version: "0.2.0" sdks: - dart: ">=2.13.0 <3.0.0" + dart: ">=2.14.0 <3.0.0" flutter: ">=2.0.0" diff --git a/lib/bloc_provider/pubspec.lock b/lib/bloc_provider/pubspec.lock index d7af05629..020ac0837 100644 --- a/lib/bloc_provider/pubspec.lock +++ b/lib/bloc_provider/pubspec.lock @@ -7,7 +7,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.8.1" + version: "2.8.2" bloc_base: dependency: "direct main" description: @@ -28,7 +28,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" charcode: dependency: transitive description: @@ -73,7 +73,14 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" meta: dependency: transitive description: @@ -134,7 +141,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.2" + version: "0.4.8" typed_data: dependency: transitive description: @@ -148,6 +155,6 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" sdks: - dart: ">=2.12.0 <3.0.0" + dart: ">=2.14.0 <3.0.0" diff --git a/lib/build_context/pubspec.lock b/lib/build_context/pubspec.lock index 8077d2382..3317f5f87 100644 --- a/lib/build_context/pubspec.lock +++ b/lib/build_context/pubspec.lock @@ -7,7 +7,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.8.1" + version: "2.8.2" boolean_selector: dependency: transitive description: @@ -21,7 +21,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" charcode: dependency: transitive description: @@ -66,7 +66,14 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" meta: dependency: transitive description: @@ -127,7 +134,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.2" + version: "0.4.8" typed_data: dependency: transitive description: @@ -141,6 +148,6 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" sdks: - dart: ">=2.12.0 <3.0.0" + dart: ">=2.14.0 <3.0.0" diff --git a/lib/common_domain_models/lib/src/ids/abgaben_id.dart b/lib/common_domain_models/lib/src/ids/abgaben_id.dart index f3b868642..c39b29c39 100644 --- a/lib/common_domain_models/lib/src/ids/abgaben_id.dart +++ b/lib/common_domain_models/lib/src/ids/abgaben_id.dart @@ -8,8 +8,6 @@ import 'package:common_domain_models/common_domain_models.dart'; -import 'src/id.dart'; - final _seperator = '.'; class AbgabeId extends Id { diff --git a/lib/crash_analytics/pubspec.lock b/lib/crash_analytics/pubspec.lock index a6cc54fa4..6129484da 100644 --- a/lib/crash_analytics/pubspec.lock +++ b/lib/crash_analytics/pubspec.lock @@ -7,7 +7,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.8.1" + version: "2.8.2" boolean_selector: dependency: transitive description: @@ -21,7 +21,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" charcode: dependency: transitive description: @@ -113,7 +113,14 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" meta: dependency: transitive description: @@ -181,7 +188,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.2" + version: "0.4.8" typed_data: dependency: transitive description: @@ -195,7 +202,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" sdks: - dart: ">=2.12.0 <3.0.0" + dart: ">=2.14.0 <3.0.0" flutter: ">=1.12.13+hotfix.5" diff --git a/lib/date/pubspec.lock b/lib/date/pubspec.lock index b18bc559f..4316bc364 100644 --- a/lib/date/pubspec.lock +++ b/lib/date/pubspec.lock @@ -35,7 +35,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.8.1" + version: "2.8.2" boolean_selector: dependency: transitive description: @@ -49,7 +49,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" charcode: dependency: transitive description: @@ -295,7 +295,14 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" meta: dependency: transitive description: @@ -475,21 +482,21 @@ packages: name: test url: "https://pub.dartlang.org" source: hosted - version: "1.17.10" + version: "1.19.5" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.2" + version: "0.4.8" test_core: dependency: transitive description: name: test_core url: "https://pub.dartlang.org" source: hosted - version: "0.4.0" + version: "0.4.9" typed_data: dependency: transitive description: @@ -503,7 +510,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" vm_service: dependency: transitive description: diff --git a/lib/design/pubspec.lock b/lib/design/pubspec.lock index fbdcb713e..5478c2987 100644 --- a/lib/design/pubspec.lock +++ b/lib/design/pubspec.lock @@ -14,7 +14,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.8.1" + version: "2.8.2" boolean_selector: dependency: transitive description: @@ -28,7 +28,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" charcode: dependency: transitive description: @@ -204,7 +204,14 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" meta: dependency: transitive description: @@ -300,7 +307,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.2" + version: "0.4.8" typed_data: dependency: transitive description: @@ -314,7 +321,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" sdks: - dart: ">=2.12.0 <3.0.0" + dart: ">=2.14.0 <3.0.0" flutter: ">=1.12.13+hotfix.5" diff --git a/lib/dynamic_links/pubspec.lock b/lib/dynamic_links/pubspec.lock index 4e27252a3..2115c9c00 100644 --- a/lib/dynamic_links/pubspec.lock +++ b/lib/dynamic_links/pubspec.lock @@ -7,7 +7,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.8.1" + version: "2.8.2" boolean_selector: dependency: transitive description: @@ -21,7 +21,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" charcode: dependency: transitive description: @@ -87,7 +87,14 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" meta: dependency: transitive description: @@ -169,7 +176,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.2" + version: "0.4.8" typed_data: dependency: transitive description: @@ -183,7 +190,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" sdks: - dart: ">=2.12.0 <3.0.0" + dart: ">=2.14.0 <3.0.0" flutter: ">=1.12.13+hotfix.5" diff --git a/lib/filesharing/files_basics/lib/src/models/kilo_byte_size.dart b/lib/filesharing/files_basics/lib/src/models/kilo_byte_size.dart index 33f1672e4..1130d9e01 100644 --- a/lib/filesharing/files_basics/lib/src/models/kilo_byte_size.dart +++ b/lib/filesharing/files_basics/lib/src/models/kilo_byte_size.dart @@ -63,10 +63,10 @@ class KiloByteSize implements Comparable { /// Divides the size by the [other] and returns the (truncated) result. /// - /// Throws [IntegerDivisionByZeroException] if other is exactly 0 bytes. + /// Throws [UnsupportedError] if other is exactly 0 bytes. KiloByteSize operator ~/(KiloByteSize other) { if (other.inBytes == 0) { - throw IntegerDivisionByZeroException(); + throw UnsupportedError('Cannot divide by zero.'); } return KiloByteSize._bytes(inBytes ~/ other.inBytes); } diff --git a/lib/filesharing/files_usecases/lib/src/file_viewer/pages/image_file_page.dart b/lib/filesharing/files_usecases/lib/src/file_viewer/pages/image_file_page.dart index 6c7d4c0cf..85e6f94a0 100644 --- a/lib/filesharing/files_usecases/lib/src/file_viewer/pages/image_file_page.dart +++ b/lib/filesharing/files_usecases/lib/src/file_viewer/pages/image_file_page.dart @@ -45,7 +45,7 @@ class _ImageFilePageState extends State { @override Widget build(BuildContext context) { return Theme( - data: Theme.of(context).copyWith(primaryColorBrightness: Brightness.dark), + data: Theme.of(context).copyWith(brightness: Brightness.dark), child: Scaffold( appBar: showAppBar ? FilePageAppBar( diff --git a/lib/filesharing/files_usecases/lib/src/file_viewer/pages/pdf_file_page.dart b/lib/filesharing/files_usecases/lib/src/file_viewer/pages/pdf_file_page.dart index 60d3ec425..f3a2eda78 100644 --- a/lib/filesharing/files_usecases/lib/src/file_viewer/pages/pdf_file_page.dart +++ b/lib/filesharing/files_usecases/lib/src/file_viewer/pages/pdf_file_page.dart @@ -35,7 +35,6 @@ class PdfFilePage extends StatelessWidget { return Theme( data: Theme.of(context).copyWith( brightness: Brightness.dark, - primaryColorBrightness: Brightness.dark, ), child: Scaffold( appBar: FilePageAppBar( diff --git a/lib/filesharing/files_usecases/lib/src/file_viewer/pages/video_file_page.dart b/lib/filesharing/files_usecases/lib/src/file_viewer/pages/video_file_page.dart index 823490af4..168fe16d5 100644 --- a/lib/filesharing/files_usecases/lib/src/file_viewer/pages/video_file_page.dart +++ b/lib/filesharing/files_usecases/lib/src/file_viewer/pages/video_file_page.dart @@ -30,7 +30,7 @@ class VideoFilePage extends StatelessWidget { @override Widget build(BuildContext context) { return Theme( - data: Theme.of(context).copyWith(primaryColorBrightness: Brightness.dark), + data: Theme.of(context).copyWith(brightness: Brightness.dark), child: Scaffold( appBar: FilePageAppBar( name: name, diff --git a/lib/filesharing/files_usecases/pubspec.lock b/lib/filesharing/files_usecases/pubspec.lock index be1bbd108..008f46823 100644 --- a/lib/filesharing/files_usecases/pubspec.lock +++ b/lib/filesharing/files_usecases/pubspec.lock @@ -21,7 +21,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.8.1" + version: "2.8.2" boolean_selector: dependency: transitive description: @@ -42,7 +42,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" charcode: dependency: transitive description: @@ -393,7 +393,14 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" meta: dependency: transitive description: @@ -671,7 +678,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.2" + version: "0.4.8" typed_data: dependency: transitive description: @@ -734,7 +741,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" video_player: dependency: "direct main" description: @@ -813,5 +820,5 @@ packages: source: hosted version: "5.1.2" sdks: - dart: ">=2.13.0 <3.0.0" + dart: ">=2.14.0 <3.0.0" flutter: ">=2.0.0" diff --git a/lib/filesharing/files_web/pubspec.lock b/lib/filesharing/files_web/pubspec.lock index 28aa993a4..0b9e59be1 100644 --- a/lib/filesharing/files_web/pubspec.lock +++ b/lib/filesharing/files_web/pubspec.lock @@ -7,7 +7,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.8.1" + version: "2.8.2" boolean_selector: dependency: transitive description: @@ -21,7 +21,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" charcode: dependency: transitive description: @@ -73,7 +73,14 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" meta: dependency: transitive description: @@ -141,7 +148,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.2" + version: "0.4.8" typed_data: dependency: transitive description: @@ -155,6 +162,6 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" sdks: - dart: ">=2.12.0 <3.0.0" + dart: ">=2.14.0 <3.0.0" diff --git a/lib/filesharing/filesharing_logic/pubspec.lock b/lib/filesharing/filesharing_logic/pubspec.lock index f54b0f8f4..7dcbea5b2 100644 --- a/lib/filesharing/filesharing_logic/pubspec.lock +++ b/lib/filesharing/filesharing_logic/pubspec.lock @@ -21,7 +21,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.8.1" + version: "2.8.2" boolean_selector: dependency: transitive description: @@ -42,7 +42,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" charcode: dependency: transitive description: @@ -393,7 +393,14 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" meta: dependency: transitive description: @@ -671,7 +678,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.2" + version: "0.4.8" typed_data: dependency: transitive description: @@ -734,7 +741,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" video_player: dependency: transitive description: @@ -813,5 +820,5 @@ packages: source: hosted version: "5.1.2" sdks: - dart: ">=2.13.0 <3.0.0" + dart: ">=2.14.0 <3.0.0" flutter: ">=2.0.0" diff --git a/lib/firebase_hausaufgabenheft_logik/pubspec.lock b/lib/firebase_hausaufgabenheft_logik/pubspec.lock index ea506b92b..2d53c859e 100644 --- a/lib/firebase_hausaufgabenheft_logik/pubspec.lock +++ b/lib/firebase_hausaufgabenheft_logik/pubspec.lock @@ -28,7 +28,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.8.1" + version: "2.8.2" bloc: dependency: transitive description: @@ -56,7 +56,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" charcode: dependency: transitive description: @@ -295,7 +295,14 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" meta: dependency: transitive description: @@ -426,7 +433,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.2" + version: "0.4.8" time: dependency: "direct main" description: @@ -454,7 +461,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" sdks: - dart: ">=2.12.0 <3.0.0" + dart: ">=2.14.0 <3.0.0" flutter: ">=1.12.13+hotfix.5" diff --git a/lib/group_domain_implementation/pubspec.lock b/lib/group_domain_implementation/pubspec.lock index 0eb62af49..1b7115747 100644 --- a/lib/group_domain_implementation/pubspec.lock +++ b/lib/group_domain_implementation/pubspec.lock @@ -28,7 +28,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.8.1" + version: "2.8.2" boolean_selector: dependency: transitive description: @@ -42,7 +42,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" charcode: dependency: transitive description: @@ -288,7 +288,14 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" meta: dependency: transitive description: @@ -405,7 +412,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.2" + version: "0.4.8" time: dependency: transitive description: @@ -440,7 +447,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" sdks: - dart: ">=2.12.0 <3.0.0" + dart: ">=2.14.0 <3.0.0" flutter: ">=1.12.13+hotfix.5" diff --git a/lib/group_domain_models/lib/src/models/group_info.dart b/lib/group_domain_models/lib/src/models/group_info.dart index 47837286e..24b4d6a9e 100644 --- a/lib/group_domain_models/lib/src/models/group_info.dart +++ b/lib/group_domain_models/lib/src/models/group_info.dart @@ -9,8 +9,6 @@ import 'package:group_domain_models/group_domain_models.dart'; import 'package:meta/meta.dart'; import 'package:design/design.dart'; -import 'group_type.dart'; -import 'member_role.dart'; class GroupInfo { final String id; diff --git a/lib/group_domain_models/lib/src/models/group_key.dart b/lib/group_domain_models/lib/src/models/group_key.dart index 3a6aa9e95..d1e2f576c 100644 --- a/lib/group_domain_models/lib/src/models/group_key.dart +++ b/lib/group_domain_models/lib/src/models/group_key.dart @@ -7,7 +7,6 @@ // SPDX-License-Identifier: EUPL-1.2 import 'package:flutter/material.dart'; -import 'package:meta/meta.dart'; import 'group_type.dart'; class GroupKey { diff --git a/lib/group_domain_models/pubspec.lock b/lib/group_domain_models/pubspec.lock index f23f03292..74ad1e09b 100644 --- a/lib/group_domain_models/pubspec.lock +++ b/lib/group_domain_models/pubspec.lock @@ -42,7 +42,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.8.1" + version: "2.8.2" boolean_selector: dependency: transitive description: @@ -56,7 +56,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" charcode: dependency: transitive description: @@ -344,7 +344,14 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" meta: dependency: transitive description: @@ -538,21 +545,21 @@ packages: name: test url: "https://pub.dartlang.org" source: hosted - version: "1.17.10" + version: "1.19.5" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.2" + version: "0.4.8" test_core: dependency: transitive description: name: test_core url: "https://pub.dartlang.org" source: hosted - version: "0.4.0" + version: "0.4.9" time: dependency: transitive description: @@ -587,7 +594,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" vm_service: dependency: transitive description: diff --git a/lib/hausaufgabenheft_logik/lib/src/lehrer/teacher_homework_page_bloc.dart b/lib/hausaufgabenheft_logik/lib/src/lehrer/teacher_homework_page_bloc.dart index b0cfe2e03..f1d5c55ac 100644 --- a/lib/hausaufgabenheft_logik/lib/src/lehrer/teacher_homework_page_bloc.dart +++ b/lib/hausaufgabenheft_logik/lib/src/lehrer/teacher_homework_page_bloc.dart @@ -16,9 +16,6 @@ import 'package:hausaufgabenheft_logik/hausaufgabenheft_logik_lehrer.dart'; import 'package:meta/meta.dart'; import 'package:random_string/random_string.dart'; -import 'events.dart'; -import 'states.dart'; - export 'events.dart'; export 'states.dart'; diff --git a/lib/hausaufgabenheft_logik/lib/src/lehrer/teacher_homework_section_view.dart b/lib/hausaufgabenheft_logik/lib/src/lehrer/teacher_homework_section_view.dart index 39e04ddfe..c8f2ae2e9 100644 --- a/lib/hausaufgabenheft_logik/lib/src/lehrer/teacher_homework_section_view.dart +++ b/lib/hausaufgabenheft_logik/lib/src/lehrer/teacher_homework_section_view.dart @@ -9,7 +9,6 @@ import 'package:equatable/equatable.dart'; import 'package:hausaufgabenheft_logik/hausaufgabenheft_logik_lehrer.dart'; -import 'teacher_homework_view.dart'; import 'teacher_homework_view_factory.dart'; class TeacherHomeworkSectionView extends Equatable { diff --git a/lib/hausaufgabenheft_logik/lib/src/lehrer/teacher_homework_view_factory.dart b/lib/hausaufgabenheft_logik/lib/src/lehrer/teacher_homework_view_factory.dart index ab42cec9c..88779ad65 100644 --- a/lib/hausaufgabenheft_logik/lib/src/lehrer/teacher_homework_view_factory.dart +++ b/lib/hausaufgabenheft_logik/lib/src/lehrer/teacher_homework_view_factory.dart @@ -11,7 +11,6 @@ import 'package:hausaufgabenheft_logik/src/views/color.dart'; import 'package:meta/meta.dart'; import '../../hausaufgabenheft_logik_lehrer.dart'; -import 'teacher_homework_view.dart'; class TeacherHomeworkViewFactory { Date Function() _getCurrentDate; diff --git a/lib/hausaufgabenheft_logik/lib/src/student_homework_page_bloc/student_homework_page_bloc.dart b/lib/hausaufgabenheft_logik/lib/src/student_homework_page_bloc/student_homework_page_bloc.dart index ddd265883..0d316e70b 100644 --- a/lib/hausaufgabenheft_logik/lib/src/student_homework_page_bloc/student_homework_page_bloc.dart +++ b/lib/hausaufgabenheft_logik/lib/src/student_homework_page_bloc/student_homework_page_bloc.dart @@ -27,9 +27,6 @@ import 'package:hausaufgabenheft_logik/src/open_homeworks/open_homework_view_blo import 'package:hausaufgabenheft_logik/src/open_homeworks/open_homework_view_bloc/states.dart' as open; -import 'events.dart'; -import 'states.dart'; - /// This Bloc serves basically only as an interface to the outer world with 2 /// tasks: /// * It delegates all incoming [HomeworkPageEvent]s to the other blocs. diff --git a/lib/hausaufgabenheft_logik/pubspec.lock b/lib/hausaufgabenheft_logik/pubspec.lock index 1688bcaed..66247e195 100644 --- a/lib/hausaufgabenheft_logik/pubspec.lock +++ b/lib/hausaufgabenheft_logik/pubspec.lock @@ -443,4 +443,4 @@ packages: source: hosted version: "3.1.0" sdks: - dart: ">=2.12.0 <3.0.0" + dart: ">=2.14.0 <3.0.0" diff --git a/lib/hausaufgabenheft_logik/test/create_homework_util.dart b/lib/hausaufgabenheft_logik/test/create_homework_util.dart index 30ecb633b..60d33ab59 100644 --- a/lib/hausaufgabenheft_logik/test/create_homework_util.dart +++ b/lib/hausaufgabenheft_logik/test/create_homework_util.dart @@ -10,7 +10,6 @@ import 'dart:math'; import 'package:common_domain_models/common_domain_models.dart'; import 'package:hausaufgabenheft_logik/src/models/homework/homework.dart'; -import 'package:hausaufgabenheft_logik/src/models/date.dart'; import 'package:hausaufgabenheft_logik/src/models/homework/models_used_by_homework.dart'; import 'package:hausaufgabenheft_logik/src/views/color.dart'; diff --git a/lib/hausaufgabenheft_logik/test/create_student_homework_view_test.dart b/lib/hausaufgabenheft_logik/test/create_student_homework_view_test.dart index b074303f0..eeda3e979 100644 --- a/lib/hausaufgabenheft_logik/test/create_student_homework_view_test.dart +++ b/lib/hausaufgabenheft_logik/test/create_student_homework_view_test.dart @@ -8,8 +8,6 @@ import 'package:common_domain_models/common_domain_models.dart'; import 'package:hausaufgabenheft_logik/src/models/homework/homework.dart'; -import 'package:hausaufgabenheft_logik/src/models/homework/homework_completion_status.dart'; -import 'package:hausaufgabenheft_logik/src/models/date.dart'; import 'package:hausaufgabenheft_logik/src/models/homework/models_used_by_homework.dart'; import 'package:hausaufgabenheft_logik/src/views/color.dart'; import 'package:hausaufgabenheft_logik/src/views/student_homework_view_factory.dart'; diff --git a/lib/hausaufgabenheft_logik/test/homework_list_test.dart b/lib/hausaufgabenheft_logik/test/homework_list_test.dart index 453952aeb..0b2e75b1c 100644 --- a/lib/hausaufgabenheft_logik/test/homework_list_test.dart +++ b/lib/hausaufgabenheft_logik/test/homework_list_test.dart @@ -7,7 +7,6 @@ // SPDX-License-Identifier: EUPL-1.2 import 'package:hausaufgabenheft_logik/src/models/homework/homework.dart'; -import 'package:hausaufgabenheft_logik/src/models/date.dart'; import 'package:hausaufgabenheft_logik/src/models/homework/models_used_by_homework.dart'; import 'package:hausaufgabenheft_logik/src/models/homework_list.dart'; import 'package:hausaufgabenheft_logik/src/open_homeworks/sort_and_subcategorization/sort/smallest_date_subject_and_title_sort.dart'; diff --git a/lib/hausaufgabenheft_logik/test/homework_page_bloc_test.dart b/lib/hausaufgabenheft_logik/test/homework_page_bloc_test.dart index ea9fb8296..57abd528a 100644 --- a/lib/hausaufgabenheft_logik/test/homework_page_bloc_test.dart +++ b/lib/hausaufgabenheft_logik/test/homework_page_bloc_test.dart @@ -13,18 +13,11 @@ import 'package:bloc/bloc.dart'; import 'package:hausaufgabenheft_logik/hausaufgabenheft_logik.dart'; import 'package:hausaufgabenheft_logik/hausaufgabenheft_logik_setup.dart'; import 'package:hausaufgabenheft_logik/src/completed_homeworks/completed_homeworks_view_bloc/completed_homeworks_view_bloc_impl.dart'; -import 'package:hausaufgabenheft_logik/src/homework_completion/homework_completion_dispatcher.dart'; -import 'package:hausaufgabenheft_logik/src/student_homework_page_bloc/events.dart'; -import 'package:hausaufgabenheft_logik/src/student_homework_page_bloc/student_homework_page_bloc.dart'; -import 'package:hausaufgabenheft_logik/src/student_homework_page_bloc/homework_sorting_cache.dart'; -import 'package:hausaufgabenheft_logik/src/student_homework_page_bloc/states.dart'; import 'package:hausaufgabenheft_logik/src/completed_homeworks/lazy_loading_completed_homeworks_bloc/lazy_loading_completed_homeworks_bloc_impl.dart'; -import 'package:hausaufgabenheft_logik/src/models/homework/homework.dart'; -import 'package:hausaufgabenheft_logik/src/models/homework/homework_completion_status.dart'; -import 'package:hausaufgabenheft_logik/src/models/date.dart'; +import 'package:hausaufgabenheft_logik/src/completed_homeworks/views/completed_homework_list_view_factory.dart'; import 'package:hausaufgabenheft_logik/src/models/homework_list.dart'; +import 'package:hausaufgabenheft_logik/src/student_homework_page_bloc/homework_sorting_cache.dart'; import 'package:hausaufgabenheft_logik/src/views/color.dart'; -import 'package:hausaufgabenheft_logik/src/completed_homeworks/views/completed_homework_list_view_factory.dart'; import 'package:hausaufgabenheft_logik/src/views/student_homework_view_factory.dart'; import 'package:key_value_store/in_memory_key_value_store.dart'; import 'package:key_value_store/key_value_store.dart'; diff --git a/lib/last_online_reporting/pubspec.lock b/lib/last_online_reporting/pubspec.lock index 019f6afd9..544f2d14c 100644 --- a/lib/last_online_reporting/pubspec.lock +++ b/lib/last_online_reporting/pubspec.lock @@ -42,7 +42,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.8.1" + version: "2.8.2" boolean_selector: dependency: transitive description: @@ -56,7 +56,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" charcode: dependency: transitive description: @@ -323,7 +323,14 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" meta: dependency: transitive description: @@ -517,21 +524,21 @@ packages: name: test url: "https://pub.dartlang.org" source: hosted - version: "1.17.10" + version: "1.19.5" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.2" + version: "0.4.8" test_core: dependency: transitive description: name: test_core url: "https://pub.dartlang.org" source: hosted - version: "0.4.0" + version: "0.4.9" typed_data: dependency: transitive description: @@ -552,7 +559,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" vm_service: dependency: transitive description: diff --git a/lib/notifications/lib/src/action_executor.dart b/lib/notifications/lib/src/action_executor.dart index c0a5fce87..07fecfdd2 100644 --- a/lib/notifications/lib/src/action_executor.dart +++ b/lib/notifications/lib/src/action_executor.dart @@ -7,7 +7,6 @@ // SPDX-License-Identifier: EUPL-1.2 import '../notifications.dart'; -import 'action_request.dart'; class ActionExecutor { final Map _executionMap; diff --git a/lib/notifications/lib/src/notification_parser.dart b/lib/notifications/lib/src/notification_parser.dart index f67403fd0..857138f87 100644 --- a/lib/notifications/lib/src/notification_parser.dart +++ b/lib/notifications/lib/src/notification_parser.dart @@ -7,9 +7,7 @@ // SPDX-License-Identifier: EUPL-1.2 import '../notifications.dart'; -import 'action_request.dart'; import 'instrumentation.dart'; -import 'push_notification.dart'; class PushNotificationParser { final Map _parsingMap; diff --git a/lib/notifications/lib/src/push_notification_action_handler.dart b/lib/notifications/lib/src/push_notification_action_handler.dart index 20dd19b38..9af7cb56a 100644 --- a/lib/notifications/lib/src/push_notification_action_handler.dart +++ b/lib/notifications/lib/src/push_notification_action_handler.dart @@ -12,10 +12,7 @@ import 'package:meta/meta.dart'; import 'package:notifications/notifications.dart'; import 'package:notifications/src/notification_parser.dart'; -import 'action_request.dart'; import 'action_executor.dart'; -import 'instrumentation.dart'; -import 'push_notification.dart'; export 'action_request.dart'; export 'instrumentation.dart' hide PushNotificationParserInstrumentationFactory; diff --git a/lib/notifications/pubspec.lock b/lib/notifications/pubspec.lock index 39a873102..b587f7ead 100644 --- a/lib/notifications/pubspec.lock +++ b/lib/notifications/pubspec.lock @@ -28,7 +28,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.8.1" + version: "2.8.2" boolean_selector: dependency: transitive description: @@ -42,7 +42,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" charcode: dependency: transitive description: @@ -225,7 +225,14 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" meta: dependency: "direct main" description: @@ -377,21 +384,21 @@ packages: name: test url: "https://pub.dartlang.org" source: hosted - version: "1.17.10" + version: "1.19.5" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.2" + version: "0.4.8" test_core: dependency: transitive description: name: test_core url: "https://pub.dartlang.org" source: hosted - version: "0.4.0" + version: "0.4.9" typed_data: dependency: transitive description: @@ -405,7 +412,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" vm_service: dependency: transitive description: diff --git a/lib/remote_configuration/pubspec.lock b/lib/remote_configuration/pubspec.lock index 694e960df..d577d1d97 100644 --- a/lib/remote_configuration/pubspec.lock +++ b/lib/remote_configuration/pubspec.lock @@ -7,7 +7,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.8.1" + version: "2.8.2" boolean_selector: dependency: transitive description: @@ -21,7 +21,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" charcode: dependency: transitive description: @@ -148,7 +148,14 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" meta: dependency: transitive description: @@ -237,7 +244,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.2" + version: "0.4.8" typed_data: dependency: transitive description: @@ -251,7 +258,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" sdks: - dart: ">=2.12.0 <3.0.0" + dart: ">=2.14.0 <3.0.0" flutter: ">=1.12.13+hotfix.5" diff --git a/lib/sharezone_about_page_addon/lib/game/collision/collision_box.dart b/lib/sharezone_about_page_addon/lib/game/collision/collision_box.dart index 156038354..1f40b560a 100644 --- a/lib/sharezone_about_page_addon/lib/game/collision/collision_box.dart +++ b/lib/sharezone_about_page_addon/lib/game/collision/collision_box.dart @@ -6,7 +6,6 @@ // // SPDX-License-Identifier: EUPL-1.2 -import 'package:flame/components.dart'; import 'package:flame/extensions.dart'; import 'package:flutter/foundation.dart'; diff --git a/lib/sharezone_about_page_addon/lib/game/horizon/horizon.dart b/lib/sharezone_about_page_addon/lib/game/horizon/horizon.dart index 2a42249ec..05d69ca9d 100644 --- a/lib/sharezone_about_page_addon/lib/game/horizon/horizon.dart +++ b/lib/sharezone_about_page_addon/lib/game/horizon/horizon.dart @@ -15,7 +15,7 @@ class Horizon extends PositionComponent with HasGameRef { late final horizonLine = HorizonLine(); @override - Future? onLoad() { + Future onLoad() async { addChild(horizonLine); } diff --git a/lib/sharezone_about_page_addon/lib/game/obstacle/obstacle_type.dart b/lib/sharezone_about_page_addon/lib/game/obstacle/obstacle_type.dart index af8a7a83d..336b40126 100644 --- a/lib/sharezone_about_page_addon/lib/game/obstacle/obstacle_type.dart +++ b/lib/sharezone_about_page_addon/lib/game/obstacle/obstacle_type.dart @@ -9,7 +9,6 @@ import 'dart:ui'; import 'package:flame/components.dart'; -import 'package:flame/sprite.dart'; import 'package:sharezone_about_page_addon/game/collision/collision_box.dart'; class ObstacleType { diff --git a/lib/sharezone_about_page_addon/lib/game/t_rex/t_rex.dart b/lib/sharezone_about_page_addon/lib/game/t_rex/t_rex.dart index cc5567d9d..726fb5ff6 100644 --- a/lib/sharezone_about_page_addon/lib/game/t_rex/t_rex.dart +++ b/lib/sharezone_about_page_addon/lib/game/t_rex/t_rex.dart @@ -9,7 +9,6 @@ import 'dart:ui'; import 'package:flame/components.dart'; -import 'package:flame/sprite.dart'; import 'package:sharezone_about_page_addon/game/game.dart'; import 'package:sharezone_about_page_addon/game/t_rex/config.dart'; @@ -45,7 +44,7 @@ class TRex extends PositionComponent with HasGameRef { } @override - Future? onLoad() { + Future onLoad() async { addChild(idleDino); addChild(runningDino); addChild(jumpingTRex); diff --git a/lib/sharezone_about_page_addon/pubspec.lock b/lib/sharezone_about_page_addon/pubspec.lock index 9d8f82bd1..27a7db427 100644 --- a/lib/sharezone_about_page_addon/pubspec.lock +++ b/lib/sharezone_about_page_addon/pubspec.lock @@ -21,7 +21,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.8.1" + version: "2.8.2" boolean_selector: dependency: transitive description: @@ -35,7 +35,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" charcode: dependency: transitive description: @@ -115,7 +115,14 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" meta: dependency: transitive description: @@ -190,7 +197,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.2" + version: "0.4.8" typed_data: dependency: transitive description: @@ -204,7 +211,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" xml: dependency: transitive description: @@ -220,5 +227,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.13.0 <3.0.0" + dart: ">=2.14.0 <3.0.0" flutter: ">=1.24.0" diff --git a/lib/sharezone_common/pubspec.lock b/lib/sharezone_common/pubspec.lock index f4620960a..655e0f962 100644 --- a/lib/sharezone_common/pubspec.lock +++ b/lib/sharezone_common/pubspec.lock @@ -14,7 +14,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.8.1" + version: "2.8.2" boolean_selector: dependency: transitive description: @@ -28,7 +28,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" charcode: dependency: transitive description: @@ -197,7 +197,14 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" meta: dependency: transitive description: @@ -286,7 +293,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.2" + version: "0.4.8" typed_data: dependency: transitive description: @@ -300,7 +307,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" sdks: - dart: ">=2.12.0 <3.0.0" + dart: ">=2.14.0 <3.0.0" flutter: ">=1.12.13+hotfix.5" diff --git a/lib/sharezone_utils/pubspec.lock b/lib/sharezone_utils/pubspec.lock index a86f23fc3..88f51ea96 100644 --- a/lib/sharezone_utils/pubspec.lock +++ b/lib/sharezone_utils/pubspec.lock @@ -7,7 +7,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.8.1" + version: "2.8.2" boolean_selector: dependency: transitive description: @@ -21,7 +21,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" charcode: dependency: transitive description: @@ -80,7 +80,14 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" meta: dependency: transitive description: @@ -155,7 +162,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.2" + version: "0.4.8" typed_data: dependency: transitive description: @@ -169,7 +176,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" sdks: - dart: ">=2.12.0 <3.0.0" + dart: ">=2.14.0 <3.0.0" flutter: ">=1.12.13+hotfix.5" diff --git a/lib/sharezone_widgets/lib/src/adaptive_dialog/adapative_dialog_action.dart b/lib/sharezone_widgets/lib/src/adaptive_dialog/adapative_dialog_action.dart index 74c9213df..ad514597f 100644 --- a/lib/sharezone_widgets/lib/src/adaptive_dialog/adapative_dialog_action.dart +++ b/lib/sharezone_widgets/lib/src/adaptive_dialog/adapative_dialog_action.dart @@ -7,7 +7,6 @@ // SPDX-License-Identifier: EUPL-1.2 import 'package:flutter/material.dart'; -import 'package:flutter/widgets.dart'; class AdaptiveDialogAction { final Key key; diff --git a/lib/sharezone_widgets/lib/src/form.dart b/lib/sharezone_widgets/lib/src/form.dart index f941e461b..27e49574b 100644 --- a/lib/sharezone_widgets/lib/src/form.dart +++ b/lib/sharezone_widgets/lib/src/form.dart @@ -8,7 +8,6 @@ import 'dart:async'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:sharezone_widgets/adaptive_dialog.dart'; import 'package:sharezone_widgets/theme.dart'; diff --git a/lib/sharezone_widgets/lib/src/state_sheet/simple/simple_content_dialog.dart b/lib/sharezone_widgets/lib/src/state_sheet/simple/simple_content_dialog.dart index 404057588..486f2415f 100644 --- a/lib/sharezone_widgets/lib/src/state_sheet/simple/simple_content_dialog.dart +++ b/lib/sharezone_widgets/lib/src/state_sheet/simple/simple_content_dialog.dart @@ -6,7 +6,6 @@ // // SPDX-License-Identifier: EUPL-1.2 -import 'package:sharezone_widgets/src/state_sheet/state_dialog_content.dart'; import 'package:sharezone_widgets/state_sheet.dart'; final stateDialogContentLoading = StateDialogContent( diff --git a/lib/sharezone_widgets/lib/src/state_sheet/state_dialog_content.dart b/lib/sharezone_widgets/lib/src/state_sheet/state_dialog_content.dart index ab298d51c..f1ce133f4 100644 --- a/lib/sharezone_widgets/lib/src/state_sheet/state_dialog_content.dart +++ b/lib/sharezone_widgets/lib/src/state_sheet/state_dialog_content.dart @@ -7,7 +7,6 @@ // SPDX-License-Identifier: EUPL-1.2 import 'package:flutter/material.dart'; -import 'package:sharezone_widgets/common_widgets.dart'; import 'package:sharezone_widgets/state_sheet.dart'; class StateDialogContent { diff --git a/lib/sharezone_widgets/lib/src/state_sheet/state_sheet_content.dart b/lib/sharezone_widgets/lib/src/state_sheet/state_sheet_content.dart index 437f95dda..bb98f585c 100644 --- a/lib/sharezone_widgets/lib/src/state_sheet/state_sheet_content.dart +++ b/lib/sharezone_widgets/lib/src/state_sheet/state_sheet_content.dart @@ -7,7 +7,6 @@ // SPDX-License-Identifier: EUPL-1.2 import 'package:flutter/material.dart'; -import 'package:sharezone_widgets/common_widgets.dart'; import 'package:sharezone_widgets/state_sheet.dart'; class StateSheetContent { diff --git a/lib/sharezone_widgets/lib/src/theme/brightness/dark_theme.dart b/lib/sharezone_widgets/lib/src/theme/brightness/dark_theme.dart index 8e5812a1e..7abeec369 100644 --- a/lib/sharezone_widgets/lib/src/theme/brightness/dark_theme.dart +++ b/lib/sharezone_widgets/lib/src/theme/brightness/dark_theme.dart @@ -13,7 +13,6 @@ const _accentColor = Colors.lightBlue; final darkTheme = ThemeData( // Brightness brightness: Brightness.dark, - primaryColorBrightness: Brightness.dark, scaffoldBackgroundColor: ElevationColors.dp0, // Colors @@ -51,6 +50,7 @@ final darkTheme = ThemeData( dialogTheme: _dialogTheme, colorScheme: ColorScheme.fromSwatch() .copyWith(secondary: _accentColor, brightness: Brightness.dark), + tabBarTheme: TabBarTheme(labelColor: Colors.white), ); bool isDarkThemeEnabled(BuildContext context) => diff --git a/lib/sharezone_widgets/lib/src/theme/brightness/general_theme.dart b/lib/sharezone_widgets/lib/src/theme/brightness/general_theme.dart index 29646b58c..02a5544bb 100644 --- a/lib/sharezone_widgets/lib/src/theme/brightness/general_theme.dart +++ b/lib/sharezone_widgets/lib/src/theme/brightness/general_theme.dart @@ -7,7 +7,6 @@ // SPDX-License-Identifier: EUPL-1.2 import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; import 'package:sharezone_utils/platform.dart'; import '../theme.dart'; diff --git a/lib/sharezone_widgets/lib/src/theme/brightness/light_theme.dart b/lib/sharezone_widgets/lib/src/theme/brightness/light_theme.dart index 6ba2aeaf1..aef70bee5 100644 --- a/lib/sharezone_widgets/lib/src/theme/brightness/light_theme.dart +++ b/lib/sharezone_widgets/lib/src/theme/brightness/light_theme.dart @@ -11,7 +11,6 @@ part of 'general_theme.dart'; final lightTheme = ThemeData( // Brightness brightness: Brightness.light, - primaryColorBrightness: Brightness.light, // Colors cardColor: Colors.white, diff --git a/lib/sharezone_widgets/lib/src/widgets.dart b/lib/sharezone_widgets/lib/src/widgets.dart index cce139f25..031f516b4 100644 --- a/lib/sharezone_widgets/lib/src/widgets.dart +++ b/lib/sharezone_widgets/lib/src/widgets.dart @@ -8,12 +8,10 @@ import 'dart:async'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:sharezone_widgets/svg.dart'; import 'package:intl/intl.dart'; import 'package:sharezone_common/helper_functions.dart'; -import 'package:sharezone_widgets/src/theme/theme.dart'; import 'package:sharezone_widgets/theme.dart'; import 'adaptive_dialog/adapative_dialog_action.dart'; @@ -80,9 +78,15 @@ class DatePicker extends StatelessWidget { @override Widget build(BuildContext context) { - final valueStyle = TextStyle(color: Colors.grey[500]); return Theme( - data: Theme.of(context).copyWith(colorScheme: ColorScheme.fromSwatch().copyWith(secondary: accentColor)), + data: Theme.of(context).copyWith( + colorScheme: ColorScheme.fromSeed( + primary: Theme.of(context).primaryColor, + seedColor: Theme.of(context).primaryColor, + brightness: + isDarkThemeEnabled(context) ? Brightness.dark : Brightness.light, + ), + ), child: Builder( builder: (context) { return Column( @@ -94,7 +98,6 @@ class DatePicker extends StatelessWidget { valueText: selectedDate != null ? DateFormat.yMMMd().format(selectedDate) : "Datum auswählen", - valueStyle: valueStyle, padding: padding, onPressed: () async { FocusScope.of(context) @@ -122,7 +125,9 @@ class AccentColorCircularProgressIndicator extends StatelessWidget { @override Widget build(BuildContext context) { return Theme( - data: ThemeData(colorScheme: ColorScheme.fromSwatch().copyWith(secondary: accentColor)), + data: ThemeData( + colorScheme: + ColorScheme.fromSwatch().copyWith(secondary: accentColor)), child: CircularProgressIndicator( value: value, strokeWidth: strokeWidth ?? 4, @@ -308,9 +313,8 @@ class _InputDropdown extends StatelessWidget { SizedBox(width: 4.0), Icon( iconData, - color: isDarkThemeEnabled(context) - ? Colors.white - : Colors.grey[500], + color: + isDarkThemeEnabled(context) ? null : Colors.grey[600], ), SizedBox(width: 32.0), labelText != null @@ -332,10 +336,7 @@ class _InputDropdown extends StatelessWidget { ), Padding( padding: const EdgeInsets.only(right: 3), - child: Icon(Icons.keyboard_arrow_down, - color: Theme.of(context).brightness == Brightness.light - ? Colors.grey[600] - : Colors.white70), + child: Icon(Icons.keyboard_arrow_down), ), ], ), diff --git a/lib/sharezone_widgets/pubspec.lock b/lib/sharezone_widgets/pubspec.lock index e83b4005c..2f237b759 100644 --- a/lib/sharezone_widgets/pubspec.lock +++ b/lib/sharezone_widgets/pubspec.lock @@ -14,7 +14,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.8.1" + version: "2.8.2" boolean_selector: dependency: transitive description: @@ -35,7 +35,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" charcode: dependency: transitive description: @@ -218,7 +218,14 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" meta: dependency: transitive description: @@ -342,7 +349,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.2" + version: "0.4.8" typed_data: dependency: transitive description: @@ -356,7 +363,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" xml: dependency: transitive description: @@ -365,5 +372,5 @@ packages: source: hosted version: "5.1.2" sdks: - dart: ">=2.12.0 <3.0.0" + dart: ">=2.14.0 <3.0.0" flutter: ">=1.24.0-7.0" diff --git a/lib/streaming_shared_preferences/.gitignore b/lib/streaming_shared_preferences/.gitignore deleted file mode 100644 index bb431f0d5..000000000 --- a/lib/streaming_shared_preferences/.gitignore +++ /dev/null @@ -1,75 +0,0 @@ -# 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/streaming_shared_preferences/CHANGELOG.md b/lib/streaming_shared_preferences/CHANGELOG.md deleted file mode 100755 index 188a6bf44..000000000 --- a/lib/streaming_shared_preferences/CHANGELOG.md +++ /dev/null @@ -1,5 +0,0 @@ -## 1.0.1 -* [#1](https://github.com/roughike/streaming_shared_preferences/pull/1): Fix a bug where reusing a `Preference` between multiple listeners only propagated the change to the first one. - -## 1.0.0 -* Initial stable release. \ No newline at end of file diff --git a/lib/streaming_shared_preferences/LICENSE b/lib/streaming_shared_preferences/LICENSE deleted file mode 100755 index 52b94ffc0..000000000 --- a/lib/streaming_shared_preferences/LICENSE +++ /dev/null @@ -1,9 +0,0 @@ -Copyright 2019 Iiro Krankka - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/lib/streaming_shared_preferences/analysis_options.yaml b/lib/streaming_shared_preferences/analysis_options.yaml deleted file mode 100644 index a3390b58c..000000000 --- a/lib/streaming_shared_preferences/analysis_options.yaml +++ /dev/null @@ -1,73 +0,0 @@ -# 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 - -analyzer: - errors: - mixin_inherits_from_not_object: ignore -linter: - rules: - - always_declare_return_types - - always_require_non_null_named_parameters - - annotate_overrides - - avoid_empty_else - - avoid_field_initializers_in_const_classes - - avoid_init_to_null - - avoid_null_checks_in_equality_operators - - avoid_relative_lib_imports - - avoid_return_types_on_setters - - avoid_slow_async_io - - await_only_futures - - camel_case_types - - cancel_subscriptions - - control_flow_in_finally - - directives_ordering - - empty_catches - - empty_constructor_bodies - - empty_statements - - hash_and_equals - - implementation_imports - - iterable_contains_unrelated_type - - library_names - - library_prefixes - - list_remove_unrelated_type - - no_adjacent_strings_in_list - - no_duplicate_case_values - - non_constant_identifier_names - - overridden_fields - - package_api_docs - - package_names - - package_prefixed_library_names - - prefer_adjacent_string_concatenation - - prefer_asserts_in_initializer_lists - - prefer_conditional_assignment - - prefer_const_declarations - - prefer_const_literals_to_create_immutables - - prefer_contains - - prefer_equal_for_default_values - - prefer_final_fields - - prefer_final_locals - - prefer_foreach - - prefer_initializing_formals - - prefer_is_empty - - prefer_is_not_empty - - prefer_typing_uninitialized_variables - - recursive_getters - - slash_for_doc_comments - - sort_unnamed_constructors_first - - test_types_in_equals - - throw_in_finally - - type_init_formals - - unnecessary_brace_in_string_interps - - unnecessary_getters_setters - - unnecessary_null_aware_assignments - - unnecessary_null_in_if_null_operators - - unnecessary_overrides - - unrelated_type_equality_checks - - use_rethrow_when_possible - - unnecessary_new - diff --git a/lib/streaming_shared_preferences/lib/src/adapters/adapters.dart b/lib/streaming_shared_preferences/lib/src/adapters/adapters.dart deleted file mode 100755 index b60d6fe0f..000000000 --- a/lib/streaming_shared_preferences/lib/src/adapters/adapters.dart +++ /dev/null @@ -1,12 +0,0 @@ -// 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 - -export 'datetime_adapter.dart'; -export 'json_adapter.dart'; -export 'preference_adapter.dart'; -export 'primitive_adapters.dart'; diff --git a/lib/streaming_shared_preferences/lib/src/adapters/datetime_adapter.dart b/lib/streaming_shared_preferences/lib/src/adapters/datetime_adapter.dart deleted file mode 100755 index 2f81c05f6..000000000 --- a/lib/streaming_shared_preferences/lib/src/adapters/datetime_adapter.dart +++ /dev/null @@ -1,36 +0,0 @@ -// 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 - -import 'package:shared_preferences/shared_preferences.dart'; - -import 'preference_adapter.dart'; - -/// A [PreferenceAdapter] implementation for storing and retrieving a [DateTime]. -/// -/// Stores values as timezone independent milliseconds from the standard Unix epoch. -class DateTimeAdapter extends PreferenceAdapter { - static const instance = DateTimeAdapter._(); - const DateTimeAdapter._(); - - @override - DateTime getValue(SharedPreferences preferences, String key) { - final value = preferences.getString(key); - if (value == null) return null; - - return DateTime.fromMillisecondsSinceEpoch(int.parse(value), isUtc: true); - } - - @override - Future setValue( - SharedPreferences preferences, String key, DateTime value) { - return preferences.setString( - key, - value?.millisecondsSinceEpoch?.toString(), - ); - } -} diff --git a/lib/streaming_shared_preferences/lib/src/adapters/json_adapter.dart b/lib/streaming_shared_preferences/lib/src/adapters/json_adapter.dart deleted file mode 100755 index 0c9a78965..000000000 --- a/lib/streaming_shared_preferences/lib/src/adapters/json_adapter.dart +++ /dev/null @@ -1,86 +0,0 @@ -// 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 - -import 'dart:convert'; - -import 'package:shared_preferences/shared_preferences.dart'; - -import 'preference_adapter.dart'; - -/// A convenience adapter that handles common pitfalls when storing and retrieving -/// JSON values. -/// -/// [JsonAdapter] eliminates the need for a custom [PreferenceAdapter]. It also -/// saves you from duplicating `if (value == null) return null` for custom adapters. -/// -/// For example, if we have a class called `SampleObject`: -/// -/// ``` -/// class SampleObject { -/// SampleObject(this.isAwesome); -/// final bool isAwesome; -/// -/// SampleObject.fromJson(Map json) : -/// isAwesome = json['isAwesome']; -/// -/// Map toJson() => { 'isAwesome': isAwesome }; -/// } -/// ``` -/// -/// As seen from the above example, SampleObject implements both `fromJson` and -/// `toJson`. -/// -/// When present, [JsonAdapter] will call `toJson` automatically. For reviving, -/// you need to provide a [deserializer] that calls `fromJson` manually: -/// -/// ``` -/// final sampleObject = preferences.getCustomValue( -/// 'my-key', -/// adapter: JsonAdapter( -/// deserializer: (value) => SampleObject.fromJson(value), -/// ), -/// ); -/// ``` -/// -/// ## Using JsonAdapter with built_value -/// -/// You can do custom serialization logic before JSON encoding the object by -/// providing a [serializer]. Similarly, you can use [deserializer] to map the -/// decoded JSON map into any object you want. -/// -/// For example: -/// -/// ``` -/// final sampleObject = preferences.getCustomValue( -/// 'my-key', -/// adapter: JsonAdapter( -/// serializer: (value) => serializers.serialize(value), -/// deserializer: (value) => serializers.deserialize(value), -/// ), -/// ); -/// ``` -class JsonAdapter extends PreferenceAdapter { - const JsonAdapter({this.serializer, this.deserializer}); - final Object Function(T) serializer; - final T Function(Object) deserializer; - - @override - T getValue(SharedPreferences preferences, String key) { - final value = preferences.getString(key); - if (value == null) return null; - - final decoded = jsonDecode(value); - return deserializer != null ? deserializer(decoded) : decoded; - } - - @override - Future setValue(SharedPreferences preferences, String key, T value) { - final serializedValue = serializer != null ? serializer(value) : value; - return preferences.setString(key, jsonEncode(serializedValue)); - } -} diff --git a/lib/streaming_shared_preferences/lib/src/adapters/preference_adapter.dart b/lib/streaming_shared_preferences/lib/src/adapters/preference_adapter.dart deleted file mode 100755 index da7dad2d4..000000000 --- a/lib/streaming_shared_preferences/lib/src/adapters/preference_adapter.dart +++ /dev/null @@ -1,27 +0,0 @@ -// 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 - -import 'package:shared_preferences/shared_preferences.dart'; - -/// A [PreferenceAdapter] knows how to retrieve and store a value associated -/// with a key by using [SharedPreferences]. -/// -/// For examples, see: -/// * [BoolAdapter], [IntAdapter], [StringAdapter] for simple preference adapters -/// * [DateTimeAdapter] and [JsonAdapter] for more involved preference adapters -abstract class PreferenceAdapter { - const PreferenceAdapter(); - - /// Retrieve a value associated with the [key] by using the [preferences]. - T getValue(SharedPreferences preferences, String key); - - /// Set a [value] for the [key] by using the [preferences]. - /// - /// Returns true if value was successfully set, otherwise false. - Future setValue(SharedPreferences preferences, String key, T value); -} diff --git a/lib/streaming_shared_preferences/lib/src/adapters/primitive_adapters.dart b/lib/streaming_shared_preferences/lib/src/adapters/primitive_adapters.dart deleted file mode 100755 index 4cb901898..000000000 --- a/lib/streaming_shared_preferences/lib/src/adapters/primitive_adapters.dart +++ /dev/null @@ -1,75 +0,0 @@ -// 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 - -import 'preference_adapter.dart'; - -/// A [PreferenceAdapter] implementation for storing and retrieving a [bool]. -class BoolAdapter extends PreferenceAdapter { - static const instance = BoolAdapter._(); - const BoolAdapter._(); - - @override - bool getValue(preferences, key) => preferences.getBool(key); - - @override - Future setValue(preferences, key, value) => - preferences.setBool(key, value); -} - -/// A [PreferenceAdapter] implementation for storing and retrieving an [int]. -class IntAdapter extends PreferenceAdapter { - static const instance = IntAdapter._(); - const IntAdapter._(); - - @override - int getValue(preferences, key) => preferences.getInt(key); - - @override - Future setValue(preferences, key, value) => - preferences.setInt(key, value); -} - -/// A [PreferenceAdapter] implementation for storing and retrieving a [double]. -class DoubleAdapter extends PreferenceAdapter { - static const instance = DoubleAdapter._(); - const DoubleAdapter._(); - - @override - double getValue(preferences, key) => preferences.getDouble(key); - - @override - Future setValue(preferences, key, value) => - preferences.setDouble(key, value); -} - -/// A [PreferenceAdapter] implementation for storing and retrieving a [String]. -class StringAdapter extends PreferenceAdapter { - static const instance = StringAdapter._(); - const StringAdapter._(); - - @override - String getValue(preferences, key) => preferences.getString(key); - - @override - Future setValue(preferences, key, value) => - preferences.setString(key, value); -} - -/// A [PreferenceAdapter] implementation for storing and retrieving a [List] of -/// [String] objects. -class StringListAdapter extends PreferenceAdapter> { - static const instance = StringListAdapter._(); - const StringListAdapter._(); - - @override - List getValue(preferences, key) => preferences.getStringList(key); - - @override - Future setValue(preferences, key, values) => - preferences.setStringList(key, values); -} diff --git a/lib/streaming_shared_preferences/lib/src/preference/preference.dart b/lib/streaming_shared_preferences/lib/src/preference/preference.dart deleted file mode 100755 index f5fed41d2..000000000 --- a/lib/streaming_shared_preferences/lib/src/preference/preference.dart +++ /dev/null @@ -1,192 +0,0 @@ -// 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 - -import 'dart:async'; - -import 'package:flutter/foundation.dart'; -import 'package:meta/meta.dart'; -import 'package:shared_preferences/shared_preferences.dart'; - -import '../adapters/preference_adapter.dart'; - -/// A [Preference] is a single value associated with a key, which is persisted -/// using [SharedPreferences]. -/// -/// It is also a special type of [Stream] that emits a new value whenever the -/// value associated with [key] changes. You can use a [Preference] like you would -/// use any regular [Stream]. -/// -/// Whenever the backing value associated with [key] transitions from non-null to -/// null, it emits [defaultValue]. The [defaultValue] is also emitted if the value -/// is null when initially listening to the stream. -class Preference extends StreamView { - /// Only exposed for internal purposes. Do not call directly. - @visibleForTesting - Preference.$$_private(this._preferences, this._key, this.defaultValue, - this._adapter, this._keyChanges) - : super( - _keyChanges.stream.transform( - _EmitValueChanges(_key, defaultValue, _adapter, _preferences), - ), - ); - - /// Get the latest value from the persistent storage synchronously. - /// - /// If the returned value doesn't exist (=is null), returns [defaultValue]. - T getValue() => _adapter.getValue(_preferences, _key) ?? defaultValue; - - /// Update the value and notify all listeners about the new value. - /// - /// Returns true if the [value] was successfully set, otherwise returns false. - Future setValue(T value) async { - if (_key == null) { - /// This would not normally happen - it's a special case just for `getKeys()`. - /// - /// As `getKeys()` returns a Set which represents the keys for - /// currently stored values, its Preference will not have a key - therefore - /// the key will be null. This is "a bug, not a feature" - setting a value - /// for `getKeys()` would not make sense. - throw UnsupportedError( - 'setValue() not supported for Preference with a null key.', - ); - } - - return _updateAndNotify(_adapter.setValue(_preferences, _key, value)); - } - - /// Clear, or in other words, remove, the value. Effectively sets the [_key] - /// to a null value. After removing a value, the [Preference] will emit [defaultValue] - /// once. - /// - /// Returns true if the clear operation was successful, otherwise returns false. - Future clear() async { - if (_key == null) { - throw UnsupportedError( - 'clear() not supported for Preference with a null key.', - ); - } - - return _updateAndNotify(_preferences.remove(_key)); - } - - /// Invokes [fn] and captures the result, notifies all listeners about an - /// update to [_key], and then returns the previously captured result. - Future _updateAndNotify(Future fn) async { - final isSuccessful = await fn; - _keyChanges.add(_key); - - return isSuccessful; - } - - /// The fallback value to emit when there's no stored value associated - /// with the [key]. - final T defaultValue; - - // Private fields to not clutter autocompletion results for this class. - final SharedPreferences _preferences; - final String _key; - final PreferenceAdapter _adapter; - final StreamController _keyChanges; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is Preference && - runtimeType == other.runtimeType && - _key == other._key; - - @override - int get hashCode => _key.hashCode; -} - -/// A [StreamTransformer] that starts with the current persisted value and emits -/// a new one whenever the [key] has update events. -class _EmitValueChanges extends StreamTransformerBase { - _EmitValueChanges( - this.key, - this.defaultValue, - this.valueAdapter, - this.preferences, - ); - - final String key; - final T defaultValue; - final PreferenceAdapter valueAdapter; - final SharedPreferences preferences; - - T _getValueFromPersistentStorage() { - // Return the latest value from preferences, - // If null, returns the default value. - return valueAdapter.getValue(preferences, key) ?? defaultValue; - } - - @override - Stream bind(Stream stream) { - return StreamTransformer((input, cancelOnError) { - StreamController controller; - StreamSubscription subscription; - - controller = StreamController( - sync: true, - onListen: () { - // When the stream is listened to, start with the current persisted - // value. - final value = _getValueFromPersistentStorage(); - controller.add(value); - - // Cache the last value. Caching is specific for each listener, so the - // cached value exists inside the onListen() callback for a reason. - T lastValue = value; - - // Whenever a key has been updated, fetch the current persisted value - // and emit it. - subscription = input - .transform(_EmitOnlyMatchingKeys(key)) - .map((_) => _getValueFromPersistentStorage()) - .listen( - (value) { - if (value != lastValue) { - controller.add(value); - lastValue = value; - } - }, - onDone: () => controller.close(), - ); - }, - onPause: ([resumeSignal]) => subscription.pause(resumeSignal), - onResume: () => subscription.resume(), - onCancel: () => subscription.cancel(), - ); - - return controller.stream.listen(null); - }).bind(stream); - } -} - -/// A [StreamTransformer] that filters out values that don't match the [key]. -/// -/// One exception is when the [key] is null - in this case, returns the source -/// stream as is. One such case would be calling the `getKeys()` method on the -/// `StreamingSharedPreferences`, as in that case there's no specific [key]. -class _EmitOnlyMatchingKeys extends StreamTransformerBase { - _EmitOnlyMatchingKeys(this.key); - final String key; - - @override - Stream bind(Stream stream) { - if (key != null) { - // If key is non-null, emit only the changes that match the key. - // Otherwise, emit all changes. - return stream.where((changedKey) => changedKey == key); - } - - return stream; - } -} - -// ignore_for_file: non_constant_identifier_names diff --git a/lib/streaming_shared_preferences/lib/src/preference/preference_builder.dart b/lib/streaming_shared_preferences/lib/src/preference/preference_builder.dart deleted file mode 100644 index ccedcc3e9..000000000 --- a/lib/streaming_shared_preferences/lib/src/preference/preference_builder.dart +++ /dev/null @@ -1,109 +0,0 @@ -// 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 - -import 'dart:async'; - -import 'package:flutter/foundation.dart'; -import 'package:flutter/widgets.dart'; - -import '../preference/preference.dart'; - -/// A function that builds a widget whenever a [Preference] has a new value. -typedef PreferenceWidgetBuilder = Function(BuildContext context, T value); - -/// PreferenceBuilder is exactly like a [StreamBuilder] but without the need to -/// provide `initialData`. It also solves the initial flicker problem that happens -/// when a [StreamBuilder] transitions from its `initialData` to the values in -/// it `stream`. -/// -/// If the preference has a persisted non-null value, the initial build will be -/// done with that value. Otherwise the initial build will be done with the -/// `defaultValue` of the [preference]. -/// -/// If a [preference] emits a value identical to the last emitted value, [builder] -/// will not be called as it would be unnecessary to do so. -class PreferenceBuilder extends StatefulWidget { - PreferenceBuilder({ - @required this.preference, - @required this.builder, - }) : assert(preference != null, 'Preference must not be null.'), - assert(builder != null, 'PreferenceWidgetBuilder must not be null.'); - - /// The preference on which you want to react and rebuild your widgets based on. - final Preference preference; - - /// The function that builds a widget when a [preference] has new data. - final PreferenceWidgetBuilder builder; - - @override - _PreferenceBuilderState createState() => _PreferenceBuilderState(); -} - -class _PreferenceBuilderState extends State> { - T _initialData; - Stream _preference; - - @override - void initState() { - super.initState(); - _initialData = widget.preference.getValue(); - _preference = - widget.preference.transform(_EmitOnlyChangedValues(_initialData)); - } - - @override - Widget build(BuildContext context) { - return StreamBuilder( - initialData: _initialData, - stream: _preference, - builder: (context, snapshot) => widget.builder(context, snapshot.data), - ); - } -} - -/// Makes sure that [PreferenceBuilder] does not run its builder function if the -/// new value is identical to the last one. -class _EmitOnlyChangedValues extends StreamTransformerBase { - _EmitOnlyChangedValues(this.startValue); - final T startValue; - - @override - Stream bind(Stream stream) { - return StreamTransformer((input, cancelOnError) { - T lastValue = startValue; - - StreamController controller; - StreamSubscription subscription; - - controller = StreamController( - sync: true, - onListen: () { - subscription = input.listen( - (value) { - if (value != lastValue) { - controller.add(value); - lastValue = value; - } - }, - onError: controller.addError, - onDone: controller.close, - cancelOnError: cancelOnError, - ); - }, - onPause: ([resumeSignal]) => subscription.pause(resumeSignal), - onResume: () => subscription.resume(), - onCancel: () { - lastValue = null; - return subscription.cancel(); - }, - ); - - return controller.stream.listen(null); - }).bind(stream); - } -} diff --git a/lib/streaming_shared_preferences/lib/src/streaming_shared_preferences.dart b/lib/streaming_shared_preferences/lib/src/streaming_shared_preferences.dart deleted file mode 100755 index 20aa48987..000000000 --- a/lib/streaming_shared_preferences/lib/src/streaming_shared_preferences.dart +++ /dev/null @@ -1,317 +0,0 @@ -// 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 - -import 'dart:async'; - -import 'package:meta/meta.dart'; -import 'package:shared_preferences/shared_preferences.dart'; - -import 'adapters/adapters.dart'; -import 'preference/preference.dart'; - -/// StreamingSharedPreferences is like [SharedPreferences], but reactive. -/// -/// It wraps [SharedPreferences] with a Stream-based layer, allowing you to listen -/// to changes in the underlying values. -/// -/// Every `preferences.get(..)` method returns a [Preference] which is a [Stream]. -/// A [Preference] emits values whenever the underlying value updates. You can also -/// obtain the current value synchronously by calling `preferences.get(..).getValue()`. -/// -/// To set values, every [Preference] has a convenient `setValue()` method. You -/// can also call `preferences.set(..)` like you would do with normal [SharedPreferences]. -/// -/// While you can connect a [Preference] to your UI with a [StreamBuilder] widget, -/// it is recommended to use a [PreferenceBuilder], as that gets rid of the initial -/// flicker and you don't need to provide `initialData` parameter for it. -class StreamingSharedPreferences { - static Completer _instanceCompleter; - - /// Private constructor to prevent multiple instances. Creating multiple - /// instances of the class breaks change detection. - StreamingSharedPreferences._(this._preferences) - : _keyChanges = StreamController.broadcast(); - - final SharedPreferences _preferences; - final StreamController _keyChanges; - - /// Obtain an instance to [StreamingSharedPreferences]. - static Future get instance async { - if (_instanceCompleter == null) { - _instanceCompleter = Completer(); - - debugObtainSharedPreferencesInstance.then((preferences) { - final streamingPreferences = StreamingSharedPreferences._(preferences); - _instanceCompleter.complete(streamingPreferences); - }); - } - - return _instanceCompleter.future; - } - - /// Emits all the keys that currently exist - which means keys that have a - /// non-null value. - /// - /// Whenever there's a value associated for a new key, emits all the existing - /// keys along the newly added key. If a value for a specific key gets removed - /// (or set to null), emits a set of current keys without the recently removed - /// key. - /// - /// If there are no keys, emits an empty [Set]. - Preference> getKeys() { - return _getValue( - null, - defaultValue: Set(), - adapter: _GetKeysAdapter.instance, - ); - } - - /// Starts with the current bool value for the given [key], then emits a new - /// value every time there are changes to the value associated with [key]. - /// - /// If the value is null, starts with the value provided in [defaultValue]. When - /// the value transitions from non-null to null (ie. when the value is removed), - /// emits [defaultValue]. - Preference getBool(String key, {@required bool defaultValue}) { - return getCustomValue( - key, - defaultValue: defaultValue, - adapter: BoolAdapter.instance, - ); - } - - /// Starts with the current int value for the given [key], then emits a new - /// value every time there are changes to the value associated with [key]. - /// - /// If the value is null, starts with the value provided in [defaultValue]. When - /// the value transitions from non-null to null (ie. when the value is removed), - /// emits [defaultValue]. - Preference getInt(String key, {@required int defaultValue}) { - return getCustomValue( - key, - defaultValue: defaultValue, - adapter: IntAdapter.instance, - ); - } - - /// Starts with the current double value for the given [key], then emits a new - /// value every time there are changes to the value associated with [key]. - /// - /// If the value is null, starts with the value provided in [defaultValue]. When - /// the value transitions from non-null to null (ie. when the value is removed), - /// emits [defaultValue]. - Preference getDouble(String key, {@required double defaultValue}) { - return getCustomValue( - key, - defaultValue: defaultValue, - adapter: DoubleAdapter.instance, - ); - } - - /// Starts with the current String value for the given [key], then emits a new - /// value every time there are changes to the value associated with [key]. - /// - /// If the value is null, starts with the value provided in [defaultValue]. When - /// the value transitions from non-null to null (ie. when the value is removed), - /// emits [defaultValue]. - Preference getString(String key, {@required String defaultValue}) { - return getCustomValue( - key, - defaultValue: defaultValue, - adapter: StringAdapter.instance, - ); - } - - /// Starts with the current String list value for the given [key], then emits - /// a new value every time there are changes to the value associated with [key]. - /// - /// If the value is null, starts with the value provided in [defaultValue]. When - /// the value transitions from non-null to null (ie. when the value is removed), - /// emits [defaultValue]. - Preference> getStringList( - String key, { - @required List defaultValue, - }) { - return getCustomValue( - key, - defaultValue: defaultValue, - adapter: StringListAdapter.instance, - ); - } - - /// Creates a [Preference] with a custom type. Requires an implementation of - /// a [PreferenceAdapter]. - /// - /// Like all other "get()" methods, starts with a current value for the given - /// [key], then emits a new value every time there are changes to the value - /// associated with [key]. - /// - /// Uses an [adapter] for storing and retrieving the custom type from the - /// persistent storage. For an example of a custom adapter, see the source code - /// for [getString] and [StringAdapter]. - /// - /// If the value is null, starts with the value provided in [defaultValue]. When - /// the value transitions from non-null to null (ie. when the value is removed), - /// emits [defaultValue]. - Preference getCustomValue( - String key, { - @required T defaultValue, - @required PreferenceAdapter adapter, - }) { - assert(key != null, 'Preference key must not be null.'); - - return _getValue( - key, - defaultValue: defaultValue, - adapter: adapter, - ); - } - - /// Sets a bool value and notifies all active listeners that there's a new - /// value for the [key]. - /// - /// Returns true if a [value] was successfully set for the [key], otherwise - /// returns false. - Future setBool(String key, bool value) { - return setCustomValue(key, value, adapter: BoolAdapter.instance); - } - - /// Sets a int value and notifies all active listeners that there's a new - /// value for the [key]. - /// - /// Returns true if a [value] was successfully set for the [key], otherwise - /// returns false. - Future setInt(String key, int value) { - return setCustomValue(key, value, adapter: IntAdapter.instance); - } - - /// Sets a double value and notifies all active listeners that there's a new - /// value for the [key]. - /// - /// Returns true if a [value] was successfully set for the [key], otherwise - /// returns false. - Future setDouble(String key, double value) { - return setCustomValue(key, value, adapter: DoubleAdapter.instance); - } - - /// Sets a String value and notifies all active listeners that there's a new - /// value for the [key]. - /// - /// Returns true if a [value] was successfully set for the [key], otherwise - /// returns false. - Future setString(String key, String value) { - return setCustomValue(key, value, adapter: StringAdapter.instance); - } - - /// Sets a String list value and notifies all active listeners that there's a - /// new value for the [key]. - /// - /// Returns true if a [value] was successfully set for the [key], otherwise - /// returns false. - Future setStringList(String key, List values) { - return setCustomValue(key, values, adapter: StringListAdapter.instance); - } - - /// Sets a value of custom type [T] and notifies all active listeners that - /// there's a new value for the [key]. - /// - /// Requires an implementation of a [PreferenceAdapter] for the type [T]. For an - /// example of a custom adapter, see the source code for [setString] and - /// [StringAdapter]. - /// - /// Returns true if a [value] was successfully set for the [key], otherwise - /// returns false. - Future setCustomValue( - String key, - T value, { - @required PreferenceAdapter adapter, - }) { - assert(key != null, 'key must not be null.'); - assert(adapter != null, 'PreferenceAdapter must not be null.'); - - return _updateAndNotify(key, adapter.setValue(_preferences, key, value)); - } - - /// Removes the value associated with [key] and notifies all active listeners - /// that [key] was removed. When a key is removed, the listeners associated - /// with it will emit their `defaultValue` value. - /// - /// Returns true if [key] was successfully removed, otherwise returns false. - Future remove(String key) { - return _updateAndNotify(key, _preferences.remove(key)); - } - - /// Clears the entire key-value storage by removing all keys and values. - /// - /// Notifies all active listeners that their keys got removed, which in turn - /// makes them emit their respective `defaultValue` values. - Future clear() async { - final keys = _preferences.getKeys(); - final isSuccessful = await _preferences.clear(); - keys.forEach(_keyChanges.add); - - return isSuccessful; - } - - /// Invokes [fn] and captures the result, notifies all listeners about an - /// update to [key], and then returns the previously captured result. - Future _updateAndNotify(String key, Future fn) async { - final isSuccessful = await fn; - _keyChanges.add(key); - - return isSuccessful; - } - - Preference _getValue( - String key, { - @required T defaultValue, - @required PreferenceAdapter adapter, - }) { - assert(adapter != null, 'PreferenceAdapter must not be null.'); - assert(defaultValue != null, 'The default value must not be null.'); - - // ignore: invalid_use_of_visible_for_testing_member - return Preference.$$_private( - _preferences, - key, - defaultValue, - adapter, - _keyChanges, - ); - } -} - -/// A special [PreferenceAdapter] for getting all currently stored keys. Does not -/// support [set] operations. -class _GetKeysAdapter extends PreferenceAdapter> { - static const instance = _GetKeysAdapter._(); - const _GetKeysAdapter._(); - - @override - Set getValue(preferences, _) => preferences.getKeys(); - - @override - Future setValue(_, __, ___) => - throw UnsupportedError('SharedPreferences.setKeys() is not supported.'); -} - -/// Used for obtaining an instance of [SharedPreferences] by [StreamingSharedPreferences]. -/// -/// Should not be used outside of tests. -@visibleForTesting -Future debugObtainSharedPreferencesInstance = - SharedPreferences.getInstance(); - -/// Resets the singleton instance of [StreamingSharedPreferences] so that it can -/// be always tested from a clean slate. Only for testing purposes. -/// -/// Should not be used outside of tests. -@visibleForTesting -void debugResetStreamingSharedPreferencesInstance() { - StreamingSharedPreferences._instanceCompleter = null; -} diff --git a/lib/streaming_shared_preferences/lib/streaming_shared_preferences.dart b/lib/streaming_shared_preferences/lib/streaming_shared_preferences.dart deleted file mode 100755 index 389af7514..000000000 --- a/lib/streaming_shared_preferences/lib/streaming_shared_preferences.dart +++ /dev/null @@ -1,14 +0,0 @@ -// 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 streaming_shared_preferences; - -export 'src/adapters/adapters.dart'; -export 'src/preference/preference.dart'; -export 'src/preference/preference_builder.dart'; -export 'src/streaming_shared_preferences.dart'; diff --git a/lib/streaming_shared_preferences/pubspec.lock b/lib/streaming_shared_preferences/pubspec.lock deleted file mode 100755 index 3b8a76c00..000000000 --- a/lib/streaming_shared_preferences/pubspec.lock +++ /dev/null @@ -1,551 +0,0 @@ -# Generated by pub -# See https://dart.dev/tools/pub/glossary#lockfile -packages: - _fe_analyzer_shared: - dependency: transitive - description: - name: _fe_analyzer_shared - url: "https://pub.dartlang.org" - source: hosted - version: "27.0.0" - analyzer: - dependency: transitive - description: - name: analyzer - url: "https://pub.dartlang.org" - source: hosted - version: "2.4.0" - args: - dependency: transitive - description: - name: args - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.1" - async: - dependency: transitive - description: - name: async - url: "https://pub.dartlang.org" - source: hosted - version: "2.8.1" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - build: - dependency: transitive - description: - name: build - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.1" - built_collection: - dependency: transitive - description: - name: built_collection - url: "https://pub.dartlang.org" - source: hosted - version: "5.1.1" - built_value: - dependency: transitive - description: - name: built_value - url: "https://pub.dartlang.org" - source: hosted - version: "8.1.2" - characters: - dependency: transitive - description: - name: characters - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.1" - cli_util: - dependency: transitive - description: - name: cli_util - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.3" - clock: - dependency: transitive - description: - name: clock - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - code_builder: - dependency: transitive - description: - name: code_builder - url: "https://pub.dartlang.org" - source: hosted - version: "4.1.0" - collection: - dependency: transitive - description: - name: collection - url: "https://pub.dartlang.org" - source: hosted - version: "1.15.0" - convert: - dependency: transitive - description: - name: convert - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.1" - coverage: - dependency: transitive - description: - name: coverage - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.3" - crypto: - dependency: transitive - description: - name: crypto - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.1" - dart_style: - dependency: transitive - description: - name: dart_style - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.0" - fake_async: - dependency: transitive - description: - name: fake_async - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - ffi: - dependency: transitive - description: - name: ffi - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.2" - file: - dependency: transitive - description: - name: file - url: "https://pub.dartlang.org" - source: hosted - version: "6.1.2" - fixnum: - dependency: transitive - description: - name: fixnum - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0" - flutter: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - flutter_test: - dependency: "direct dev" - description: flutter - source: sdk - version: "0.0.0" - flutter_web_plugins: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" - frontend_server_client: - dependency: transitive - description: - name: frontend_server_client - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.2" - glob: - dependency: transitive - description: - name: glob - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1" - http_multi_server: - dependency: transitive - description: - name: http_multi_server - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.1" - http_parser: - dependency: transitive - description: - name: http_parser - url: "https://pub.dartlang.org" - source: hosted - version: "4.0.0" - io: - dependency: transitive - description: - name: io - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.3" - js: - dependency: transitive - description: - name: js - url: "https://pub.dartlang.org" - source: hosted - version: "0.6.3" - logging: - dependency: transitive - description: - name: logging - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.1" - matcher: - dependency: transitive - description: - name: matcher - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.10" - meta: - dependency: "direct main" - description: - name: meta - url: "https://pub.dartlang.org" - source: hosted - version: "1.7.0" - mime: - dependency: transitive - description: - name: mime - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0" - mockito: - dependency: "direct dev" - description: - name: mockito - url: "https://pub.dartlang.org" - source: hosted - version: "5.0.16" - node_preamble: - dependency: transitive - description: - name: node_preamble - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1" - package_config: - dependency: transitive - description: - name: package_config - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - path: - dependency: transitive - description: - name: path - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.0" - path_provider_linux: - dependency: transitive - description: - name: path_provider_linux - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - path_provider_platform_interface: - dependency: transitive - description: - name: path_provider_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1" - path_provider_windows: - dependency: transitive - description: - name: path_provider_windows - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1" - pedantic: - dependency: transitive - description: - name: pedantic - url: "https://pub.dartlang.org" - source: hosted - version: "1.11.1" - platform: - dependency: transitive - description: - name: platform - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.0" - plugin_platform_interface: - dependency: transitive - description: - name: plugin_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1" - pool: - dependency: transitive - description: - name: pool - url: "https://pub.dartlang.org" - source: hosted - version: "1.5.0" - process: - dependency: transitive - description: - name: process - url: "https://pub.dartlang.org" - source: hosted - version: "4.2.1" - pub_semver: - dependency: transitive - description: - name: pub_semver - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - shared_preferences: - dependency: "direct main" - description: - name: shared_preferences - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.6" - shared_preferences_linux: - dependency: transitive - description: - name: shared_preferences_linux - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - shared_preferences_macos: - dependency: transitive - description: - name: shared_preferences_macos - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - shared_preferences_platform_interface: - dependency: transitive - description: - name: shared_preferences_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - shared_preferences_web: - dependency: transitive - description: - name: shared_preferences_web - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - shared_preferences_windows: - dependency: transitive - description: - name: shared_preferences_windows - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - shelf: - dependency: transitive - description: - name: shelf - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - shelf_packages_handler: - dependency: transitive - description: - name: shelf_packages_handler - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.0" - shelf_static: - dependency: transitive - description: - name: shelf_static - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - shelf_web_socket: - dependency: transitive - description: - name: shelf_web_socket - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.1" - sky_engine: - dependency: transitive - description: flutter - source: sdk - version: "0.0.99" - source_gen: - dependency: transitive - description: - name: source_gen - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.1" - source_map_stack_trace: - dependency: transitive - description: - name: source_map_stack_trace - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - source_maps: - dependency: transitive - description: - name: source_maps - url: "https://pub.dartlang.org" - source: hosted - version: "0.10.10" - source_span: - dependency: transitive - description: - name: source_span - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.1" - stack_trace: - dependency: transitive - description: - name: stack_trace - url: "https://pub.dartlang.org" - source: hosted - version: "1.10.0" - stream_channel: - dependency: transitive - description: - name: stream_channel - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - string_scanner: - dependency: transitive - description: - name: string_scanner - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - term_glyph: - dependency: transitive - description: - name: term_glyph - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - test: - dependency: "direct dev" - description: - name: test - url: "https://pub.dartlang.org" - source: hosted - version: "1.17.10" - test_api: - dependency: transitive - description: - name: test_api - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.2" - test_core: - dependency: transitive - description: - name: test_core - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.0" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" - vector_math: - dependency: transitive - description: - name: vector_math - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - vm_service: - dependency: transitive - description: - name: vm_service - url: "https://pub.dartlang.org" - source: hosted - version: "6.2.0" - watcher: - dependency: transitive - description: - name: watcher - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0" - web_socket_channel: - dependency: transitive - description: - name: web_socket_channel - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - webkit_inspection_protocol: - dependency: transitive - description: - name: webkit_inspection_protocol - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0" - win32: - dependency: transitive - description: - name: win32 - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.5" - xdg_directories: - dependency: transitive - description: - name: xdg_directories - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0" - yaml: - dependency: transitive - description: - name: yaml - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.0" -sdks: - dart: ">=2.14.0 <3.0.0" - flutter: ">=1.20.0" diff --git a/lib/streaming_shared_preferences/pubspec.yaml b/lib/streaming_shared_preferences/pubspec.yaml deleted file mode 100755 index d0fe38ae5..000000000 --- a/lib/streaming_shared_preferences/pubspec.yaml +++ /dev/null @@ -1,27 +0,0 @@ -# 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: streaming_shared_preferences -description: A stream based wrapper over shared_preferences, allowing reactive key-value storage. -version: 1.0.1 -publish_to: none - -environment: - sdk: ">=2.10.0 <3.0.0" - -dependencies: - flutter: - sdk: flutter - shared_preferences: ^2.0.5 - meta: ^1.1.8 - -dev_dependencies: - flutter_test: - sdk: flutter - test: any - mockito: ^5.0.7 \ No newline at end of file diff --git a/lib/streaming_shared_preferences/test/adapters/datetime_adapter_test.dart b/lib/streaming_shared_preferences/test/adapters/datetime_adapter_test.dart deleted file mode 100755 index 4482d963e..000000000 --- a/lib/streaming_shared_preferences/test/adapters/datetime_adapter_test.dart +++ /dev/null @@ -1,67 +0,0 @@ -// 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 - -import 'package:mockito/mockito.dart'; -import 'package:shared_preferences/shared_preferences.dart'; -import 'package:streaming_shared_preferences/streaming_shared_preferences.dart'; -import 'package:test/test.dart'; - -class MockSharedPreferences extends Mock implements SharedPreferences {} - -void main() { - group('DateTimeAdapter', () { - MockSharedPreferences preferences; - - setUp(() { - preferences = MockSharedPreferences(); - }); - - const adapter = DateTimeAdapter.instance; - final dateTime = DateTime(2019, 01, 02, 03, 04, 05, 99).toUtc(); - - test('can persist date times properly', () { - adapter.setValue(preferences, 'key', dateTime); - - /// Comparing to a exact millisecond timestamp runs just fine on a local - /// machine, but fails in CI because of differences in geographic regions. - /// - /// For that reason, this test is a little fuzzy. - final String value = - verify(preferences.setString('key', captureAny)).captured.single; - expect(value, isNotNull); - expect(value.length, 13); - }); - - test('can revive date times properly', () { - when(preferences.getString('key')).thenReturn('1546394645099'); - - /// Comparing to a exact millisecond timestamp runs just fine on a local - /// machine, but fails in CI because of differences in geographic regions. - /// - /// For that reason, this test is a little fuzzy. - final storedDateTime = adapter.getValue(preferences, 'key'); - expect( - storedDateTime.difference(dateTime) < - const Duration(hours: 1, minutes: 1), - isTrue, - ); - }); - - test('handles retrieving null datetimes gracefully', () { - when(preferences.getString('key')).thenReturn(null); - - final storedDateTime = adapter.getValue(preferences, 'key'); - expect(storedDateTime, isNull); - }); - - test('handles persisting null datetimes gracefully', () { - adapter.setValue(preferences, 'key', null); - verify(preferences.setString('key', null)); - }); - }); -} diff --git a/lib/streaming_shared_preferences/test/adapters/json_adapter_test.dart b/lib/streaming_shared_preferences/test/adapters/json_adapter_test.dart deleted file mode 100755 index c14ec4345..000000000 --- a/lib/streaming_shared_preferences/test/adapters/json_adapter_test.dart +++ /dev/null @@ -1,95 +0,0 @@ -// 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 - -import 'package:mockito/mockito.dart'; -import 'package:shared_preferences/shared_preferences.dart'; -import 'package:streaming_shared_preferences/streaming_shared_preferences.dart'; -import 'package:test/test.dart'; - -class MockSharedPreferences extends Mock implements SharedPreferences {} - -void main() { - group('ValueAdapter tests', () { - MockSharedPreferences preferences; - - setUp(() { - preferences = MockSharedPreferences(); - }); - - group('JsonAdapter', () { - test('fails gracefully when getting a null value', () { - when(preferences.getString('key')).thenReturn(null); - - final adapter = JsonAdapter(); - final json = adapter.getValue(preferences, 'key'); - - expect(json, isNull); - }); - - test('decodes a stored JSON value into a Map', () { - when(preferences.getString('key')).thenReturn('{"hello":"world"}'); - - final adapter = JsonAdapter(); - final json = adapter.getValue(preferences, 'key'); - - expect(json, {'hello': 'world'}); - }); - - test('decodes a stored JSON value into a List', () { - when(preferences.getString('key')).thenReturn('["hello","world"]'); - - final adapter = JsonAdapter(); - final json = adapter.getValue(preferences, 'key'); - - expect(json, ['hello', 'world']); - }); - - test('stores an object that implements a toJson() method', () { - final adapter = JsonAdapter(); - adapter.setValue(preferences, 'key', TestObject('world')); - - verify(preferences.setString('key', '{"hello":"world"}')); - }); - - test('runs decoded json through deserializer when provided', () { - when(preferences.getString('key')).thenReturn('{"hello":"world"}'); - - final adapter = JsonAdapter( - deserializer: (v) => TestObject.fromJson(v), - ); - - final testObject = adapter.getValue(preferences, 'key'); - expect(testObject.hello, 'world'); - }); - - test('runs object through serializer when provided', () { - final adapter = JsonAdapter( - serializer: (v) => {'encoded': 'value'}, - ); - - // What value we set here doesn't matter - we're testing that it's replaced - // by the value returned by serializer. - adapter.setValue(preferences, 'key', null); - verify(preferences.setString('key', '{"encoded":"value"}')); - }); - }); - }); -} - -class TestObject { - TestObject(this.hello); - final String hello; - - TestObject.fromJson(Map json) : hello = json['hello']; - - Map toJson() { - return { - 'hello': 'world', - }; - } -} diff --git a/lib/streaming_shared_preferences/test/preference/preference_builder_test.dart b/lib/streaming_shared_preferences/test/preference/preference_builder_test.dart deleted file mode 100644 index 594f85bc3..000000000 --- a/lib/streaming_shared_preferences/test/preference/preference_builder_test.dart +++ /dev/null @@ -1,160 +0,0 @@ -// 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 - -import 'dart:async'; - -import 'package:flutter/widgets.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:mockito/mockito.dart'; -import 'package:shared_preferences/shared_preferences.dart'; -import 'package:streaming_shared_preferences/streaming_shared_preferences.dart'; - -class MockSharedPreferences extends Mock implements SharedPreferences {} - -void main() { - group('PreferenceBuilder', () { - MockSharedPreferences preferences; - StreamController keyChanges; - TestPreference preference; - - setUp(() { - preferences = MockSharedPreferences(); - keyChanges = StreamController(); - preference = TestPreference(preferences, keyChanges); - }); - - test('passing null Preference throws an error', () { - expect( - () => PreferenceBuilder(preference: null, builder: (_, __) => null), - throwsA(isInstanceOf()), - ); - }); - - test('passing null PreferenceWidgetBuilder throws an error', () { - expect( - () => PreferenceBuilder(preference: preference, builder: null), - throwsA(isInstanceOf()), - ); - }); - - testWidgets('initial build is done with current value of the preference', - (tester) async { - when(preferences.getString('test')).thenReturn('current value'); - - await tester.pumpWidget( - PreferenceBuilder( - preference: preference, - builder: (context, value) { - return Text(value, textDirection: TextDirection.ltr); - }, - ), - ); - - expect(find.text('current value'), findsOneWidget); - }); - - testWidgets( - 'if current value is null, uses default value for initial build', - (tester) async { - await tester.pumpWidget( - PreferenceBuilder( - preference: preference, - builder: (context, value) { - return Text(value, textDirection: TextDirection.ltr); - }, - ), - ); - - expect(find.text('default value'), findsOneWidget); - }); - - testWidgets('rebuilds when there is a new value in the Preference stream', - (tester) async { - await tester.pumpWidget( - PreferenceBuilder( - preference: preference, - builder: (context, value) { - return Text(value, textDirection: TextDirection.ltr); - }, - ), - ); - - expect(find.text('default value'), findsOneWidget); - - // Whenever a String with key "test" is retrieved the next time, return - // the text "updated value". - when(preferences.getString('test')).thenReturn('updated value'); - - // Value does not matter in a test case as the preferences are mocked. - // This just tells the preference that something was updated. - preference.setValue(null); - await tester.pump(); - await tester.pump(); - expect(find.text('updated value'), findsOneWidget); - - when(preferences.getString('test')).thenReturn('another value'); - preference.setValue(null); - await tester.pump(); - await tester.pump(); - expect(find.text('another value'), findsOneWidget); - }); - - testWidgets( - 'does not rebuild if latest value used for build is identical to new one', - (tester) async { - int buildCount = 0; - - await tester.pumpWidget( - PreferenceBuilder( - preference: preference, - builder: (context, value) { - buildCount++; - return Text(value, textDirection: TextDirection.ltr); - }, - ), - ); - - preference.setValue(null); - await tester.pump(); - await tester.pump(); - - preference.setValue(null); - await tester.pump(); - await tester.pump(); - - preference.setValue(null); - await tester.pump(); - await tester.pump(); - - expect(buildCount, 1); - - // So that there's no accidental lockdown because of duplicate values - when(preferences.getString('test')).thenReturn('new value'); - preference.setValue(null); - await tester.pump(); - await tester.pump(); - expect(find.text('new value'), findsOneWidget); - - expect(buildCount, 2); - }); - }); -} - -class TestPreference extends Preference { - // ignore: non_constant_identifier_names - TestPreference( - SharedPreferences preferences, - StreamController keyChanges, - ) : super.$$_private( - preferences, - 'test', - 'default value', - StringAdapter.instance, - keyChanges, - ); -} diff --git a/lib/streaming_shared_preferences/test/preference/preference_test.dart b/lib/streaming_shared_preferences/test/preference/preference_test.dart deleted file mode 100755 index 5a411e034..000000000 --- a/lib/streaming_shared_preferences/test/preference/preference_test.dart +++ /dev/null @@ -1,159 +0,0 @@ -// 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 - -import 'dart:async'; - -import 'package:mockito/mockito.dart'; -import 'package:shared_preferences/shared_preferences.dart'; -import 'package:streaming_shared_preferences/src/preference/preference.dart'; -import 'package:streaming_shared_preferences/streaming_shared_preferences.dart'; -import 'package:test/test.dart'; - -class MockSharedPreferences extends Mock implements SharedPreferences {} - -void main() { - group('Preference', () { - MockSharedPreferences preferences; - _TestValueAdapter adapter; - StreamController keyChanges; - Preference preference; - - setUp(() { - preferences = MockSharedPreferences(); - adapter = _TestValueAdapter(); - keyChanges = StreamController.broadcast(); - - // ignore: deprecated_member_use_from_same_package - preference = Preference.$$_private( - preferences, - 'key', - 'default value', - adapter, - keyChanges, - ); - }); - - Future _updateValue(String newValue) async { - when(preferences.getString('key')).thenReturn(newValue); - - // The value passed to setValue does not matter in tests - it just merely - // tells the preference that something just changed. - await preference.setValue(null); - } - - test('calling setValue() calls the correct key and emits key updates', () { - preference.setValue('value1'); - preference.setValue('value2'); - preference.setValue('value3'); - - verifyInOrder([ - preferences.setString('key', 'value1'), - preferences.setString('key', 'value2'), - preferences.setString('key', 'value3'), - ]); - - expect(keyChanges.stream, emitsInOrder(['key', 'key', 'key'])); - }); - - test('calling clear() calls delegate and removes key', () async { - preference.clear(); - - verify(preferences.remove('key')); - - expect(keyChanges.stream, emits('key')); - }); - - test('calling setValue() or clear() on a Preference with null key throws', - () { - final pref = - Preference.$$_private(preferences, null, '', adapter, keyChanges); - - expect(pref.clear, throwsA(const TypeMatcher())); - expect( - () => pref.setValue(''), - throwsA(const TypeMatcher()), - ); - }); - - test('starts with the latest value whenever listened to', () { - when(preferences.getString('key')).thenReturn('1'); - expect(preference, emits('1')); - - when(preferences.getString('key')).thenReturn('2'); - expect(preference, emits('2')); - - when(preferences.getString('key')).thenReturn('3'); - expect(preference, emits('3')); - }); - - test('does not emit same value more than once in a row for one listener', - () async { - int updateCount = 0; - preference.listen((_) => updateCount++); - - await _updateValue('new value'); - await _updateValue('new value'); - await _updateValue('new value'); - - // Changed from "default value" to "new value" - expect(updateCount, 2); - - await _updateValue('another value 1'); - await _updateValue('another value 2'); - await _updateValue('another value 3'); - - // Changed from "new value" to "another value" 3 times - expect(updateCount, 5); - }); - - /// There was a bug where reusing a Preference between multiple listeners - /// only propagated the change to the first one. This test is here to prevent - /// that from happening again. - /// - /// For more context, see: https://github.com/roughike/streaming_shared_preferences/pull/1 - test('emits each value change to all listeners', () async { - String value1; - String value2; - String value3; - - preference.listen((value) => value1 = value); - preference.listen((value) => value2 = value); - preference.listen((value) => value3 = value); - - await _updateValue(null); - - expect(value1, 'default value'); - expect(value2, 'default value'); - expect(value3, 'default value'); - - await _updateValue('first change'); - - expect(value1, 'first change'); - expect(value2, 'first change'); - expect(value3, 'first change'); - - await _updateValue('second change'); - - expect(value1, 'second change'); - expect(value2, 'second change'); - expect(value3, 'second change'); - }); - }); -} - -class _TestValueAdapter extends PreferenceAdapter { - @override - String getValue(preferences, key) { - return preferences.getString(key); - } - - @override - Future setValue(keyValueStore, key, value) { - return keyValueStore.setString(key, value); - } -} diff --git a/lib/streaming_shared_preferences/test/preference/stream_builder_and_equality_tests.dart b/lib/streaming_shared_preferences/test/preference/stream_builder_and_equality_tests.dart deleted file mode 100644 index aa2d13d7b..000000000 --- a/lib/streaming_shared_preferences/test/preference/stream_builder_and_equality_tests.dart +++ /dev/null @@ -1,118 +0,0 @@ -// 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 - -import 'dart:async'; - -import 'package:flutter/widgets.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:mockito/mockito.dart'; -import 'package:shared_preferences/shared_preferences.dart'; -import 'package:streaming_shared_preferences/streaming_shared_preferences.dart'; - -class MockSharedPreferences extends Mock implements SharedPreferences {} - -/// These tests make sure that that an identical Preference doesn't accidentally -/// cause refetching an unchanged value from persistent storage when using a -/// StreamBuilder widget and when the state of the parent widget is rebuilt. -/// -/// Whenever the parent of a StreamBuilder widget is rebuilt, it causes the StreamBuilder -/// widget to check if the previous Stream and the new Stream are equal. If they -/// are not, StreamBuilder will unsubscribe from the previous Stream and subscribe -/// to a new one. -/// -/// The problem is that if a Preference does not implement equals and hashCode, a -/// seemingly equal Preference will be considered as a completely new one by the -/// StreamBuilder widget. And since a Preference will fetch the latest value from -/// persistent storage once every time it's listened to, and a StreamBuilder will -/// always unsubscribe and listen on not equal Streams, every rebuild of the parent -/// widget would result in fetching a value from persistent storage. And that's not -/// good. -void main() { - group('StreamBuilder and equality tests', () { - MockSharedPreferences preferences; - StreamController keyChanges; - - setUp(() { - preferences = MockSharedPreferences(); - keyChanges = StreamController(); - }); - - test('preferences with the same key and type are equal', () { - expect( - TestPreference('test', preferences, keyChanges), - TestPreference('test', preferences, keyChanges), - ); - }); - - test('preferences with same key but different type are not equal', () { - final first = Preference.$$_private( - preferences, - 'test', - 'default value', - StringAdapter.instance, - keyChanges, - ); - - final second = Preference.$$_private( - preferences, - 'test', - 0, - IntAdapter.instance, - keyChanges, - ); - - expect(first, isNot(equals(second))); - }); - - testWidgets( - 'should listen to the same preference only once even across rebuilds', - (tester) async { - await tester.pumpWidget( - StatefulBuilder( - builder: (_, stateSetter) { - return StreamBuilder( - stream: TestPreference('test', preferences, keyChanges), - builder: (_, snapshot) { - return GestureDetector( - onTap: () => stateSetter(() {}), - child: Text('X', textDirection: TextDirection.ltr), - ); - }, - ); - }, - ), - ); - - await tester.tap(find.text('X')); - await tester.pump(); - - await tester.tap(find.text('X')); - await tester.pump(); - - await tester.tap(find.text('X')); - await tester.pump(); - - verify(preferences.getString('test')).called(1); - }); - }); -} - -class TestPreference extends Preference { - // ignore: non_constant_identifier_names - TestPreference( - String key, - SharedPreferences preferences, - StreamController keyChanges, - ) : super.$$_private( - preferences, - key, - 'default value', - StringAdapter.instance, - keyChanges, - ); -} diff --git a/lib/streaming_shared_preferences/test/streaming_shared_preferences_test.dart b/lib/streaming_shared_preferences/test/streaming_shared_preferences_test.dart deleted file mode 100755 index 06fb725d7..000000000 --- a/lib/streaming_shared_preferences/test/streaming_shared_preferences_test.dart +++ /dev/null @@ -1,843 +0,0 @@ -// 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 - -import 'dart:async'; - -import 'package:flutter/services.dart'; -import 'package:flutter_test/flutter_test.dart' show TestWidgetsFlutterBinding; -import 'package:mockito/mockito.dart'; -import 'package:shared_preferences/shared_preferences.dart'; -import 'package:streaming_shared_preferences/streaming_shared_preferences.dart'; -import 'package:test/test.dart'; - -class MockSharedPreferences extends Mock implements SharedPreferences {} - -void main() { - TestWidgetsFlutterBinding.ensureInitialized(); - group('StreamingKeyValueStore', () { - MockSharedPreferences delegate; - StreamingSharedPreferences preferences; - - setUpAll(() async { - // SharedPreferences calls "getAll" through a method channel initially when - // creating an instance of it. - // - // This will crash in tests by default, so this is a minimal glue code to - // make sure that we can run the test below without crashes. - const channel = MethodChannel('plugins.flutter.io/shared_preferences'); - channel.setMethodCallHandler((call) async { - return call.method == 'getAll' ? {} : null; - }); - - // [debugObtainSharedPreferencesInstance] should be non-null and return - // a [Future] that completes with an instance of SharedPreferences. - // - // Otherwise tests might run just fine, but we can't be sure that the - // instance obtainer is not broken in production. - final instance = await debugObtainSharedPreferencesInstance; - expect(debugObtainSharedPreferencesInstance, isNotNull); - expect(instance, const TypeMatcher()); - }); - - setUp(() async { - delegate = MockSharedPreferences(); - - // Swap the instance obtainer with one that always returns a mocked version - // of shared preferences. - debugObtainSharedPreferencesInstance = Future.value(delegate); - preferences = await StreamingSharedPreferences.instance; - }); - - tearDown(() { - debugResetStreamingSharedPreferencesInstance(); - }); - - test('obtaining instance calls delegate only once', () async { - var obtainCount = 0; - - // Need to reset the instance as the singleton was already obtained in - // the [setUp] method in tests. - debugResetStreamingSharedPreferencesInstance(); - - // Swap the instance obtainer to a spying one that increases the counter - // whenever it's called. - debugObtainSharedPreferencesInstance = Future(() { - obtainCount++; - return MockSharedPreferences(); - }); - - await StreamingSharedPreferences.instance; - await StreamingSharedPreferences.instance; - await StreamingSharedPreferences.instance; - - expect(obtainCount, 1); - }); - - test('forwards all method invocations and parameters to the delegate', - () async { - preferences.getKeys().listen(null); - preferences.getBool('boolKey', defaultValue: false).listen(null); - preferences.getInt('intKey', defaultValue: 0).listen(null); - preferences.getDouble('doubleKey', defaultValue: 0).listen(null); - preferences.getString('stringKey', defaultValue: '').listen(null); - preferences.getStringList('stringListKey', defaultValue: []).listen(null); - - preferences.setBool('boolKey', true); - preferences.setInt('intKey', 1337); - preferences.setDouble('doubleKey', 13.37); - preferences.setString('stringKey', 'stringValue'); - preferences.setStringList('stringListKey', ['stringListValue']); - - preferences.remove('removeKey'); - - // Calling clear() calls delegate.getKeys() - so we must return a non-null - // value here. - when(delegate.getKeys()).thenReturn(Set()); - preferences.clear(); - - verifyInOrder([ - // Getters - delegate.getKeys(), - delegate.getBool('boolKey'), - delegate.getInt('intKey'), - delegate.getDouble('doubleKey'), - delegate.getString('stringKey'), - delegate.getStringList('stringListKey'), - - // Setters - delegate.setBool('boolKey', true), - delegate.setInt('intKey', 1337), - delegate.setDouble('doubleKey', 13.37), - delegate.setString('stringKey', 'stringValue'), - delegate.setStringList('stringListKey', ['stringListValue']), - - // Other - delegate.remove('removeKey'), - - // Calling clear() should first get the keys and then call clear() on - // the delegate. calling getKeys() after clear() returns an empty set - // of keys, so it would not notify about the deleted keys properly. - delegate.getKeys(), - delegate.clear(), - ]); - - verifyNoMoreInteractions(delegate); - }); - - test('settable values should be... settable', () { - // These invocations make sure that a ".setValue(..)" method exists and is - // accessible for all these getters. If the test doesn't crash, it's considered - // a passing test. - preferences.getBool('key', defaultValue: false).setValue(true); - preferences.getInt('key', defaultValue: 0).setValue(1); - preferences.getDouble('key', defaultValue: 0).setValue(1); - preferences.getString('key', defaultValue: '').setValue(''); - preferences.getStringList('key', defaultValue: []).setValue(['a']); - - // Casting "getKeys()" to dynamic and trying to call ".setValue(..)" on it should - // throw an error. - expect( - () => (preferences.getKeys() as dynamic).setValue(null), - throwsA(const TypeMatcher()), - ); - }); - - group('getKeys() tests', () { - test('getKeys() - can listen to multiple times', () { - when(delegate.getKeys()).thenReturn(Set.from(['first', 'second'])); - final stream = preferences.getKeys(); - - // If this doesn't crash the test, the test is considered a passing test. - stream.listen((_) {}); - stream.listen((_) {}); - stream.listen((_) {}); - }); - - test('when keys are null or empty, emits an empty set', () async { - when(delegate.getKeys()).thenReturn(null); - await expectLater(preferences.getKeys(), emits(Set())); - - when(delegate.getKeys()).thenReturn(Set()); - expect(preferences.getKeys(), emits(Set())); - }); - - test('initial values', () { - when(delegate.getKeys()).thenReturn(Set.from(['first', 'second'])); - expect(preferences.getKeys(), emits(Set.from(['first', 'second']))); - }); - - test('getKeys().getValue() - initial values', () { - when(delegate.getKeys()).thenReturn(Set.from(['first', 'second'])); - expect(preferences.getKeys(), emits(Set.from(['first', 'second']))); - }); - - test('setting a value emits latest keys in the stream', () async { - final keys = preferences.getKeys(); - var count = 0; - - /// This might seem wonky, but it is actually testing the relevant use - /// case. Every time a "setXYZ()" is called, we should fetch keys using - /// delegate.getKey() and then emit them. Although what delegate.getKeys() - /// returns doesn't matter in a test case, we're returning what would be - /// returned in a real scenario so that it's easier to follow. - // ignore:missing_return - when(delegate.getKeys()).thenAnswer((_) { - count++; - - switch (count) { - case 1: - return Set.from(['key1']); - case 2: - return Set.from(['key1', 'key2']); - case 3: - return Set.from(['key1', 'key2', 'key3']); - case 4: - return Set.from(['key1', 'key2', 'key3', 'key4']); - case 5: - return Set.from(['key1', 'key2', 'key3', 'key4', 'key5']); - case 6: - return Set.from(['key1', 'key2', 'key3', 'key4', 'key5', 'key6']); - } - }); - - preferences.setBool('key1', true); - preferences.setInt('key2', 2); - preferences.setDouble('key3', 3.0); - preferences.setString('key4', 'value4'); - preferences.setStringList('key5', ['value5']); - preferences.setCustomValue('key6', '', adapter: StringAdapter.instance); - - expect( - keys, - emitsInOrder([ - // setting a bool - Set.from(['key1']), - - // setting an int - Set.from(['key1', 'key2']), - - // setting a double - Set.from(['key1', 'key2', 'key3']), - - // setting a String - Set.from(['key1', 'key2', 'key3', 'key4']), - - // setting a String list - Set.from(['key1', 'key2', 'key3', 'key4', 'key5']), - - // setting a custom value - Set.from(['key1', 'key2', 'key3', 'key4', 'key5', 'key6']), - ]), - ); - }); - - test( - 'calling .getValue() has a different result after setting values', - () async { - final keys = preferences.getKeys(); - var count = 0; - - /// This might seem wonky, but it is actually testing the relevant use - /// case. Every time a "setXYZ()" is called, we should fetch keys using - /// delegate.getKey() and then emit them. Although what delegate.getKeys() - /// returns doesn't matter in a test case, we're returning what would be - /// returned in a real scenario so that it's easier to follow. - // ignore:missing_return - when(delegate.getKeys()).thenAnswer((_) { - count++; - - switch (count) { - case 1: - return Set.from(['key1']); - case 2: - return Set.from(['key1', 'key2']); - case 3: - return Set.from(['key1', 'key2', 'key3']); - case 4: - return Set.from(['key1', 'key2', 'key3', 'key4']); - case 5: - return Set.from(['key1', 'key2', 'key3', 'key4', 'key5']); - } - }); - - preferences.setBool('key1', true); - expect(keys.getValue(), Set.from(['key1'])); - - preferences.setInt('key2', 2); - expect(keys.getValue(), Set.from(['key1', 'key2'])); - - preferences.setDouble('key3', 3.0); - expect(keys.getValue(), Set.from(['key1', 'key2', 'key3'])); - - preferences.setString('key4', 'value4'); - expect(keys.getValue(), Set.from(['key1', 'key2', 'key3', 'key4'])); - - preferences.setStringList('key5', ['value5']); - expect( - keys.getValue(), - Set.from(['key1', 'key2', 'key3', 'key4', 'key5']), - ); - }, - ); - - test('trying to call setValue() on getKeys() throws an error', () { - expect( - () => preferences.getKeys().setValue(Set()), - throwsA(const TypeMatcher()), - ); - }); - }); - - group('boolean tests', () { - setUp(() { - when(delegate.getBool('myTrueBool')).thenReturn(true); - when(delegate.getBool('myFalseBool')).thenReturn(false); - when(delegate.getBool('myNullBool')).thenReturn(null); - }); - - test('getBool() - can listen to multiple times', () { - final stream = preferences.getBool('myTrueBool', defaultValue: false); - - // If this doesn't crash the test, the test is considered a passing test. - stream.listen((_) {}); - stream.listen((_) {}); - stream.listen((_) {}); - }); - - test('getBool().stream() - initial values', () { - expect( - preferences.getBool('myTrueBool', defaultValue: false), - emits(true), - ); - - expect( - preferences.getBool('myFalseBool', defaultValue: true), - emits(false), - ); - - expect( - preferences.getBool('myNullBool', defaultValue: true), - emits(true), - ); - - expect( - preferences.getBool('myNullBool', defaultValue: false), - emits(false), - ); - }); - - test('getBool().getValue() - initial values', () { - expect( - preferences.getBool('myTrueBool', defaultValue: false).getValue(), - true, - ); - - expect( - preferences.getBool('myFalseBool', defaultValue: true).getValue(), - false, - ); - - expect( - preferences.getBool('myNullBool', defaultValue: true).getValue(), - true, - ); - - expect( - preferences.getBool('myNullBool', defaultValue: false).getValue(), - false, - ); - }); - - test('getBool().getValue()', () async { - final storedBool = preferences.getBool('key1', defaultValue: false); - expect(storedBool.getValue(), isFalse); - - when(delegate.getBool('key1')).thenReturn(true); - expect(storedBool.getValue(), isTrue); - - when(delegate.getBool('key1')).thenReturn(false); - expect( - preferences.getBool('key1', defaultValue: true).getValue(), - isFalse, - ); - - when(delegate.getBool('key1')).thenReturn(null); - expect( - preferences.getBool('key1', defaultValue: true).getValue(), - isTrue, - ); - - expect( - preferences.getBool('key1', defaultValue: false).getValue(), - isFalse, - ); - }); - - test('setBool emits an update in getBool', () async { - final storedBool = preferences.getBool('key1', defaultValue: false); - - scheduleMicrotask(() { - when(delegate.getBool('key1')).thenReturn(true); - - // Setting value to null won't matter here as the delegate is just a mock. - // What we're interested instead is triggering an update in the changed - // keys stream. - preferences.setBool('key1', null); - }); - - await expectLater(storedBool, emitsInOrder([false, true])); - }); - }); - - group('int tests', () { - setUp(() { - when(delegate.getInt('myInt')).thenReturn(1337); - when(delegate.getInt('myNullInt')).thenReturn(null); - }); - - test('getInt() - can listen to multiple times', () { - final stream = preferences.getInt('myInt', defaultValue: 0); - - // If this doesn't crash the test, the test is considered a passing test. - stream.listen((_) {}); - stream.listen((_) {}); - stream.listen((_) {}); - }); - - test('getInt() - initial values', () { - expect(preferences.getInt('myInt', defaultValue: 0), emits(1337)); - expect(preferences.getInt('myNullInt', defaultValue: 0), emits(0)); - expect( - preferences.getInt('myNullInt', defaultValue: 1337), - emits(1337), - ); - }); - - test('getInt().getValue() - initial values', () { - expect(preferences.getInt('myInt', defaultValue: 0).getValue(), 1337); - expect( - preferences.getInt('myNullInt', defaultValue: 1337).getValue(), - 1337, - ); - }); - - test('getInt().getValue()', () async { - final storedInt = preferences.getInt('key1', defaultValue: 0); - expect(storedInt.getValue(), 0); - - when(delegate.getInt('key1')).thenReturn(1); - expect(storedInt.getValue(), 1); - - when(delegate.getInt('key1')).thenReturn(2); - expect(preferences.getInt('key1', defaultValue: 0).getValue(), 2); - - when(delegate.getInt('key1')).thenReturn(null); - expect( - preferences.getInt('key1', defaultValue: 1).getValue(), - 1, - ); - }); - - test('setInt emits an update in getInt', () async { - final storedInt = preferences.getInt('key1', defaultValue: 1); - - scheduleMicrotask(() { - when(delegate.getInt('key1')).thenReturn(2); - - // Setting value to null won't matter here as the delegate is just a mock. - // What we're interested instead is triggering an update in the changed - // keys stream. - preferences.setInt('key1', null); - }); - - await expectLater(storedInt, emitsInOrder([1, 2])); - }); - }); - - group('double tests', () { - setUp(() { - when(delegate.getDouble('myDouble')).thenReturn(13.37); - when(delegate.getDouble('myNullDouble')).thenReturn(null); - }); - - test('getDouble() - can listen to multiple times', () { - final stream = preferences.getDouble('myDouble', defaultValue: 0); - - // If this doesn't crash the test, the test is considered a passing test. - stream.listen((_) {}); - stream.listen((_) {}); - stream.listen((_) {}); - }); - - test('getDouble() - initial values', () { - expect( - preferences.getDouble('myDouble', defaultValue: 0), - emits(13.37), - ); - - expect( - preferences.getDouble('myNullDouble', defaultValue: 13.37), - emits(13.37), - ); - }); - - test('getDouble().getValue() - initial values', () { - expect( - preferences.getDouble('myDouble', defaultValue: 0).getValue(), - 13.37, - ); - - expect( - preferences.getDouble('myNullDouble', defaultValue: 13.37).getValue(), - 13.37, - ); - }); - - test('getDouble().getValue()', () async { - final storedDouble = preferences.getDouble('key1', defaultValue: 0); - expect(storedDouble.getValue(), 0); - - when(delegate.getDouble('key1')).thenReturn(1.1); - expect(storedDouble.getValue(), 1.1); - - when(delegate.getDouble('key1')).thenReturn(2.2); - expect(preferences.getDouble('key1', defaultValue: 0).getValue(), 2.2); - - when(delegate.getDouble('key1')).thenReturn(null); - expect( - preferences.getDouble('key1', defaultValue: 1.1).getValue(), - 1.1, - ); - }); - - test('setDouble emits an update in getDouble', () async { - final storedDouble = preferences.getDouble('key1', defaultValue: 1.1); - - scheduleMicrotask(() { - when(delegate.getDouble('key1')).thenReturn(2.2); - - // Setting value to null won't matter here as the delegate is just a mock. - // What we're interested instead is triggering an update in the changed - // keys stream. - preferences.setDouble('key1', null); - }); - - expect(storedDouble, emitsInOrder([1.1, 2.2])); - }); - }); - - group('String tests', () { - setUp(() { - when(delegate.getString('myString')).thenReturn('myValue'); - when(delegate.getString('myNullString')).thenReturn(null); - }); - - test('getString() - can listen to multiple times', () { - final stream = preferences.getString('myString', defaultValue: ''); - - // If this doesn't crash the test, the test is considered a passing test. - stream.listen((_) {}); - stream.listen((_) {}); - stream.listen((_) {}); - }); - - test('getString() - initial values', () { - expect( - preferences.getString('myString', defaultValue: ''), - emits('myValue'), - ); - - expect( - preferences.getString('null-defValue', defaultValue: 'defaultValue'), - emits('defaultValue'), - ); - }); - - test('getString().getValue() - initial values', () { - expect( - preferences.getString('myString', defaultValue: '').getValue(), - 'myValue', - ); - - expect( - preferences - .getString('null-defValue', defaultValue: 'defaultValue') - .getValue(), - 'defaultValue', - ); - }); - - test('getString().getValue()', () async { - final storedString = preferences.getString('key1', defaultValue: ''); - expect(storedString.getValue(), isEmpty); - - when(delegate.getString('key1')).thenReturn('value 1'); - expect(storedString.getValue(), 'value 1'); - - when(delegate.getString('key1')).thenReturn('value 2'); - expect( - preferences.getString('key1', defaultValue: '').getValue(), - 'value 2', - ); - - when(delegate.getString('key1')).thenReturn(null); - expect( - preferences - .getString('key1', defaultValue: 'defaultValue') - .getValue(), - 'defaultValue', - ); - }); - - test('setString emits an update in getString Stream', () async { - final storedString = - preferences.getString('key1', defaultValue: 'defaultValue'); - - scheduleMicrotask(() { - when(delegate.getString('key1')).thenReturn('updated string'); - - // Setting value to null won't matter here as the delegate is just a mock. - // What we're interested instead is triggering an update in the changed - // keys stream. - preferences.setString('key1', null); - }); - - await expectLater( - storedString, - emitsInOrder(['defaultValue', 'updated string']), - ); - }); - }); - - group('String list tests', () { - setUp(() { - when(delegate.getStringList('myStringList')).thenReturn(['a', 'b']); - when(delegate.getStringList('myNullStringList')).thenReturn(null); - when(delegate.getStringList('myEmptyStringList')).thenReturn([]); - }); - - test('getStringList() - can listen to multiple times', () { - final stream = preferences.getStringList( - 'myStringList', - defaultValue: [], - ); - - // If this doesn't crash the test, the test is considered a passing test. - stream.listen((_) {}); - stream.listen((_) {}); - stream.listen((_) {}); - }); - - test('getStringList() - initial values', () { - expect( - preferences.getStringList('myStringList', defaultValue: []), - emits(['a', 'b']), - ); - - expect( - preferences.getStringList( - 'myEmptyStringList', - defaultValue: ['nonempty'], - ), - emits([]), - ); - - expect( - preferences.getStringList( - 'myNullStringList', - defaultValue: ['default', 'value'], - ), - emits(['default', 'value']), - ); - }); - - test('getStringList().getValue() - initial values', () { - expect( - preferences.getStringList( - 'myStringList', - defaultValue: [], - ).getValue(), - ['a', 'b'], - ); - - expect( - preferences.getStringList( - 'null-defValue', - defaultValue: ['default', 'value'], - ).getValue(), - ['default', 'value'], - ); - }); - - test('getStringList().getValue()', () async { - final storedStringList = preferences.getStringList( - 'key1', - defaultValue: [], - ); - - expect(storedStringList.getValue(), isEmpty); - - when(delegate.getStringList('key1')).thenReturn(['a', 'a']); - expect(storedStringList.getValue(), ['a', 'a']); - - when(delegate.getStringList('key1')).thenReturn(['b', 'b']); - expect( - preferences.getStringList('key1', defaultValue: []).getValue(), - ['b', 'b'], - ); - - when(delegate.getStringList('key1')).thenReturn(null); - expect( - preferences.getStringList( - 'key1', - defaultValue: ['default', 'value'], - ).getValue(), - ['default', 'value'], - ); - }); - - test('setStringList emits an update in getStringList', () async { - final storedString = preferences.getStringList( - 'key1', - defaultValue: ['default', 'value'], - ); - - scheduleMicrotask(() { - when(delegate.getStringList('key1')).thenReturn(['updated', 'value']); - - // Setting value to null won't matter here as the delegate is just a mock. - // What we're interested instead is triggering an update in the changed - // keys stream. - preferences.setStringList('key1', null); - }); - - await expectLater( - storedString, - emitsInOrder([ - ['default', 'value'], - ['updated', 'value'], - ]), - ); - }); - }); - - test('removing a key triggers an update in value stream', () { - when(delegate.getString('myString')).thenReturn('initial value'); - final stringValue = preferences.getString('myString', defaultValue: ''); - - scheduleMicrotask(() { - // We're only testing that the removal triggers an update in the key stream. - // While this "when" call here could return anything, we're returning null - // because that's what would happen in a real scenario. - when(delegate.getString('myString')).thenReturn(null); - preferences.remove('myString'); - }); - - expect(stringValue, emitsInOrder(['initial value', ''])); - }); - - test('clear() triggers update on all existing keys', () { - when(delegate.getKeys()).thenReturn(Set.from(['key1', 'key2', 'key3'])); - when(delegate.getString(any)).thenReturn('value'); - - final value1 = preferences.getString('key1', defaultValue: ''); - final value2 = preferences.getString('key2', defaultValue: ''); - final value3 = preferences.getString('key3', defaultValue: ''); - - scheduleMicrotask(() { - // We're only testing that calling clear() triggers an update in the key - // stream for all of the existing keys. - // - // While this "when" call here could return anything, we're returning null - // because that's what would happen in a real scenario. - when(delegate.getString(any)).thenReturn(null); - preferences.clear(); - }); - - expect(value1, emitsInOrder(['value', ''])); - expect(value2, emitsInOrder(['value', ''])); - expect(value3, emitsInOrder(['value', ''])); - }); - - test('setters throw assertion error when key is null', () { - final assertionError = throwsA(const TypeMatcher()); - - expect(() => preferences.setBool(null, true), assertionError); - expect(() => preferences.setInt(null, 0), assertionError); - expect(() => preferences.setDouble(null, 0), assertionError); - expect(() => preferences.setString(null, ''), assertionError); - expect( - () => preferences.setStringList(null, []), - assertionError, - ); - }); - - test('throws assertion error for null preference adapter', () { - final assertionError = throwsA(const TypeMatcher()); - expect( - () => preferences.getCustomValue('', defaultValue: '', adapter: null), - assertionError, - ); - - expect( - () => preferences.setCustomValue('', '', adapter: null), - assertionError, - ); - }); - - test('getters throw assertion error when key is null', () { - final assertionError = throwsA(const TypeMatcher()); - - expect( - () => preferences.getBool(null, defaultValue: true), - assertionError, - ); - - expect(() => preferences.getInt(null, defaultValue: 0), assertionError); - expect( - () => preferences.getDouble(null, defaultValue: 0), - assertionError, - ); - - expect( - () => preferences.getString(null, defaultValue: ''), - assertionError, - ); - - expect( - () => preferences.getStringList(null, defaultValue: []), - assertionError, - ); - }); - - test('getters throw assertion error when default value is null', () { - final assertionError = throwsA(const TypeMatcher()); - - expect( - () => preferences.getBool('k', defaultValue: null), - assertionError, - ); - - expect(() => preferences.getInt('k', defaultValue: null), assertionError); - expect( - () => preferences.getDouble('', defaultValue: null), - assertionError, - ); - - expect( - () => preferences.getString('k', defaultValue: null), - assertionError, - ); - - expect( - () => preferences.getStringList('', defaultValue: null), - assertionError, - ); - }); - }); -} diff --git a/lib/time/lib/src/time.dart b/lib/time/lib/src/time.dart index bbfb9029d..801980ea7 100644 --- a/lib/time/lib/src/time.dart +++ b/lib/time/lib/src/time.dart @@ -8,7 +8,6 @@ import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; -import 'package:meta/meta.dart'; class Time { final String _time; diff --git a/lib/time/pubspec.lock b/lib/time/pubspec.lock index 39ab755ac..196069794 100644 --- a/lib/time/pubspec.lock +++ b/lib/time/pubspec.lock @@ -7,7 +7,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.8.1" + version: "2.8.2" boolean_selector: dependency: transitive description: @@ -21,7 +21,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" charcode: dependency: transitive description: @@ -73,7 +73,14 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" meta: dependency: transitive description: @@ -134,7 +141,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.2" + version: "0.4.8" typed_data: dependency: transitive description: @@ -148,6 +155,6 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" sdks: - dart: ">=2.12.0 <3.0.0" + dart: ">=2.14.0 <3.0.0" diff --git a/lib/url_launcher_extended/pubspec.lock b/lib/url_launcher_extended/pubspec.lock index ea8d72713..38d96c60a 100644 --- a/lib/url_launcher_extended/pubspec.lock +++ b/lib/url_launcher_extended/pubspec.lock @@ -28,7 +28,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.8.1" + version: "2.8.2" boolean_selector: dependency: transitive description: @@ -42,7 +42,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" charcode: dependency: transitive description: @@ -176,7 +176,14 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" meta: dependency: transitive description: @@ -328,21 +335,21 @@ packages: name: test url: "https://pub.dartlang.org" source: hosted - version: "1.17.10" + version: "1.19.5" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.2" + version: "0.4.8" test_core: dependency: transitive description: name: test_core url: "https://pub.dartlang.org" source: hosted - version: "0.4.0" + version: "0.4.9" typed_data: dependency: transitive description: @@ -398,7 +405,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" vm_service: dependency: transitive description: diff --git a/lib/user/pubspec.lock b/lib/user/pubspec.lock index 8d606c1b8..ad049957c 100644 --- a/lib/user/pubspec.lock +++ b/lib/user/pubspec.lock @@ -14,7 +14,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.8.1" + version: "2.8.2" boolean_selector: dependency: transitive description: @@ -28,7 +28,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" charcode: dependency: transitive description: @@ -204,7 +204,14 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" meta: dependency: transitive description: @@ -300,7 +307,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.2" + version: "0.4.8" time: dependency: "direct main" description: @@ -321,7 +328,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" sdks: - dart: ">=2.12.0 <3.0.0" + dart: ">=2.14.0 <3.0.0" flutter: ">=1.12.13+hotfix.5"