diff --git a/lib/models/preference.dart b/lib/models/preference.dart index 66dd9c0..b8aaf23 100644 --- a/lib/models/preference.dart +++ b/lib/models/preference.dart @@ -1,3 +1,4 @@ +import 'dart:collection'; import 'dart:io'; import 'package:equatable/equatable.dart'; @@ -13,26 +14,29 @@ abstract class Preference extends Equatable with SettingsDisplayable { Preference copyWith({required T? val}); - static List> allPreferences = >[ - // Order of these first three preferences does not matter. - FetchModePreference(), - CommentsOrderPreference(), - FontSizePreference(), - TabOrderPreference(), - // Order of items below matters and - // reflects the order on settings screen. - const DisplayModePreference(), - const MetadataModePreference(), - const StoryUrlModePreference(), - const NotificationModePreference(), - const SwipeGesturePreference(), - const CollapseModePreference(), - NavigationModePreference(), - const ReaderModePreference(), - const MarkReadStoriesModePreference(), - const EyeCandyModePreference(), - const TrueDarkModePreference(), - ]; + static final List> allPreferences = + UnmodifiableListView>( + >[ + // Order of these first four preferences does not matter. + FetchModePreference(), + CommentsOrderPreference(), + FontSizePreference(), + TabOrderPreference(), + // Order of items below matters and + // reflects the order on settings screen. + const DisplayModePreference(), + const MetadataModePreference(), + const StoryUrlModePreference(), + const NotificationModePreference(), + const SwipeGesturePreference(), + const CollapseModePreference(), + NavigationModePreference(), + const ReaderModePreference(), + const MarkReadStoriesModePreference(), + const EyeCandyModePreference(), + const TrueDarkModePreference(), + ], + ); @override List get props => [key]; diff --git a/pubspec.yaml b/pubspec.yaml index 39d9cca..918ee6b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: hacki description: A Hacker News reader. -version: 1.0.5+83 +version: 1.0.6+84 publish_to: none environment: