File tree Expand file tree Collapse file tree 3 files changed +21
-0
lines changed
app_configuration/widgets Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 11import 'package:core/core.dart' ;
22import 'package:flutter/material.dart' ;
3+ import 'package:flutter_news_app_web_dashboard_full_source_code/l10n/app_localizations.dart' ;
34import 'package:flutter_news_app_web_dashboard_full_source_code/l10n/l10n.dart' ;
45import 'package:flutter_news_app_web_dashboard_full_source_code/shared/extensions/push_notification_provider_l10n.dart' ;
56import 'package:flutter_news_app_web_dashboard_full_source_code/shared/extensions/push_notification_subscription_delivery_type_l10n.dart' ;
Original file line number Diff line number Diff line change @@ -6,5 +6,7 @@ export 'content_status_l10n.dart';
66export 'dashboard_user_role_l10n.dart' ;
77export 'feed_decorator_type_l10n.dart' ;
88export 'in_article_ad_slot_type_l10n.dart' ;
9+ export 'push_notification_provider_l10n.dart' ;
10+ export 'push_notification_subscription_delivery_type_l10n.dart' ;
911export 'source_type_l10n.dart' ;
1012export 'string_truncate.dart' ;
Original file line number Diff line number Diff line change 1+ import 'package:core/core.dart' ;
2+ import 'package:flutter/material.dart' ;
3+ import 'package:flutter_news_app_web_dashboard_full_source_code/l10n/l10n.dart' ;
4+
5+ /// Extension to localize the [PushNotificationProvider] enum.
6+ extension PushNotificationProviderL10n on PushNotificationProvider {
7+ /// Returns the localized string representation of the
8+ /// [PushNotificationProvider] .
9+ String l10n (BuildContext context) {
10+ final l10n = AppLocalizationsX (context).l10n;
11+ switch (this ) {
12+ case PushNotificationProvider .firebase:
13+ return l10n.pushNotificationProviderFirebase;
14+ case PushNotificationProvider .oneSignal:
15+ return l10n.pushNotificationProviderOneSignal;
16+ }
17+ }
18+ }
You can’t perform that action at this time.
0 commit comments