diff --git a/lib/core/services/api/key_service.dart b/lib/core/services/api/key_service.dart index f7d3555..8ba5a83 100644 --- a/lib/core/services/api/key_service.dart +++ b/lib/core/services/api/key_service.dart @@ -1,7 +1,25 @@ /// Compact ApiKeyService using BasePodService infrastructure. -/// Reduced from 575 to ~280 lines by using BasePodService patterns. /// /// Copyright (C) 2025, Software Innovation Institute, ANU. +/// +/// Licensed under the GNU General Public License, Version 3 (the "License"). +/// +/// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/core/services/favorites/movie_list_file_helper.dart b/lib/core/services/favorites/movie_list_file_helper.dart index 084e63f..b107ae2 100644 --- a/lib/core/services/favorites/movie_list_file_helper.dart +++ b/lib/core/services/favorites/movie_list_file_helper.dart @@ -5,6 +5,21 @@ /// Licensed under the GNU General Public License, Version 3 (the "License"). /// /// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/core/services/favorites/movie_list_service.dart b/lib/core/services/favorites/movie_list_service.dart index 0defd0b..c7c7a70 100644 --- a/lib/core/services/favorites/movie_list_service.dart +++ b/lib/core/services/favorites/movie_list_service.dart @@ -1,7 +1,25 @@ /// Compact MovieListService using composition with helper classes. -/// Reduced from 1,247 to ~220 lines by extracting operations to helpers. /// /// Copyright (C) 2025, Software Innovation Institute, ANU. +/// +/// Licensed under the GNU General Public License, Version 3 (the "License"). +/// +/// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/core/services/favorites/operations_helper.dart b/lib/core/services/favorites/operations_helper.dart index be07fc1..3396733 100644 --- a/lib/core/services/favorites/operations_helper.dart +++ b/lib/core/services/favorites/operations_helper.dart @@ -1,6 +1,25 @@ /// Helper class for MovieListService CRUD operations. /// /// Copyright (C) 2025, Software Innovation Institute, ANU. +/// +/// Licensed under the GNU General Public License, Version 3 (the "License"). +/// +/// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/core/services/pod/favorites/pod_favorites_cache_manager.dart b/lib/core/services/pod/favorites/pod_favorites_cache_manager.dart index 1672826..d1238e5 100644 --- a/lib/core/services/pod/favorites/pod_favorites_cache_manager.dart +++ b/lib/core/services/pod/favorites/pod_favorites_cache_manager.dart @@ -1,7 +1,25 @@ /// Cache management for POD favorites service. -/// Handles movie caching and file tracking operations. /// /// Copyright (C) 2025, Software Innovation Institute, ANU. +/// +/// Licensed under the GNU General Public License, Version 3 (the "License"). +/// +/// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/core/services/pod/favorites/pod_favorites_file_handler.dart b/lib/core/services/pod/favorites/pod_favorites_file_handler.dart index 509e59c..1dcd6c7 100644 --- a/lib/core/services/pod/favorites/pod_favorites_file_handler.dart +++ b/lib/core/services/pod/favorites/pod_favorites_file_handler.dart @@ -1,7 +1,25 @@ /// File handling operations for POD favorites service. -/// Handles TTL parsing and movie data loading operations. /// /// Copyright (C) 2025, Software Innovation Institute, ANU. +/// +/// Licensed under the GNU General Public License, Version 3 (the "License"). +/// +/// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/core/services/pod/favorites/pod_favorites_list_operations.dart b/lib/core/services/pod/favorites/pod_favorites_list_operations.dart index ec894cb..1c83b37 100644 --- a/lib/core/services/pod/favorites/pod_favorites_list_operations.dart +++ b/lib/core/services/pod/favorites/pod_favorites_list_operations.dart @@ -1,7 +1,25 @@ /// List operations for POD favorites service. -/// Handles custom list management and operations. /// /// Copyright (C) 2025, Software Innovation Institute, ANU. +/// +/// Licensed under the GNU General Public License, Version 3 (the "License"). +/// +/// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/core/services/pod/favorites/pod_favorites_movie_operations.dart b/lib/core/services/pod/favorites/pod_favorites_movie_operations.dart index 0591cd8..70eb3ee 100644 --- a/lib/core/services/pod/favorites/pod_favorites_movie_operations.dart +++ b/lib/core/services/pod/favorites/pod_favorites_movie_operations.dart @@ -1,7 +1,25 @@ /// Movie operations for POD favorites service. -/// Handles adding/removing movies from watch lists and movie-related queries. /// /// Copyright (C) 2025, Software Innovation Institute, ANU. +/// +/// Licensed under the GNU General Public License, Version 3 (the "License"). +/// +/// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/core/services/pod/favorites_service.dart b/lib/core/services/pod/favorites_service.dart index b1e90cc..aa91306 100644 --- a/lib/core/services/pod/favorites_service.dart +++ b/lib/core/services/pod/favorites_service.dart @@ -1,7 +1,25 @@ /// POD-based service for managing favorite movies using decomposed operations. -/// Facade service delegating to specialized operation classes. /// /// Copyright (C) 2025, Software Innovation Institute, ANU. +/// +/// Licensed under the GNU General Public License, Version 3 (the "License"). +/// +/// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/core/services/pod/file_operations_service.dart b/lib/core/services/pod/file_operations_service.dart index 3eafc59..13c5183 100644 --- a/lib/core/services/pod/file_operations_service.dart +++ b/lib/core/services/pod/file_operations_service.dart @@ -5,6 +5,21 @@ /// Licensed under the GNU General Public License, Version 3 (the "License"). /// /// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/screens/my_movies_screen.dart b/lib/screens/my_movies_screen.dart index e6a0df1..3341e7b 100644 --- a/lib/screens/my_movies_screen.dart +++ b/lib/screens/my_movies_screen.dart @@ -40,6 +40,7 @@ import 'package:moviestar/screens/movie_details_screen.dart'; import 'package:moviestar/services/user_profile_service.dart'; import 'package:moviestar/utils/movie_sort_util.dart'; import 'package:moviestar/utils/serializer.dart'; +import 'package:moviestar/utils/sort_preference_service.dart'; import 'package:moviestar/widgets/base_screen.dart'; import 'package:moviestar/widgets/moviestar_batch_sharing_ui.dart'; import 'package:moviestar/widgets/sort_controls.dart'; @@ -62,10 +63,26 @@ class MyMoviesScreen extends StatefulWidget { /// State class for the my movies screen. class _MyMoviesScreenState extends State with ScreenStateMixin { - /// Currently selected sort criteria. + static const String _sortKey = 'my_movies'; MovieSortCriteria _sortCriteria = MovieSortCriteria.nameAsc; + @override + void initState() { + super.initState(); + _loadSortPreference(); + } + + Future _loadSortPreference() async { + final saved = await SortPreferenceService.load( + _sortKey, + fallback: MovieSortCriteria.nameAsc, + ); + if (mounted) { + setState(() => _sortCriteria = saved); + } + } + /// Gets movies that the user has rated (combines both to watch and watched movies with ratings). Stream> get _ratedMovies async* { @@ -152,6 +169,7 @@ Recipients will be able to: safeSetState(() { _sortCriteria = criteria; }); + SortPreferenceService.save(_sortKey, criteria); }, ), Expanded( diff --git a/lib/screens/shared_movie_list_detail_screen.dart b/lib/screens/shared_movie_list_detail_screen.dart index 2ea1367..adf2712 100644 --- a/lib/screens/shared_movie_list_detail_screen.dart +++ b/lib/screens/shared_movie_list_detail_screen.dart @@ -1,7 +1,25 @@ /// Shared Movie List Detail Screen for MovieStar using decomposed components. -/// Facade screen delegating to specialized operation classes. /// /// Copyright (C) 2025, Software Innovation Institute, ANU. +/// +/// Licensed under the GNU General Public License, Version 3 (the "License"). +/// +/// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/screens/to_watch_screen.dart b/lib/screens/to_watch_screen.dart index 9e55bcb..58ce599 100644 --- a/lib/screens/to_watch_screen.dart +++ b/lib/screens/to_watch_screen.dart @@ -38,6 +38,7 @@ import 'package:moviestar/models/movie.dart'; import 'package:moviestar/services/user_profile_service.dart'; import 'package:moviestar/utils/movie_sort_util.dart'; import 'package:moviestar/utils/navigation_utils.dart'; +import 'package:moviestar/utils/sort_preference_service.dart'; import 'package:moviestar/utils/serializer.dart'; import 'package:moviestar/widgets/base_screen.dart'; import 'package:moviestar/widgets/movie_list_widget.dart'; @@ -62,10 +63,26 @@ class ToWatchScreen extends StatefulWidget { /// State class for the to watch screen. class _ToWatchScreenState extends State with ScreenStateMixin { - /// Currently selected sort criteria. + static const String _sortKey = 'towatch'; MovieSortCriteria _sortCriteria = MovieSortCriteria.nameAsc; + @override + void initState() { + super.initState(); + _loadSortPreference(); + } + + Future _loadSortPreference() async { + final saved = await SortPreferenceService.load( + _sortKey, + fallback: MovieSortCriteria.nameAsc, + ); + if (mounted) { + setState(() => _sortCriteria = saved); + } + } + @override Widget build(BuildContext context) { return BaseScreen( @@ -128,6 +145,7 @@ Recipients will be able to: safeSetState(() { _sortCriteria = criteria; }); + SortPreferenceService.save(_sortKey, criteria); }, onMovieTap: (movie) { safeNavigateTo( diff --git a/lib/screens/watched_screen.dart b/lib/screens/watched_screen.dart index 3f5c328..c60330c 100644 --- a/lib/screens/watched_screen.dart +++ b/lib/screens/watched_screen.dart @@ -38,6 +38,7 @@ import 'package:moviestar/models/movie.dart'; import 'package:moviestar/services/user_profile_service.dart'; import 'package:moviestar/utils/movie_sort_util.dart'; import 'package:moviestar/utils/navigation_utils.dart'; +import 'package:moviestar/utils/sort_preference_service.dart'; import 'package:moviestar/utils/serializer.dart'; import 'package:moviestar/widgets/base_screen.dart'; import 'package:moviestar/widgets/movie_list_widget.dart'; @@ -62,10 +63,26 @@ class WatchedScreen extends StatefulWidget { /// State class for the watched screen. class _WatchedScreenState extends State with ScreenStateMixin { - /// Currently selected sort criteria. + static const String _sortKey = 'watched'; MovieSortCriteria _sortCriteria = MovieSortCriteria.nameAsc; + @override + void initState() { + super.initState(); + _loadSortPreference(); + } + + Future _loadSortPreference() async { + final saved = await SortPreferenceService.load( + _sortKey, + fallback: MovieSortCriteria.nameAsc, + ); + if (mounted) { + setState(() => _sortCriteria = saved); + } + } + @override Widget build(BuildContext context) { return BaseScreen( @@ -128,6 +145,7 @@ Recipients will be able to: setState(() { _sortCriteria = criteria; }); + SortPreferenceService.save(_sortKey, criteria); }, onMovieTap: (movie) { safeNavigateTo( diff --git a/lib/shared/utils/turtle/api_key_serializer.dart b/lib/shared/utils/turtle/api_key_serializer.dart index ba6702f..e7bc7d4 100644 --- a/lib/shared/utils/turtle/api_key_serializer.dart +++ b/lib/shared/utils/turtle/api_key_serializer.dart @@ -5,6 +5,21 @@ /// Licensed under the GNU General Public License, Version 3 (the "License"). /// /// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/shared/utils/turtle/base_serializer.dart b/lib/shared/utils/turtle/base_serializer.dart index 0624976..75d05c8 100644 --- a/lib/shared/utils/turtle/base_serializer.dart +++ b/lib/shared/utils/turtle/base_serializer.dart @@ -5,6 +5,21 @@ /// Licensed under the GNU General Public License, Version 3 (the "License"). /// /// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/shared/utils/turtle/movie_list_serializer.dart b/lib/shared/utils/turtle/movie_list_serializer.dart index 305eba0..a01170f 100644 --- a/lib/shared/utils/turtle/movie_list_serializer.dart +++ b/lib/shared/utils/turtle/movie_list_serializer.dart @@ -5,6 +5,21 @@ /// Licensed under the GNU General Public License, Version 3 (the "License"). /// /// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/shared/utils/turtle/movie_serializer.dart b/lib/shared/utils/turtle/movie_serializer.dart index 3b253da..404ad06 100644 --- a/lib/shared/utils/turtle/movie_serializer.dart +++ b/lib/shared/utils/turtle/movie_serializer.dart @@ -5,6 +5,21 @@ /// Licensed under the GNU General Public License, Version 3 (the "License"). /// /// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/shared/utils/turtle/namespace_manager.dart b/lib/shared/utils/turtle/namespace_manager.dart index ec64ec4..5ea6ad8 100644 --- a/lib/shared/utils/turtle/namespace_manager.dart +++ b/lib/shared/utils/turtle/namespace_manager.dart @@ -5,6 +5,21 @@ /// Licensed under the GNU General Public License, Version 3 (the "License"). /// /// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/shared/utils/turtle/parsing_utils.dart b/lib/shared/utils/turtle/parsing_utils.dart index 8211941..228513f 100644 --- a/lib/shared/utils/turtle/parsing_utils.dart +++ b/lib/shared/utils/turtle/parsing_utils.dart @@ -5,6 +5,21 @@ /// Licensed under the GNU General Public License, Version 3 (the "License"). /// /// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/shared/utils/turtle/rating_comment_serializer.dart b/lib/shared/utils/turtle/rating_comment_serializer.dart index b87a6e7..8f67052 100644 --- a/lib/shared/utils/turtle/rating_comment_serializer.dart +++ b/lib/shared/utils/turtle/rating_comment_serializer.dart @@ -5,6 +5,21 @@ /// Licensed under the GNU General Public License, Version 3 (the "License"). /// /// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/shared/utils/turtle/user_profile_serializer.dart b/lib/shared/utils/turtle/user_profile_serializer.dart index 138a525..48439b2 100644 --- a/lib/shared/utils/turtle/user_profile_serializer.dart +++ b/lib/shared/utils/turtle/user_profile_serializer.dart @@ -5,6 +5,21 @@ /// Licensed under the GNU General Public License, Version 3 (the "License"). /// /// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/shared/widgets/home/api_error_overlay.dart b/lib/shared/widgets/home/api_error_overlay.dart index c237e9e..22e2339 100644 --- a/lib/shared/widgets/home/api_error_overlay.dart +++ b/lib/shared/widgets/home/api_error_overlay.dart @@ -5,6 +5,21 @@ /// Licensed under the GNU General Public License, Version 3 (the "License"). /// /// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/shared/widgets/home/cache_badges.dart b/lib/shared/widgets/home/cache_badges.dart index bf71619..efb16b7 100644 --- a/lib/shared/widgets/home/cache_badges.dart +++ b/lib/shared/widgets/home/cache_badges.dart @@ -5,6 +5,21 @@ /// Licensed under the GNU General Public License, Version 3 (the "License"). /// /// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/shared/widgets/home/custom_list_builder.dart b/lib/shared/widgets/home/custom_list_builder.dart index 7d25e8b..d9ccc4b 100644 --- a/lib/shared/widgets/home/custom_list_builder.dart +++ b/lib/shared/widgets/home/custom_list_builder.dart @@ -5,6 +5,21 @@ /// Licensed under the GNU General Public License, Version 3 (the "License"). /// /// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/shared/widgets/home/custom_list_movie_card.dart b/lib/shared/widgets/home/custom_list_movie_card.dart index 917e0c3..f5d0d41 100644 --- a/lib/shared/widgets/home/custom_list_movie_card.dart +++ b/lib/shared/widgets/home/custom_list_movie_card.dart @@ -5,6 +5,21 @@ /// Licensed under the GNU General Public License, Version 3 (the "License"). /// /// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/shared/widgets/home/custom_list_row.dart b/lib/shared/widgets/home/custom_list_row.dart index b25bf5c..1fcbfa4 100644 --- a/lib/shared/widgets/home/custom_list_row.dart +++ b/lib/shared/widgets/home/custom_list_row.dart @@ -5,6 +5,21 @@ /// Licensed under the GNU General Public License, Version 3 (the "License"). /// /// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/shared/widgets/home/custom_list_section.dart b/lib/shared/widgets/home/custom_list_section.dart index 67f800a..de26adf 100644 --- a/lib/shared/widgets/home/custom_list_section.dart +++ b/lib/shared/widgets/home/custom_list_section.dart @@ -5,6 +5,21 @@ /// Licensed under the GNU General Public License, Version 3 (the "License"). /// /// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/shared/widgets/home/custom_list_states.dart b/lib/shared/widgets/home/custom_list_states.dart index 3b38d54..45ac871 100644 --- a/lib/shared/widgets/home/custom_list_states.dart +++ b/lib/shared/widgets/home/custom_list_states.dart @@ -5,6 +5,21 @@ /// Licensed under the GNU General Public License, Version 3 (the "License"). /// /// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/shared/widgets/home/error_handler.dart b/lib/shared/widgets/home/error_handler.dart index 7ff9c4e..1d74af7 100644 --- a/lib/shared/widgets/home/error_handler.dart +++ b/lib/shared/widgets/home/error_handler.dart @@ -5,6 +5,21 @@ /// Licensed under the GNU General Public License, Version 3 (the "License"). /// /// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/shared/widgets/home/movie_filtering_helper.dart b/lib/shared/widgets/home/movie_filtering_helper.dart index a6d91b2..ac57913 100644 --- a/lib/shared/widgets/home/movie_filtering_helper.dart +++ b/lib/shared/widgets/home/movie_filtering_helper.dart @@ -5,6 +5,21 @@ /// Licensed under the GNU General Public License, Version 3 (the "License"). /// /// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/shared/widgets/home/movie_list_items.dart b/lib/shared/widgets/home/movie_list_items.dart index 3743d2a..ababc49 100644 --- a/lib/shared/widgets/home/movie_list_items.dart +++ b/lib/shared/widgets/home/movie_list_items.dart @@ -5,6 +5,21 @@ /// Licensed under the GNU General Public License, Version 3 (the "License"). /// /// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/shared/widgets/home/movie_sections.dart b/lib/shared/widgets/home/movie_sections.dart index 1a5a1d6..e892fd9 100644 --- a/lib/shared/widgets/home/movie_sections.dart +++ b/lib/shared/widgets/home/movie_sections.dart @@ -5,6 +5,21 @@ /// Licensed under the GNU General Public License, Version 3 (the "License"). /// /// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/shared/widgets/home/to_watch_section.dart b/lib/shared/widgets/home/to_watch_section.dart index e6e758d..030d18c 100644 --- a/lib/shared/widgets/home/to_watch_section.dart +++ b/lib/shared/widgets/home/to_watch_section.dart @@ -5,6 +5,21 @@ /// Licensed under the GNU General Public License, Version 3 (the "License"). /// /// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/shared/widgets/home/view_modes.dart b/lib/shared/widgets/home/view_modes.dart index fdc2584..974b2b8 100644 --- a/lib/shared/widgets/home/view_modes.dart +++ b/lib/shared/widgets/home/view_modes.dart @@ -5,6 +5,21 @@ /// Licensed under the GNU General Public License, Version 3 (the "License"). /// /// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/shared/widgets/home/watched_section.dart b/lib/shared/widgets/home/watched_section.dart index 21e3204..bb0fa9a 100644 --- a/lib/shared/widgets/home/watched_section.dart +++ b/lib/shared/widgets/home/watched_section.dart @@ -5,6 +5,21 @@ /// Licensed under the GNU General Public License, Version 3 (the "License"). /// /// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/shared/widgets/kanban/board_controller.dart b/lib/shared/widgets/kanban/board_controller.dart index 9d73b31..ccfc293 100644 --- a/lib/shared/widgets/kanban/board_controller.dart +++ b/lib/shared/widgets/kanban/board_controller.dart @@ -5,6 +5,21 @@ /// Licensed under the GNU General Public License, Version 3 (the "License"). /// /// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Kevin Wang. library; @@ -12,6 +27,7 @@ import 'package:flutter/material.dart'; import 'package:moviestar/constants/timing_constants.dart'; import 'package:moviestar/models/movie.dart'; +import 'package:moviestar/utils/sort_preference_service.dart'; import 'package:moviestar/widgets/sort_controls.dart'; /// Enum for different column types in the kanban board. @@ -93,9 +109,15 @@ class KanbanBoardController extends ChangeNotifier { // Sorting state for each column. final Map _columnSortCriteria = { - 'recommended': MovieSortCriteria.ratingDesc, // Default: by rating - 'towatch': MovieSortCriteria.nameAsc, // Default: alphabetical - 'watched': MovieSortCriteria.dateDesc, // Default: recent first + 'recommended': MovieSortCriteria.ratingDesc, + 'towatch': MovieSortCriteria.nameAsc, + 'watched': MovieSortCriteria.dateDesc, + }; + + static const Map _defaultSortCriteria = { + 'recommended': MovieSortCriteria.ratingDesc, + 'towatch': MovieSortCriteria.nameAsc, + 'watched': MovieSortCriteria.dateDesc, }; // Getters. @@ -105,16 +127,29 @@ class KanbanBoardController extends ChangeNotifier { Map get columnSortCriteria => Map.unmodifiable(_columnSortCriteria); + /// Restores persisted sort preferences for every known column. + + Future loadSortPreferences() async { + for (final entry in _defaultSortCriteria.entries) { + _columnSortCriteria[entry.key] = await SortPreferenceService.load( + entry.key, + fallback: entry.value, + ); + } + notifyListeners(); + } + /// Get the key for tracking operations. String _getOperationKey(KanbanColumnType type, String id) { return '${type.name}_$id'; } - /// Handle sort change for a column. + /// Handle sort change for a column and persist the selection. void onSortChanged(String columnId, MovieSortCriteria criteria) { _columnSortCriteria[columnId] = criteria; + SortPreferenceService.save(columnId, criteria); notifyListeners(); } diff --git a/lib/shared/widgets/kanban/card_widget.dart b/lib/shared/widgets/kanban/card_widget.dart index 64b3c96..65726e2 100644 --- a/lib/shared/widgets/kanban/card_widget.dart +++ b/lib/shared/widgets/kanban/card_widget.dart @@ -5,6 +5,21 @@ /// Licensed under the GNU General Public License, Version 3 (the "License"). /// /// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/shared/widgets/kanban/column_widget.dart b/lib/shared/widgets/kanban/column_widget.dart index 8986325..1ff292d 100644 --- a/lib/shared/widgets/kanban/column_widget.dart +++ b/lib/shared/widgets/kanban/column_widget.dart @@ -5,6 +5,21 @@ /// Licensed under the GNU General Public License, Version 3 (the "License"). /// /// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/shared/widgets/kanban/drag_handler.dart b/lib/shared/widgets/kanban/drag_handler.dart index 91afd66..b6a87de 100644 --- a/lib/shared/widgets/kanban/drag_handler.dart +++ b/lib/shared/widgets/kanban/drag_handler.dart @@ -5,6 +5,21 @@ /// Licensed under the GNU General Public License, Version 3 (the "License"). /// /// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/shared/widgets/kanban/drag_handler/context_menu_handler.dart b/lib/shared/widgets/kanban/drag_handler/context_menu_handler.dart index fc955a0..6ebbc76 100644 --- a/lib/shared/widgets/kanban/drag_handler/context_menu_handler.dart +++ b/lib/shared/widgets/kanban/drag_handler/context_menu_handler.dart @@ -5,6 +5,21 @@ /// Licensed under the GNU General Public License, Version 3 (the "License"). /// /// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/shared/widgets/kanban/drag_handler/sync_operations.dart b/lib/shared/widgets/kanban/drag_handler/sync_operations.dart index 1943271..406a0a3 100644 --- a/lib/shared/widgets/kanban/drag_handler/sync_operations.dart +++ b/lib/shared/widgets/kanban/drag_handler/sync_operations.dart @@ -5,6 +5,21 @@ /// Licensed under the GNU General Public License, Version 3 (the "License"). /// /// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/shared/widgets/kanban/search_filter.dart b/lib/shared/widgets/kanban/search_filter.dart index c35c357..90f772e 100644 --- a/lib/shared/widgets/kanban/search_filter.dart +++ b/lib/shared/widgets/kanban/search_filter.dart @@ -5,6 +5,21 @@ /// Licensed under the GNU General Public License, Version 3 (the "License"). /// /// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/shared/widgets/kanban/settings_panel.dart b/lib/shared/widgets/kanban/settings_panel.dart index 5a29d75..1563f37 100644 --- a/lib/shared/widgets/kanban/settings_panel.dart +++ b/lib/shared/widgets/kanban/settings_panel.dart @@ -5,6 +5,21 @@ /// Licensed under the GNU General Public License, Version 3 (the "License"). /// /// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/shared/widgets/kanban/skeleton_column.dart b/lib/shared/widgets/kanban/skeleton_column.dart index 6d39a10..dff616e 100644 --- a/lib/shared/widgets/kanban/skeleton_column.dart +++ b/lib/shared/widgets/kanban/skeleton_column.dart @@ -5,6 +5,21 @@ /// Licensed under the GNU General Public License, Version 3 (the "License"). /// /// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/shared/widgets/lists/empty_state.dart b/lib/shared/widgets/lists/empty_state.dart index 42619c2..ca2013e 100644 --- a/lib/shared/widgets/lists/empty_state.dart +++ b/lib/shared/widgets/lists/empty_state.dart @@ -5,6 +5,21 @@ /// Licensed under the GNU General Public License, Version 3 (the "License"). /// /// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/shared/widgets/lists/list_dialogs.dart b/lib/shared/widgets/lists/list_dialogs.dart index ab516ed..f5d053e 100644 --- a/lib/shared/widgets/lists/list_dialogs.dart +++ b/lib/shared/widgets/lists/list_dialogs.dart @@ -5,6 +5,21 @@ /// Licensed under the GNU General Public License, Version 3 (the "License"). /// /// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/shared/widgets/lists/list_item_card.dart b/lib/shared/widgets/lists/list_item_card.dart index 13e9c6f..c30198a 100644 --- a/lib/shared/widgets/lists/list_item_card.dart +++ b/lib/shared/widgets/lists/list_item_card.dart @@ -5,6 +5,21 @@ /// Licensed under the GNU General Public License, Version 3 (the "License"). /// /// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/shared/widgets/lists/list_sharing_handler.dart b/lib/shared/widgets/lists/list_sharing_handler.dart index fc648f8..ba70151 100644 --- a/lib/shared/widgets/lists/list_sharing_handler.dart +++ b/lib/shared/widgets/lists/list_sharing_handler.dart @@ -5,6 +5,21 @@ /// Licensed under the GNU General Public License, Version 3 (the "License"). /// /// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/utils/api_key_save_helper.dart b/lib/utils/api_key_save_helper.dart index eb42369..8e582e6 100644 --- a/lib/utils/api_key_save_helper.dart +++ b/lib/utils/api_key_save_helper.dart @@ -5,6 +5,21 @@ /// Licensed under the GNU General Public License, Version 3 (the "License"). /// /// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/utils/serializer.dart b/lib/utils/serializer.dart index 47dca83..4bf7404 100644 --- a/lib/utils/serializer.dart +++ b/lib/utils/serializer.dart @@ -1,13 +1,25 @@ /// Facade maintaining backward compatibility for TurtleSerializer. /// -/// This class delegates to specialized serializers while preserving. -/// the exact same API as the original monolithic TurtleSerializer. -/// /// Copyright (C) 2025, Software Innovation Institute, ANU. /// /// Licensed under the GNU General Public License, Version 3 (the "License"). /// /// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Ashley Tang, Kevin Wang library; diff --git a/lib/utils/sort_preference_service.dart b/lib/utils/sort_preference_service.dart new file mode 100644 index 0000000..ea01878 --- /dev/null +++ b/lib/utils/sort_preference_service.dart @@ -0,0 +1,61 @@ +/// Persistence service for per-column / per-screen sort preferences. +/// +/// Copyright (C) 2025, Software Innovation Institute, ANU. +/// +/// Licensed under the GNU General Public License, Version 3 (the "License"). +/// +/// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Tony Chen + +library; + +import 'package:shared_preferences/shared_preferences.dart'; + +import 'package:moviestar/widgets/sort_controls.dart'; + +/// Persists and retrieves [MovieSortCriteria] selections using +/// [SharedPreferences] so they survive app restarts. + +class SortPreferenceService { + static const String _prefix = 'sort_pref_'; + + /// Saves the chosen [criteria] for [columnId]. + + static Future save( + String columnId, + MovieSortCriteria criteria, + ) async { + final prefs = await SharedPreferences.getInstance(); + await prefs.setString('$_prefix$columnId', criteria.name); + } + + /// Loads the previously saved criteria for [columnId]. + /// Returns [fallback] when nothing has been persisted yet. + + static Future load( + String columnId, { + MovieSortCriteria fallback = MovieSortCriteria.nameAsc, + }) async { + final prefs = await SharedPreferences.getInstance(); + final stored = prefs.getString('$_prefix$columnId'); + if (stored == null) return fallback; + return MovieSortCriteria.values.firstWhere( + (c) => c.name == stored, + orElse: () => fallback, + ); + } +} diff --git a/lib/widgets/movie_kanban_board.dart b/lib/widgets/movie_kanban_board.dart index af9dee3..b2a5af3 100644 --- a/lib/widgets/movie_kanban_board.dart +++ b/lib/widgets/movie_kanban_board.dart @@ -5,6 +5,21 @@ /// Licensed under the GNU General Public License, Version 3 (the "License"). /// /// License: https://opensource.org/license/gpl-3-0. +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later +// version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +// details. +// +// You should have received a copy of the GNU General Public License along with +// this program. If not, see . +/// +/// Authors: Kevin Wang. library; @@ -58,6 +73,7 @@ class _MovieKanbanBoardState extends ConsumerState { super.initState(); _horizontalScrollController = ScrollController(); _kanbanController = KanbanBoardController(); + _kanbanController.loadSortPreferences(); _searchController = KanbanSearchController(); _settingsController = KanbanSettingsController();