Skip to content

Commit c3d7971

Browse files
committed
fix(shared): resolve naming conflict with UiKitLocalizations
- Hide UiKitLocalizations from ui_kit package to avoid conflict - Replace context.l10n with AppLocalizationsX(context).l10n for consistent localization - Update localized strings for content limitation views
1 parent e8a85a9 commit c3d7971

File tree

1 file changed

+14
-25
lines changed

1 file changed

+14
-25
lines changed

lib/shared/widgets/content_limitation_bottom_sheet.dart

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import 'package:flutter_news_app_mobile_client_full_source_code/l10n/l10n.dart';
33
import 'package:flutter_news_app_mobile_client_full_source_code/router/routes.dart';
44
import 'package:flutter_news_app_mobile_client_full_source_code/shared/services/content_limitation_service.dart';
55
import 'package:go_router/go_router.dart';
6-
import 'package:ui_kit/ui_kit.dart';
6+
import 'package:ui_kit/ui_kit.dart' hide UiKitLocalizations;
77

88
/// {@template content_limitation_bottom_sheet}
99
/// A bottom sheet that informs the user about content limitations and provides
@@ -40,16 +40,13 @@ class _AnonymousLimitView extends StatelessWidget {
4040

4141
@override
4242
Widget build(BuildContext context) {
43-
final l10n = context.l10n;
43+
final l10n = AppLocalizationsX(context).l10n;
4444
final theme = Theme.of(context);
4545

4646
return _BaseLimitView(
4747
icon: Icons.person_add_alt_1_outlined,
48-
// TODO(fulleni): Add l10n.anonymousLimitTitle
49-
title: 'Sign in to Save More',
50-
// TODO(fulleni): Add l10n.anonymousLimitBody
51-
body:
52-
'Create a free account to save and follow unlimited topics, sources, and countries.',
48+
title: l10n.anonymousLimitTitle,
49+
body: l10n.anonymousLimitBody,
5350
child: ElevatedButton(
5451
onPressed: () {
5552
// Pop the bottom sheet first.
@@ -60,8 +57,7 @@ class _AnonymousLimitView extends StatelessWidget {
6057
style: ElevatedButton.styleFrom(
6158
minimumSize: const Size.fromHeight(AppSpacing.xxl + AppSpacing.sm),
6259
),
63-
// TODO(fulleni): Add l10n.anonymousLimitButton
64-
child: const Text('Sign In & Link Account'),
60+
child: Text(l10n.anonymousLimitButton),
6561
),
6662
);
6763
}
@@ -73,25 +69,21 @@ class _StandardUserLimitView extends StatelessWidget {
7369

7470
@override
7571
Widget build(BuildContext context) {
76-
final l10n = context.l10n;
72+
final l10n = AppLocalizationsX(context).l10n;
7773
final theme = Theme.of(context);
7874

7975
return _BaseLimitView(
8076
icon: Icons.workspace_premium_outlined,
81-
// TODO(fulleni): Add l10n.standardLimitTitle
82-
title: 'Unlock Unlimited Access',
83-
// TODO(fulleni): Add l10n.standardLimitBody
84-
body:
85-
"You've reached your limit for the free plan. Upgrade to save and follow more.",
77+
title: l10n.standardLimitTitle,
78+
body: l10n.standardLimitBody,
8679
child: ElevatedButton(
8780
// TODO(fulleni): Implement account upgrade flow.
8881
// The upgrade flow is not yet implemented, so the button is disabled.
8982
onPressed: null,
9083
style: ElevatedButton.styleFrom(
9184
minimumSize: const Size.fromHeight(AppSpacing.xxl + AppSpacing.sm),
9285
),
93-
// TODO(fulleni): Add l10n.standardLimitButton
94-
child: const Text('Upgrade to Premium'),
86+
child: Text(l10n.standardLimitButton),
9587
),
9688
);
9789
}
@@ -103,16 +95,14 @@ class _PremiumUserLimitView extends StatelessWidget {
10395

10496
@override
10597
Widget build(BuildContext context) {
106-
final l10n = context.l10n;
98+
final l10n = AppLocalizationsX(context).l10n;
99+
107100
final theme = Theme.of(context);
108101

109102
return _BaseLimitView(
110103
icon: Icons.inventory_2_outlined,
111-
// TODO(fulleni): Add l10n.premiumLimitTitle
112-
title: "You've Reached the Limit",
113-
// TODO(fulleni): Add l10n.premiumLimitBody
114-
body:
115-
'To add new items, please review and manage your existing saved and followed content.',
104+
title: l10n.premiumLimitTitle,
105+
body: l10n.premiumLimitBody,
116106
child: ElevatedButton(
117107
onPressed: () {
118108
// Pop the bottom sheet first.
@@ -123,8 +113,7 @@ class _PremiumUserLimitView extends StatelessWidget {
123113
style: ElevatedButton.styleFrom(
124114
minimumSize: const Size.fromHeight(AppSpacing.xxl + AppSpacing.sm),
125115
),
126-
// TODO(fulleni): Add l10n.premiumLimitButton
127-
child: const Text('Manage My Content'),
116+
child: Text(l10n.premiumLimitButton),
128117
),
129118
);
130119
}

0 commit comments

Comments
 (0)