Files
worker/lib/features/home/presentation/providers/promotions_provider.g.dart
2025-12-03 14:33:08 +07:00

102 lines
2.9 KiB
Dart

// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'promotions_provider.dart';
// **************************************************************************
// RiverpodGenerator
// **************************************************************************
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint, type=warning
/// Promotions Provider
///
/// Uses the same data source as news articles to avoid duplicate API calls.
/// Converts NewsArticle to Promotion entity for display in PromotionSlider.
/// Limited to 5 items max.
///
/// Usage:
/// ```dart
/// // In a ConsumerWidget
/// final promotionsAsync = ref.watch(promotionsProvider);
///
/// promotionsAsync.when(
/// data: (promotions) => PromotionSlider(promotions: promotions),
/// loading: () => const CustomLoadingIndicator(),
/// error: (error, stack) => ErrorWidget(error),
/// );
/// ```
@ProviderFor(promotions)
const promotionsProvider = PromotionsProvider._();
/// Promotions Provider
///
/// Uses the same data source as news articles to avoid duplicate API calls.
/// Converts NewsArticle to Promotion entity for display in PromotionSlider.
/// Limited to 5 items max.
///
/// Usage:
/// ```dart
/// // In a ConsumerWidget
/// final promotionsAsync = ref.watch(promotionsProvider);
///
/// promotionsAsync.when(
/// data: (promotions) => PromotionSlider(promotions: promotions),
/// loading: () => const CustomLoadingIndicator(),
/// error: (error, stack) => ErrorWidget(error),
/// );
/// ```
final class PromotionsProvider
extends
$FunctionalProvider<
AsyncValue<List<Promotion>>,
List<Promotion>,
FutureOr<List<Promotion>>
>
with $FutureModifier<List<Promotion>>, $FutureProvider<List<Promotion>> {
/// Promotions Provider
///
/// Uses the same data source as news articles to avoid duplicate API calls.
/// Converts NewsArticle to Promotion entity for display in PromotionSlider.
/// Limited to 5 items max.
///
/// Usage:
/// ```dart
/// // In a ConsumerWidget
/// final promotionsAsync = ref.watch(promotionsProvider);
///
/// promotionsAsync.when(
/// data: (promotions) => PromotionSlider(promotions: promotions),
/// loading: () => const CustomLoadingIndicator(),
/// error: (error, stack) => ErrorWidget(error),
/// );
/// ```
const PromotionsProvider._()
: super(
from: null,
argument: null,
retry: null,
name: r'promotionsProvider',
isAutoDispose: true,
dependencies: null,
$allTransitiveDependencies: null,
);
@override
String debugGetCreateSourceHash() => _$promotionsHash();
@$internal
@override
$FutureProviderElement<List<Promotion>> $createElement(
$ProviderPointer pointer,
) => $FutureProviderElement(pointer);
@override
FutureOr<List<Promotion>> create(Ref ref) {
return promotions(ref);
}
}
String _$promotionsHash() => r'2eac0298d2b84ad5cc50faa6b8a015dbf7b7a1d3';