From 9e0c719018404a545026f98bf2c72dd6e0cd19d6 Mon Sep 17 00:00:00 2001 From: fulleni Date: Mon, 3 Nov 2025 10:15:00 +0100 Subject: [PATCH 1/9] build(core): override core package version - Update core package ref to e7c808c9d459233196e2eac3137a9c87d3976af3 - Add dependency_override to pubspec.yaml to ensure consistent version --- pubspec.lock | 4 ++-- pubspec.yaml | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index 26b8991c..0be2278e 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -89,8 +89,8 @@ packages: dependency: "direct main" description: path: "." - ref: "v1.3.1" - resolved-ref: a03efff11b7577974cb444a1a6a46fee8b05ea42 + ref: e7c808c9d459233196e2eac3137a9c87d3976af3 + resolved-ref: e7c808c9d459233196e2eac3137a9c87d3976af3 url: "https://github.com/flutter-news-app-full-source-code/core.git" source: git version: "1.3.1" diff --git a/pubspec.yaml b/pubspec.yaml index 6c8cb8e9..c9075394 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -89,3 +89,9 @@ dev_dependencies: flutter: uses-material-design: true generate: true + +dependency_overrides: + core: + git: + url: https://github.com/flutter-news-app-full-source-code/core.git + ref: e7c808c9d459233196e2eac3137a9c87d3976af3 \ No newline at end of file From 782c1864a3c3689c6e60dec05a8909fa26c0724b Mon Sep 17 00:00:00 2001 From: fulleni Date: Mon, 3 Nov 2025 10:15:19 +0100 Subject: [PATCH 2/9] refactor: remove local ad platform type - Remove case AdPlatformType.local from AdPlatformTypeL10n extension - This change simplifies the ad platform type localization by removing the local option --- lib/shared/extensions/ad_platform_type_l10n.dart | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/shared/extensions/ad_platform_type_l10n.dart b/lib/shared/extensions/ad_platform_type_l10n.dart index b7971179..fb52d57b 100644 --- a/lib/shared/extensions/ad_platform_type_l10n.dart +++ b/lib/shared/extensions/ad_platform_type_l10n.dart @@ -10,8 +10,6 @@ extension AdPlatformTypeL10n on AdPlatformType { switch (this) { case AdPlatformType.admob: return l10n.adPlatformTypeAdmob; - case AdPlatformType.local: - return l10n.adPlatformTypeLocal; case AdPlatformType.demo: throw UnimplementedError( 'Demo ad platform type is not intended for dashboard usage, rather for mobile client, demo env specific usecase.', From a36b6f2a5b23f404fdff530d0f6fc2bd61005303 Mon Sep 17 00:00:00 2001 From: fulleni Date: Mon, 3 Nov 2025 10:17:05 +0100 Subject: [PATCH 3/9] refactor(shared): remove unused LocalAdX extension - Remove LocalAdX extension from local_ad_to_ad_type.dart - Remove export of local_ad_to_ad_type.dart from extensions.dart - Delete local_ad_to_ad_type.dart file --- lib/shared/extensions/extensions.dart | 1 - .../extensions/local_ad_to_ad_type.dart | 23 ------------------- 2 files changed, 24 deletions(-) delete mode 100644 lib/shared/extensions/local_ad_to_ad_type.dart diff --git a/lib/shared/extensions/extensions.dart b/lib/shared/extensions/extensions.dart index 8056f646..9987aa14 100644 --- a/lib/shared/extensions/extensions.dart +++ b/lib/shared/extensions/extensions.dart @@ -6,6 +6,5 @@ export 'content_status_l10n.dart'; export 'dashboard_user_role_l10n.dart'; export 'feed_decorator_type_l10n.dart'; export 'in_article_ad_slot_type_l10n.dart'; -export 'local_ad_to_ad_type.dart'; export 'source_type_l10n.dart'; export 'string_truncate.dart'; diff --git a/lib/shared/extensions/local_ad_to_ad_type.dart b/lib/shared/extensions/local_ad_to_ad_type.dart deleted file mode 100644 index cb6e6e4d..00000000 --- a/lib/shared/extensions/local_ad_to_ad_type.dart +++ /dev/null @@ -1,23 +0,0 @@ -import 'package:core/core.dart'; - -/// Extension on [LocalAd] to provide a convenient way to get its [AdType]. -extension LocalAdX on LocalAd { - /// Converts the [LocalAd]'s `adType` string to an [AdType] enum value. - /// - /// Throws a [FormatException] if the `adType` string does not correspond - /// to a valid [AdType] enum value. - AdType toAdType() { - switch (adType) { - case 'native': - return AdType.native; - case 'banner': - return AdType.banner; - case 'interstitial': - return AdType.interstitial; - case 'video': - return AdType.video; - default: - throw FormatException('Unknown AdType for LocalAd: $adType'); - } - } -} From ea79e9b8c481e23af72c1bad859c6fbe0aeb048c Mon Sep 17 00:00:00 2001 From: fulleni Date: Mon, 3 Nov 2025 10:26:49 +0100 Subject: [PATCH 4/9] refactor(l10n): remove unused ad platform type localizations - Remove "adPlatformTypeLocal" and its description from app_ar.arb and app_en.arb - This change reflects the removal of the unused LocalAds platform type --- lib/l10n/app_localizations.dart | 6 ------ lib/l10n/app_localizations_ar.dart | 3 --- lib/l10n/app_localizations_en.dart | 3 --- lib/l10n/arb/app_ar.arb | 4 ---- lib/l10n/arb/app_en.arb | 4 ---- 5 files changed, 20 deletions(-) diff --git a/lib/l10n/app_localizations.dart b/lib/l10n/app_localizations.dart index 24286ca6..ddae4859 100644 --- a/lib/l10n/app_localizations.dart +++ b/lib/l10n/app_localizations.dart @@ -2174,12 +2174,6 @@ abstract class AppLocalizations { /// **'AdMob'** String get adPlatformTypeAdmob; - /// The name of the Local ad platform for custom ads. - /// - /// In en, this message translates to: - /// **'Local'** - String get adPlatformTypeLocal; - /// Tab title for Native Ads in local ads management. /// /// In en, this message translates to: diff --git a/lib/l10n/app_localizations_ar.dart b/lib/l10n/app_localizations_ar.dart index 4474ee61..83a758c5 100644 --- a/lib/l10n/app_localizations_ar.dart +++ b/lib/l10n/app_localizations_ar.dart @@ -1163,9 +1163,6 @@ class AppLocalizationsAr extends AppLocalizations { @override String get adPlatformTypeAdmob => 'أدموب'; - @override - String get adPlatformTypeLocal => 'محلي'; - @override String get nativeAdsTab => 'إعلانات أصلية'; diff --git a/lib/l10n/app_localizations_en.dart b/lib/l10n/app_localizations_en.dart index 6335f4bc..2aceca0c 100644 --- a/lib/l10n/app_localizations_en.dart +++ b/lib/l10n/app_localizations_en.dart @@ -1162,9 +1162,6 @@ class AppLocalizationsEn extends AppLocalizations { @override String get adPlatformTypeAdmob => 'AdMob'; - @override - String get adPlatformTypeLocal => 'Local'; - @override String get nativeAdsTab => 'Native Ads'; diff --git a/lib/l10n/arb/app_ar.arb b/lib/l10n/arb/app_ar.arb index 94b23dfd..c43b11b7 100644 --- a/lib/l10n/arb/app_ar.arb +++ b/lib/l10n/arb/app_ar.arb @@ -1448,10 +1448,6 @@ "@adPlatformTypeAdmob": { "description": "اسم منصة إعلانات أدموب." }, - "adPlatformTypeLocal": "محلي", - "@adPlatformTypeLocal": { - "description": "اسم منصة الإعلانات المحلية للإعلانات المخصصة." - }, "nativeAdsTab": "إعلانات أصلية", "@nativeAdsTab": { "description": "عنوان تبويب الإعلانات الأصلية في إدارة الإعلانات المحلية." diff --git a/lib/l10n/arb/app_en.arb b/lib/l10n/arb/app_en.arb index 825f04a2..31b4f90a 100644 --- a/lib/l10n/arb/app_en.arb +++ b/lib/l10n/arb/app_en.arb @@ -1448,10 +1448,6 @@ "@adPlatformTypeAdmob": { "description": "The name of the AdMob ad platform." }, - "adPlatformTypeLocal": "Local", - "@adPlatformTypeLocal": { - "description": "The name of the Local ad platform for custom ads." - }, "nativeAdsTab": "Native Ads", "@nativeAdsTab": { "description": "Tab title for Native Ads in local ads management." From 4d285c89d87feb5b733d893d396a0398cf9a8407 Mon Sep 17 00:00:00 2001 From: fulleni Date: Mon, 3 Nov 2025 10:42:48 +0100 Subject: [PATCH 5/9] fix(bootstrap): load users fixtures data in demo mode - Replace empty initial data with usersFixturesData in DataInMemory for User - Ensure demo mode has predefined user data for better demonstration --- lib/bootstrap.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bootstrap.dart b/lib/bootstrap.dart index 79080172..6581e2f3 100644 --- a/lib/bootstrap.dart +++ b/lib/bootstrap.dart @@ -123,7 +123,7 @@ Future bootstrap( usersClient = DataInMemory( toJson: (i) => i.toJson(), getId: (i) => i.id, - // No initial data for users in demo mode. + initialData: usersFixturesData, logger: Logger('DataInMemory'), ); } else { From a18889dc5c37f3c5339793fc472b835367c19679 Mon Sep 17 00:00:00 2001 From: fulleni Date: Mon, 3 Nov 2025 11:23:16 +0100 Subject: [PATCH 6/9] build(auth_inmemory): update to version 1.1.0 - Update auth_inmemory dependency from v1.0.1 to v1.1.0 - Update corresponding ref in pubspec.lock --- pubspec.lock | 6 +++--- pubspec.yaml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index 0be2278e..e407de84 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -31,11 +31,11 @@ packages: dependency: "direct main" description: path: "." - ref: "v1.0.1" - resolved-ref: b999691989447aff05a936414e6f6fdfbbb73a07 + ref: "v1.1.0" + resolved-ref: a37ed3cc6e305b1285a77619b1d7272b42517ea9 url: "https://github.com/flutter-news-app-full-source-code/auth-inmemory" source: git - version: "1.0.1" + version: "1.1.0" auth_repository: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index c9075394..4f6e22ce 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -19,7 +19,7 @@ dependencies: auth_inmemory: git: url: https://github.com/flutter-news-app-full-source-code/auth-inmemory - ref: v1.0.1 + ref: v1.1.0 auth_repository: git: url: https://github.com/flutter-news-app-full-source-code/auth-repository.git From 1f1274dc272b89a85c873facf8705fff60666f15 Mon Sep 17 00:00:00 2001 From: fulleni Date: Mon, 3 Nov 2025 11:29:28 +0100 Subject: [PATCH 7/9] feat(localization): update demo email hint with new email - Modify the demo email hint text to include an additional email address - This change enhances the onboarding experience for new users by providing more examples --- lib/authentication/view/request_code_page.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/authentication/view/request_code_page.dart b/lib/authentication/view/request_code_page.dart index efe82332..bce793db 100644 --- a/lib/authentication/view/request_code_page.dart +++ b/lib/authentication/view/request_code_page.dart @@ -145,7 +145,7 @@ class _RequestCodeView extends StatelessWidget { top: AppSpacing.lg, ), child: Text( - l10n.demoEmailHint('admin@example.com'), + l10n.demoEmailHint('admin@example.com | publisher@example.com'), style: textTheme.bodyMedium?.copyWith( color: colorScheme.secondary, fontWeight: FontWeight.bold, From 795135aa5195fcfee339fccf28acc846762f8e66 Mon Sep 17 00:00:00 2001 From: fulleni Date: Mon, 3 Nov 2025 11:29:52 +0100 Subject: [PATCH 8/9] style: format --- lib/app_configuration/widgets/ad_platform_config_form.dart | 2 +- lib/authentication/view/request_code_page.dart | 4 +++- lib/router/router.dart | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/app_configuration/widgets/ad_platform_config_form.dart b/lib/app_configuration/widgets/ad_platform_config_form.dart index de64075d..5c8024db 100644 --- a/lib/app_configuration/widgets/ad_platform_config_form.dart +++ b/lib/app_configuration/widgets/ad_platform_config_form.dart @@ -299,7 +299,7 @@ class _AdPlatformConfigFormState extends State { ), ], ), - const SizedBox(height: AppSpacing.lg), + const SizedBox(height: AppSpacing.lg), ], ); } diff --git a/lib/authentication/view/request_code_page.dart b/lib/authentication/view/request_code_page.dart index bce793db..d7b6acf5 100644 --- a/lib/authentication/view/request_code_page.dart +++ b/lib/authentication/view/request_code_page.dart @@ -145,7 +145,9 @@ class _RequestCodeView extends StatelessWidget { top: AppSpacing.lg, ), child: Text( - l10n.demoEmailHint('admin@example.com | publisher@example.com'), + l10n.demoEmailHint( + 'admin@example.com | publisher@example.com', + ), style: textTheme.bodyMedium?.copyWith( color: colorScheme.secondary, fontWeight: FontWeight.bold, diff --git a/lib/router/router.dart b/lib/router/router.dart index 09a55334..9ef24c32 100644 --- a/lib/router/router.dart +++ b/lib/router/router.dart @@ -117,7 +117,7 @@ GoRouter createRouter({ }) .whereType() .toList(); - + // Check if the destination path starts with any of the authorized base // paths, or if it's the universally accessible settings page. final isAuthorized = From 4fccaf132280d236279797e97ac01f2d6481811a Mon Sep 17 00:00:00 2001 From: fulleni Date: Mon, 3 Nov 2025 11:33:55 +0100 Subject: [PATCH 9/9] build(dependencies): add override for core dependency - Add dependency override for core package version 1.3.1 - Include TODO comment for future removal when newer version is released - This change supports the removal of LocalAd functionality --- pubspec.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pubspec.yaml b/pubspec.yaml index 4f6e22ce..11fa1410 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -91,6 +91,8 @@ flutter: generate: true dependency_overrides: + # TODO: Remove this override when core version > 1.3.1 is released. + # This is needed for the removal of LocalAd. core: git: url: https://github.com/flutter-news-app-full-source-code/core.git