From 9fb4ba621b6253b3338d307fe23030782d03fe36 Mon Sep 17 00:00:00 2001 From: Phuoc Nguyen Date: Wed, 3 Dec 2025 09:04:35 +0700 Subject: [PATCH] fix --- lib/features/favorites/USAGE_EXAMPLES.md | 2 +- .../presentation/pages/favorites_page.dart | 8 +- .../widgets/promotion_slider.dart | 4 +- .../presentation/pages/news_detail_page.dart | 4 +- .../widgets/featured_news_card.dart | 2 +- .../news/presentation/widgets/news_card.dart | 2 +- .../widgets/related_article_card.dart | 2 +- .../pages/notifications_page.dart | 2 +- .../pages/payment_detail_page.dart | 2 +- .../presentation/pages/payment_qr_page.dart | 2 +- .../presentation/pages/payments_page.dart | 2 +- .../presentation/pages/price_policy_page.dart | 2 +- .../pages/submission_create_page.dart | 4 +- .../presentation/pages/submissions_page.dart | 2 +- .../pages/promotion_detail_page.dart | 4 +- .../presentation/pages/promotions_page.dart | 2 +- .../presentation/widgets/promotion_card.dart | 2 +- .../pages/design_request_detail_page.dart | 4 +- .../pages/model_house_detail_page.dart | 4 +- .../presentation/pages/model_houses_page.dart | 6 +- pubspec.lock | 80 +++++++++++++++++++ pubspec.yaml | 5 ++ 22 files changed, 116 insertions(+), 31 deletions(-) diff --git a/lib/features/favorites/USAGE_EXAMPLES.md b/lib/features/favorites/USAGE_EXAMPLES.md index 5960e75..25da131 100644 --- a/lib/features/favorites/USAGE_EXAMPLES.md +++ b/lib/features/favorites/USAGE_EXAMPLES.md @@ -368,7 +368,7 @@ class FavoriteProductsList extends ConsumerWidget { ); }, ), - loading: () => const const CustomLoadingIndicator(), + loading: () => const CustomLoadingIndicator(), error: (error, stack) => Text('Error: $error'), ); } diff --git a/lib/features/favorites/presentation/pages/favorites_page.dart b/lib/features/favorites/presentation/pages/favorites_page.dart index dd862b4..46d8b35 100644 --- a/lib/features/favorites/presentation/pages/favorites_page.dart +++ b/lib/features/favorites/presentation/pages/favorites_page.dart @@ -303,14 +303,14 @@ class FavoritesPage extends HookConsumerWidget { }, child: _FavoritesGrid(products: previousValue), ), - const Positioned( + Positioned( top: 16, left: 0, right: 0, child: Center( child: Card( child: Padding( - padding: EdgeInsets.symmetric( + padding: const EdgeInsets.symmetric( horizontal: 16.0, vertical: 8.0, ), @@ -322,8 +322,8 @@ class FavoritesPage extends HookConsumerWidget { height: 16, child: CustomLoadingIndicator(color: colorScheme.primary, size: 20), ), - SizedBox(width: 8), - Text('Đang tải...'), + const SizedBox(width: 8), + const Text('Đang tải...'), ], ), ), diff --git a/lib/features/home/presentation/widgets/promotion_slider.dart b/lib/features/home/presentation/widgets/promotion_slider.dart index 37c040a..32327eb 100644 --- a/lib/features/home/presentation/widgets/promotion_slider.dart +++ b/lib/features/home/presentation/widgets/promotion_slider.dart @@ -5,11 +5,11 @@ library; import 'package:cached_network_image/cached_network_image.dart'; -import 'package:worker/core/widgets/loading_indicator.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:go_router/go_router.dart'; import 'package:worker/core/router/app_router.dart'; +import 'package:worker/core/widgets/loading_indicator.dart'; import 'package:worker/features/home/domain/entities/promotion.dart'; /// Promotion Slider Widget @@ -127,7 +127,7 @@ class _PromotionCard extends StatelessWidget { placeholder: (context, url) => Container( height: 140, color: colorScheme.surfaceContainerHighest, - child: const const CustomLoadingIndicator(), + child: const CustomLoadingIndicator(), ), errorWidget: (context, url, error) => Container( height: 140, diff --git a/lib/features/news/presentation/pages/news_detail_page.dart b/lib/features/news/presentation/pages/news_detail_page.dart index 60c75a2..4944b00 100644 --- a/lib/features/news/presentation/pages/news_detail_page.dart +++ b/lib/features/news/presentation/pages/news_detail_page.dart @@ -61,7 +61,7 @@ class _NewsDetailPageState extends ConsumerState { } return _buildContent(context, article); }, - loading: () => const const CustomLoadingIndicator(), + loading: () => const CustomLoadingIndicator(), error: (error, stack) => _buildErrorState(context, error.toString()), ), ); @@ -127,7 +127,7 @@ class _NewsDetailPageState extends ConsumerState { placeholder: (context, url) => Container( height: 250, color: colorScheme.surfaceContainerHighest, - child: const const CustomLoadingIndicator(), + child: const CustomLoadingIndicator(), ), errorWidget: (context, url, error) => Container( height: 250, diff --git a/lib/features/news/presentation/widgets/featured_news_card.dart b/lib/features/news/presentation/widgets/featured_news_card.dart index f2ac623..54512ac 100644 --- a/lib/features/news/presentation/widgets/featured_news_card.dart +++ b/lib/features/news/presentation/widgets/featured_news_card.dart @@ -66,7 +66,7 @@ class FeaturedNewsCard extends StatelessWidget { placeholder: (context, url) => Container( height: 200, color: colorScheme.surfaceContainerHighest, - child: const const CustomLoadingIndicator(), + child: const CustomLoadingIndicator(), ), errorWidget: (context, url, error) => Container( height: 200, diff --git a/lib/features/news/presentation/widgets/news_card.dart b/lib/features/news/presentation/widgets/news_card.dart index a51027d..f04f87d 100644 --- a/lib/features/news/presentation/widgets/news_card.dart +++ b/lib/features/news/presentation/widgets/news_card.dart @@ -58,7 +58,7 @@ class NewsCard extends StatelessWidget { width: 80, height: 80, color: colorScheme.surfaceContainerHighest, - child: const Center( + child: Center( child: SizedBox( width: 20, height: 20, diff --git a/lib/features/news/presentation/widgets/related_article_card.dart b/lib/features/news/presentation/widgets/related_article_card.dart index 78f3211..250f083 100644 --- a/lib/features/news/presentation/widgets/related_article_card.dart +++ b/lib/features/news/presentation/widgets/related_article_card.dart @@ -57,7 +57,7 @@ class RelatedArticleCard extends StatelessWidget { width: 60, height: 60, color: colorScheme.surfaceContainerHighest, - child: const Center( + child: Center( child: SizedBox( width: 16, height: 16, diff --git a/lib/features/notifications/presentation/pages/notifications_page.dart b/lib/features/notifications/presentation/pages/notifications_page.dart index 9d42188..a32adb1 100644 --- a/lib/features/notifications/presentation/pages/notifications_page.dart +++ b/lib/features/notifications/presentation/pages/notifications_page.dart @@ -53,7 +53,7 @@ class NotificationsPage extends HookConsumerWidget { notifications, selectedCategory, ), - loading: () => const const CustomLoadingIndicator(), + loading: () => const CustomLoadingIndicator(), error: (error, stack) => _buildErrorState(ref, selectedCategory), ), diff --git a/lib/features/orders/presentation/pages/payment_detail_page.dart b/lib/features/orders/presentation/pages/payment_detail_page.dart index 5e4a44a..e7e99e1 100644 --- a/lib/features/orders/presentation/pages/payment_detail_page.dart +++ b/lib/features/orders/presentation/pages/payment_detail_page.dart @@ -193,7 +193,7 @@ class PaymentDetailPage extends ConsumerWidget { ), ); }, - loading: () => const const CustomLoadingIndicator(), + loading: () => const CustomLoadingIndicator(), error: (error, stack) => Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, diff --git a/lib/features/orders/presentation/pages/payment_qr_page.dart b/lib/features/orders/presentation/pages/payment_qr_page.dart index ac65ff4..5f9f38b 100644 --- a/lib/features/orders/presentation/pages/payment_qr_page.dart +++ b/lib/features/orders/presentation/pages/payment_qr_page.dart @@ -226,7 +226,7 @@ class PaymentQrPage extends HookConsumerWidget { border: Border.all(color: colorScheme.outlineVariant), ), child: isLoading - ? const const CustomLoadingIndicator() + ? const CustomLoadingIndicator() : qrCodeData != null && qrCodeData.isNotEmpty ? QrImageView( data: qrCodeData, diff --git a/lib/features/orders/presentation/pages/payments_page.dart b/lib/features/orders/presentation/pages/payments_page.dart index 9a2f35a..9722a7d 100644 --- a/lib/features/orders/presentation/pages/payments_page.dart +++ b/lib/features/orders/presentation/pages/payments_page.dart @@ -72,7 +72,7 @@ class PaymentsPage extends ConsumerWidget { ), ); }, - loading: () => const const CustomLoadingIndicator(), + loading: () => const CustomLoadingIndicator(), error: (error, stack) => _buildErrorState(context, ref, error), ), ); diff --git a/lib/features/price_policy/presentation/pages/price_policy_page.dart b/lib/features/price_policy/presentation/pages/price_policy_page.dart index 941d0bb..cd9ee12 100644 --- a/lib/features/price_policy/presentation/pages/price_policy_page.dart +++ b/lib/features/price_policy/presentation/pages/price_policy_page.dart @@ -165,7 +165,7 @@ class _PricePolicyPageState extends ConsumerState ), ); }, - loading: () => const const CustomLoadingIndicator(), + loading: () => const CustomLoadingIndicator(), error: (error, stack) => Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, diff --git a/lib/features/projects/presentation/pages/submission_create_page.dart b/lib/features/projects/presentation/pages/submission_create_page.dart index bdc8251..cc3e661 100644 --- a/lib/features/projects/presentation/pages/submission_create_page.dart +++ b/lib/features/projects/presentation/pages/submission_create_page.dart @@ -639,7 +639,7 @@ class _SubmissionCreatePageState extends ConsumerState { ), child: Row( children: [ - const SizedBox( + SizedBox( width: 16, height: 16, child: CustomLoadingIndicator(color: colorScheme.primary, size: 20), @@ -895,7 +895,7 @@ class _SubmissionCreatePageState extends ConsumerState { width: 48, height: 48, color: colorScheme.surfaceContainerHighest, - child: const Center( + child: Center( child: SizedBox( width: 16, height: 16, diff --git a/lib/features/projects/presentation/pages/submissions_page.dart b/lib/features/projects/presentation/pages/submissions_page.dart index e616f1a..8703ba7 100644 --- a/lib/features/projects/presentation/pages/submissions_page.dart +++ b/lib/features/projects/presentation/pages/submissions_page.dart @@ -180,7 +180,7 @@ class SubmissionsPage extends ConsumerWidget { ), ); }, - loading: () => const const CustomLoadingIndicator(), + loading: () => const CustomLoadingIndicator(), error: (error, stack) => RefreshIndicator( onRefresh: () async { await ref.read(allSubmissionsProvider.notifier).refresh(); diff --git a/lib/features/promotions/presentation/pages/promotion_detail_page.dart b/lib/features/promotions/presentation/pages/promotion_detail_page.dart index 0aa9eb9..c6b0b05 100644 --- a/lib/features/promotions/presentation/pages/promotion_detail_page.dart +++ b/lib/features/promotions/presentation/pages/promotion_detail_page.dart @@ -70,7 +70,7 @@ class _PromotionDetailPageState extends ConsumerState { foregroundColor: AppColors.grey900, centerTitle: false, ), - body: const const CustomLoadingIndicator(), + body: const CustomLoadingIndicator(), ), error: (error, stack) => Scaffold( appBar: AppBar( @@ -202,7 +202,7 @@ class _PromotionDetailPageState extends ConsumerState { placeholder: (context, url) => Container( height: 200, color: AppColors.grey100, - child: const const CustomLoadingIndicator(), + child: const CustomLoadingIndicator(), ), errorWidget: (context, url, error) => Container( height: 200, diff --git a/lib/features/promotions/presentation/pages/promotions_page.dart b/lib/features/promotions/presentation/pages/promotions_page.dart index 190b4f8..6cb21c8 100644 --- a/lib/features/promotions/presentation/pages/promotions_page.dart +++ b/lib/features/promotions/presentation/pages/promotions_page.dart @@ -44,7 +44,7 @@ class PromotionsPage extends ConsumerWidget { child: promotionsAsync.when( data: (promotions) => _buildPromotionsContent(context, promotions), - loading: () => const const CustomLoadingIndicator(), + loading: () => const CustomLoadingIndicator(), error: (error, stack) => Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, diff --git a/lib/features/promotions/presentation/widgets/promotion_card.dart b/lib/features/promotions/presentation/widgets/promotion_card.dart index 5d383c1..442c1de 100644 --- a/lib/features/promotions/presentation/widgets/promotion_card.dart +++ b/lib/features/promotions/presentation/widgets/promotion_card.dart @@ -58,7 +58,7 @@ class PromotionCard extends StatelessWidget { placeholder: (context, url) => Container( height: 150, color: AppColors.grey100, - child: const const CustomLoadingIndicator(), + child: const CustomLoadingIndicator(), ), errorWidget: (context, url, error) => Container( height: 150, diff --git a/lib/features/showrooms/presentation/pages/design_request_detail_page.dart b/lib/features/showrooms/presentation/pages/design_request_detail_page.dart index 78dde8f..2d7e805 100644 --- a/lib/features/showrooms/presentation/pages/design_request_detail_page.dart +++ b/lib/features/showrooms/presentation/pages/design_request_detail_page.dart @@ -492,7 +492,7 @@ class DesignRequestDetailPage extends ConsumerWidget { ], ), ), - loading: () => const const CustomLoadingIndicator(), + loading: () => const CustomLoadingIndicator(), error: (error, stack) => Center( child: Padding( padding: const EdgeInsets.all(40), @@ -558,7 +558,7 @@ class DesignRequestDetailPage extends ConsumerWidget { fit: BoxFit.cover, placeholder: (context, url) => Container( color: colorScheme.surfaceContainerHighest, - child: const Center( + child: Center( child: CustomLoadingIndicator(color: colorScheme.primary, size: 20), ), ), diff --git a/lib/features/showrooms/presentation/pages/model_house_detail_page.dart b/lib/features/showrooms/presentation/pages/model_house_detail_page.dart index ec0291a..957cbc1 100644 --- a/lib/features/showrooms/presentation/pages/model_house_detail_page.dart +++ b/lib/features/showrooms/presentation/pages/model_house_detail_page.dart @@ -86,7 +86,7 @@ class ModelHouseDetailPage extends ConsumerWidget { ], ), ), - loading: () => const const CustomLoadingIndicator(), + loading: () => const CustomLoadingIndicator(), error: (error, stack) => Center( child: Padding( padding: const EdgeInsets.all(40), @@ -408,7 +408,7 @@ class ModelHouseDetailPage extends ConsumerWidget { fit: BoxFit.cover, placeholder: (context, url) => Container( color: colorScheme.surfaceContainerHighest, - child: const Center( + child: Center( child: CustomLoadingIndicator(color: colorScheme.primary, size: 20), ), ), diff --git a/lib/features/showrooms/presentation/pages/model_houses_page.dart b/lib/features/showrooms/presentation/pages/model_houses_page.dart index 7cda13a..2af186e 100644 --- a/lib/features/showrooms/presentation/pages/model_houses_page.dart +++ b/lib/features/showrooms/presentation/pages/model_houses_page.dart @@ -215,7 +215,7 @@ class _LibraryTab extends ConsumerWidget { ), ); }, - loading: () => const const CustomLoadingIndicator(), + loading: () => const CustomLoadingIndicator(), error: (error, stack) => Center( child: Padding( padding: const EdgeInsets.all(40), @@ -287,7 +287,7 @@ class _LibraryCard extends StatelessWidget { placeholder: (context, url) => Container( height: 200, color: colorScheme.surfaceContainerHighest, - child: const const CustomLoadingIndicator(), + child: const CustomLoadingIndicator(), ), errorWidget: (context, url, error) => Container( height: 200, @@ -424,7 +424,7 @@ class _DesignRequestsTab extends ConsumerWidget { ), ); }, - loading: () => const const CustomLoadingIndicator(), + loading: () => const CustomLoadingIndicator(), error: (error, stack) => Center( child: Padding( padding: const EdgeInsets.all(40), diff --git a/pubspec.lock b/pubspec.lock index 9d806d9..e889e81 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -9,6 +9,14 @@ packages: url: "https://pub.dev" source: hosted version: "91.0.0" + _flutterfire_internals: + dependency: transitive + description: + name: _flutterfire_internals + sha256: "8a1f5f3020ef2a74fb93f7ab3ef127a8feea33a7a2276279113660784ee7516a" + url: "https://pub.dev" + source: hosted + version: "1.3.64" analyzer: dependency: transitive description: @@ -441,6 +449,78 @@ packages: url: "https://pub.dev" source: hosted version: "0.9.3+4" + firebase_analytics: + dependency: "direct main" + description: + name: firebase_analytics + sha256: bfb80d92eee10a6585ebd5a7e60de5caf0f2c06329e5676c0578130aea1bfe85 + url: "https://pub.dev" + source: hosted + version: "12.0.4" + firebase_analytics_platform_interface: + dependency: transitive + description: + name: firebase_analytics_platform_interface + sha256: "3b803077907def997044774f6c022d8e9204e9c0f5e205e3572d887c93dafd72" + url: "https://pub.dev" + source: hosted + version: "5.0.4" + firebase_analytics_web: + dependency: transitive + description: + name: firebase_analytics_web + sha256: "0dbd96dbe77b51185319000c0078477fdcffb4abb0018c362dd9afb9845c1e06" + url: "https://pub.dev" + source: hosted + version: "0.6.1" + firebase_core: + dependency: "direct main" + description: + name: firebase_core + sha256: "1f2dfd9f535d81f8b06d7a50ecda6eac1e6922191ed42e09ca2c84bd2288927c" + url: "https://pub.dev" + source: hosted + version: "4.2.1" + firebase_core_platform_interface: + dependency: transitive + description: + name: firebase_core_platform_interface + sha256: cccb4f572325dc14904c02fcc7db6323ad62ba02536833dddb5c02cac7341c64 + url: "https://pub.dev" + source: hosted + version: "6.0.2" + firebase_core_web: + dependency: transitive + description: + name: firebase_core_web + sha256: ff18fabb0ad0ed3595d2f2c85007ecc794aadecdff5b3bb1460b7ee47cded398 + url: "https://pub.dev" + source: hosted + version: "3.3.0" + firebase_messaging: + dependency: "direct main" + description: + name: firebase_messaging + sha256: "22086f857d2340f5d973776cfd542d3fb30cf98e1c643c3aa4a7520bb12745bb" + url: "https://pub.dev" + source: hosted + version: "16.0.4" + firebase_messaging_platform_interface: + dependency: transitive + description: + name: firebase_messaging_platform_interface + sha256: a59920cbf2eb7c83d34a5f354331210ffec116b216dc72d864d8b8eb983ca398 + url: "https://pub.dev" + source: hosted + version: "4.7.4" + firebase_messaging_web: + dependency: transitive + description: + name: firebase_messaging_web + sha256: "1183e40e6fd2a279a628951cc3b639fcf5ffe7589902632db645011eb70ebefb" + url: "https://pub.dev" + source: hosted + version: "4.1.0" fixnum: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index e1cd116..f3b2e20 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -44,6 +44,11 @@ dependencies: hive_ce: ^2.6.0 hive_ce_flutter: ^2.1.0 + #Firebase + firebase_core: 4.2.1 + firebase_analytics: 12.0.4 + firebase_messaging: 16.0.4 + # Code Generation freezed_annotation: ^3.0.0 json_annotation: ^4.9.0