1
1
import 'package:flutter/material.dart' ;
2
2
import 'package:flutter_bloc/flutter_bloc.dart' ;
3
3
import 'package:ht_dashboard/app_configuration/bloc/app_configuration_bloc.dart' ;
4
+ import 'package:ht_dashboard/l10n/app_localizations.dart' ;
4
5
import 'package:ht_dashboard/l10n/l10n.dart' ;
5
6
import 'package:ht_dashboard/shared/constants/app_spacing.dart' ;
6
7
import 'package:ht_dashboard/shared/widgets/widgets.dart' ;
@@ -772,8 +773,8 @@ class _UserPreferenceLimitsFormState extends State<_UserPreferenceLimitsForm> {
772
773
children: [
773
774
widget.buildIntField (
774
775
context,
775
- label: l10n.followedItemsLimitLabel ,
776
- description: l10n.followedItemsLimitDescription ,
776
+ label: _getFollowedItemsLimitLabel ( l10n) ,
777
+ description: _getFollowedItemsLimitDescription ( l10n) ,
777
778
value: _getFollowedItemsLimit (userPreferenceConfig),
778
779
onChanged: (value) {
779
780
widget.onConfigChanged (
@@ -789,8 +790,8 @@ class _UserPreferenceLimitsFormState extends State<_UserPreferenceLimitsForm> {
789
790
),
790
791
widget.buildIntField (
791
792
context,
792
- label: l10n.savedHeadlinesLimitLabel ,
793
- description: l10n.savedHeadlinesLimitDescription ,
793
+ label: _getSavedHeadlinesLimitLabel ( l10n) ,
794
+ description: _getSavedHeadlinesLimitDescription ( l10n) ,
794
795
value: _getSavedHeadlinesLimit (userPreferenceConfig),
795
796
onChanged: (value) {
796
797
widget.onConfigChanged (
@@ -808,6 +809,50 @@ class _UserPreferenceLimitsFormState extends State<_UserPreferenceLimitsForm> {
808
809
);
809
810
}
810
811
812
+ String _getFollowedItemsLimitLabel (AppLocalizations l10n) {
813
+ switch (widget.userRole) {
814
+ case AppUserRole .guestUser:
815
+ return l10n.guestFollowedItemsLimitLabel;
816
+ case AppUserRole .standardUser:
817
+ return l10n.standardUserFollowedItemsLimitLabel;
818
+ case AppUserRole .premiumUser:
819
+ return l10n.premiumFollowedItemsLimitLabel;
820
+ }
821
+ }
822
+
823
+ String _getFollowedItemsLimitDescription (AppLocalizations l10n) {
824
+ switch (widget.userRole) {
825
+ case AppUserRole .guestUser:
826
+ return l10n.guestFollowedItemsLimitDescription;
827
+ case AppUserRole .standardUser:
828
+ return l10n.standardUserFollowedItemsLimitDescription;
829
+ case AppUserRole .premiumUser:
830
+ return l10n.premiumFollowedItemsLimitDescription;
831
+ }
832
+ }
833
+
834
+ String _getSavedHeadlinesLimitLabel (AppLocalizations l10n) {
835
+ switch (widget.userRole) {
836
+ case AppUserRole .guestUser:
837
+ return l10n.guestSavedHeadlinesLimitLabel;
838
+ case AppUserRole .standardUser:
839
+ return l10n.standardUserSavedHeadlinesLimitLabel;
840
+ case AppUserRole .premiumUser:
841
+ return l10n.premiumSavedHeadlinesLimitLabel;
842
+ }
843
+ }
844
+
845
+ String _getSavedHeadlinesLimitDescription (AppLocalizations l10n) {
846
+ switch (widget.userRole) {
847
+ case AppUserRole .guestUser:
848
+ return l10n.guestSavedHeadlinesLimitDescription;
849
+ case AppUserRole .standardUser:
850
+ return l10n.standardUserSavedHeadlinesLimitDescription;
851
+ case AppUserRole .premiumUser:
852
+ return l10n.premiumSavedHeadlinesLimitDescription;
853
+ }
854
+ }
855
+
811
856
int _getFollowedItemsLimit (UserPreferenceConfig config) {
812
857
switch (widget.userRole) {
813
858
case AppUserRole .guestUser:
@@ -1212,9 +1257,7 @@ class _AccountActionConfigFormState extends State<_AccountActionConfigForm> {
1212
1257
return widget.buildIntField (
1213
1258
context,
1214
1259
label: _formatLabel (actionType.name, l10n),
1215
- description: l10n.daysBetweenPromptDescription (
1216
- actionType: actionType.name,
1217
- ),
1260
+ description: l10n.daysBetweenPromptDescription (actionType.name),
1218
1261
value: _getDaysMap (accountActionConfig)[actionType] ?? 0 ,
1219
1262
onChanged: (value) {
1220
1263
final currentMap = _getDaysMap (accountActionConfig);
0 commit comments